/* Premium TorPin TWA Styles - Fullscreen & Glassmorphism */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --accent-color: #8b5cf6;
    /* Vibrant Purple */
    --accent-hover: #7c3aed;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    /* Deep animated gradient background for premium feel */
    background: linear-gradient(135deg, #09090b, #111827, #1e1b4b);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Glassmorphism Utility */
.glass-effect {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
}

/* Header */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5rem 20px 15px 20px;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(17, 24, 39, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.logo h1 {
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(45deg, #60a5fa, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.user-info {
    display: flex;
    align-items: center;
    padding: 6px 12px 6px 6px;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.user-info:active {
    transform: scale(0.94);
    background: rgba(255, 255, 255, 0.1);
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.details {
    display: flex;
    flex-direction: column;
}

.username {
    font-size: 14px;
    font-weight: 600;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.balance {
    font-size: 13px;
    font-weight: 700;
    color: #fca5a5;
    display: flex;
    align-items: center;
    gap: 4px;
    text-shadow: 0 0 5px rgba(252, 165, 165, 0.3);
}

/* Products */
.products-container {
    padding: 24px 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding-bottom: 100px;
    /* Space for FAB */
}

.product-card {
    border-radius: 20px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    /* Ribbon clip */
}

.product-card:active {
    transform: scale(0.95) translateY(2px);
    border-color: var(--accent-color);
}

.discount-badge {
    position: absolute;
    top: 15px;
    left: -35px;
    width: 150px;
    text-align: center;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: white;
    font-size: 13px;
    font-weight: 900;
    padding: 5px 0;
    transform: rotate(-45deg);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.4);
    z-index: 2;
    letter-spacing: 1px;
    text-transform: uppercase;
}

@keyframes popIn {
    0% {
        transform: scale(0);
    }

    100% {
        transform: scale(1);
    }
}

.product-image {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 14px;
    margin-bottom: 14px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1;
    /* Ribbon displays over it */
}

.product-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    text-align: center;
    color: var(--text-primary);
}

.product-price {
    font-size: 15px;
    font-weight: 800;
    margin-bottom: 14px;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.current-price {
    color: #fbbf24;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 16px;
}

.old-price {
    font-size: 14px;
    color: #9ca3af;
    position: relative;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Kırmızı belirgin çizik */
.old-price::after {
    content: '';
    position: absolute;
    left: -2px;
    right: -2px;
    top: 50%;
    height: 2px;
    background-color: #ef4444;
    transform: rotate(-10deg);
}

.add-to-cart-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    transition: all 0.2s ease;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: flex-end;
    z-index: 100;
}

.modal-content {
    width: 100%;
    background: linear-gradient(180deg, #1e293b, #0f172a);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.5);
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
    padding: 24px;
    animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-header h2 {
    font-weight: 700;
    font-size: 22px;
}

.close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    color: var(--text-primary);
    cursor: pointer;
    transition: background 0.2s;
}

.close-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 5px;
    /* for scrollbar */
}

.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

/* Cart Specific */
.floating-cart {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    color: #fff;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 26px;
    box-shadow: 0 10px 25px rgba(236, 72, 153, 0.5);
    cursor: pointer;
    z-index: 50;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-cart:active {
    transform: scale(0.9);
}

.cart-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: var(--text-primary);
    color: #8b5cf6;
    font-size: 13px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.cart-item {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.cart-item img {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    margin-right: 16px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.cart-item-info {
    flex-grow: 1;
}

.cart-item-title {
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 2px;
}

.cart-item-price {
    font-size: 14px;
    color: #fbbf24;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
}

.cart-item-config {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.2);
    padding: 6px 8px;
    border-radius: 8px;
    line-height: 1.4;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cart-item-config strong {
    color: rgba(255, 255, 255, 0.7);
}

.cart-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.qty-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    width: 28px;
    height: 28px;
    border-radius: 14px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.qty-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

.qty-val {
    width: 24px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.remove-btn {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
    border: none;
    border-radius: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.edit-btn {
    background: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border: none;
    border-radius: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.modal-footer {
    padding-top: 20px;
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.total {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 16px;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.total span {
    color: #fbbf24;
}

/* Checkout Button */
.checkout-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
    transition: opacity 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.checkout-btn:active {
    opacity: 0.8;
    transform: translateY(1px);
    box-shadow: none;
}

/* Custom Inputs in History */
.stars-input-container {
    width: 100%;
    padding: 0 0 10px 0;
}

.stars-input-container .action-row {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.btn-outline {
    flex: 1;
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--accent-color);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-outline:active {
    background: var(--accent-color);
}

.custom-input-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.custom-input {
    flex: 2;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    outline: none;
    font-size: 16px;
    font-family: inherit;
    transition: border-color 0.2s;
}

.custom-input:focus {
    border-color: var(--accent-color);
}

.btn-submit {
    flex: 1;
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: #fff;
    padding: 16px;
    border-radius: 14px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    transition: transform 0.2s;
}

.btn-submit:active {
    transform: scale(0.95);
}

/* History Items */
.history-item {
    padding: 16px;
    border-radius: 16px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.history-icon-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.history-icon-wrapper.deposit {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.history-icon-wrapper.purchase {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.history-content {
    flex-grow: 1;
}

.history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.history-header strong {
    font-size: 16px;
    font-weight: 700;
}

.history-amount {
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 4px;
}

.history-amount.deposit {
    color: var(--success-color);
}

.history-amount.purchase {
    color: var(--text-primary);
}

/* Keep it clean */

.history-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.history-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-date {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.badge-pending {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.badge-approved {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.badge-completed {
    background: linear-gradient(135deg, #10b981, #059669);
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 0;
    font-weight: 500;
}

.loading-state {
    text-align: center;
    color: var(--accent-color);
    padding: 40px 0;
    font-weight: 600;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}