/* =============================================
   V3 DESIGN SYSTEM - AURORA GLASS
   ============================================= */

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

:root {
    /* Nouvelle Palette "Aurora" */
    --primary: #818cf8;      /* Indigo clair */
    --primary-dark: #4f46e5; /* Indigo */
    --primary-glow: rgba(129, 140, 248, 0.5);
    
    --secondary: #c084fc;    /* Purple clair */
    --secondary-glow: rgba(192, 132, 252, 0.5);
    
    --accent: #f472b6;       /* Pink */
    --accent-glow: rgba(244, 114, 182, 0.5);
    
    --success: #34d399;      /* Emerald */
    --warning: #fbbf24;      /* Amber */
    --error: #f87171;        /* Red */
    
    /* Backgrounds Profonds */
    --bg-body: #020617;      /* Slate 950+ */
    --bg-glass: rgba(15, 23, 42, 0.6);
    --bg-glass-strong: rgba(2, 6, 23, 0.85);
    --bg-input: rgba(255, 255, 255, 0.03);
    
    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Borders & Effects */
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-hover: rgba(255, 255, 255, 0.15);
    
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;
    
    --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.15);
    
    --blur: 24px;
    --ease-out: cubic-bezier(0.34, 1.56, 0.64, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-body);
    /* Complex Aurora Gradient Background */
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(79, 70, 229, 0.15) 0px, transparent 40%),
        radial-gradient(circle at 100% 0%, rgba(192, 132, 252, 0.15) 0px, transparent 40%),
        radial-gradient(circle at 100% 100%, rgba(244, 114, 182, 0.15) 0px, transparent 40%),
        radial-gradient(circle at 0% 100%, rgba(52, 211, 153, 0.1) 0px, transparent 40%);
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-bottom: env(safe-area-inset-bottom);
    min-height: 100vh;
}

/* Scrollbar Moderne */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* =============================================
   LAYOUT & STRUCTURE
   ============================================= */

.main-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
    padding-bottom: 140px; /* Espace pour le menu */
}

/* Navigation - Floating Island */
.nav-tabs {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    min-width: 320px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--border-glass);
    border-radius: 100px;
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    align-items: center;
    z-index: 1000;
    box-shadow: 
        0 20px 40px -10px rgba(0,0,0,0.5),
        0 0 0 1px rgba(255,255,255,0.05) inset;
}

.nav-balance {
    position: absolute;
    top: -50px;
    right: 0;
    left: 0;
    width: fit-content;
    margin: 0 auto;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(var(--blur));
    padding: 0.5rem 1.2rem;
    border-radius: 100px;
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: var(--shadow-glass);
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.nav-balance:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.balance-label {
    color: var(--primary);
    font-size: 1rem;
}

.balance-amount {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    letter-spacing: 0.5px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-icon {
    font-size: 1.3rem;
    transition: all 0.3s var(--ease-out);
}

.tab-label {
    position: absolute;
    bottom: -20px;
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s var(--ease-out);
    white-space: nowrap;
    pointer-events: none;
}

/* Active State */
.tab-btn.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.15);
}

.tab-btn.active .tab-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.tab-btn:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(255,255,255,0.05);
}

/* =============================================
   COMPONENTS - CARDS & CONTAINERS
   ============================================= */

/* Glass Card */
.card {
    background: var(--bg-glass);
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-glass);
    transition: transform 0.3s var(--ease-out), border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* Version Web 3.0 pour la recharge - Layout Groupé */

@keyframes gradient-shift-main {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes fade-in-main {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-icon-main {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

/* Container principal avec layout 2 colonnes */
.recharge-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
    align-items: start;
}

.recharge-section,
.payment-section {
    min-height: 400px;
}

.card.recharge-card {
    margin: 0;
    padding: 0;
}

.card.payment-card {
    margin: 0;
}

.card.recharge-card.minimal {
    background: rgba(10, 10, 20, 0.5);
    border: 1px solid transparent;
    border-radius: 20px;
    padding: 36px 32px;
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card.recharge-card.minimal::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(
        45deg,
        rgba(129, 140, 248, 0.4),
        rgba(244, 114, 182, 0.4),
        rgba(6, 182, 212, 0.4),
        rgba(129, 140, 248, 0.4)
    );
    background-size: 300% 300%;
    border-radius: 20px;
    z-index: -1;
    animation: gradient-shift-main 4s ease infinite;
    filter: blur(6px);
    opacity: 0.4;
}

.card.recharge-card.minimal::after {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(129, 140, 248, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(244, 114, 182, 0.05) 0%, transparent 50%);
    border-radius: 20px;
    pointer-events: none;
    z-index: -1;
}

.card.recharge-card.minimal:hover {
    transform: translateY(-2px);
}

.card.recharge-card h3.minimal-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 2rem;
    text-align: center;
    letter-spacing: -0.02em;
    background: linear-gradient(
        135deg,
        #ffffff 0%,
        #818cf8 50%,
        #f472b6 100%
    );
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift-main 4s ease infinite;
    filter: drop-shadow(0 0 8px rgba(129, 140, 248, 0.3));
    position: relative;
}

.card.recharge-card h3.minimal-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #818cf8, #f472b6, transparent);
    border-radius: 2px;
    box-shadow: 0 0 6px rgba(129, 140, 248, 0.5);
    animation: gradient-shift-main 4s ease infinite;
    background-size: 200% 200%;
}

/* Glow effect on hover */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
    transition: left 0.5s;
    pointer-events: none;
}

.card:hover::before {
    left: 100%;
}

.card:hover {
    border-color: var(--border-glass-hover);
    transform: translateY(-2px);
}

.card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Presets pour montants rapides - Web 3.0 Compact */
.amount-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 1.25rem;
}

.preset-btn {
    padding: 12px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(129, 140, 248, 0.2);
    border-radius: 10px;
    color: #a5b4fc;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.preset-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.3), rgba(244, 114, 182, 0.3));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.preset-btn:hover {
    background: rgba(129, 140, 248, 0.25);
    border-color: rgba(129, 140, 248, 0.5);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 
        0 4px 12px rgba(129, 140, 248, 0.3),
        0 0 20px rgba(129, 140, 248, 0.2);
}

.preset-btn:hover::before {
    opacity: 1;
}

.preset-btn:active {
    transform: translateY(0);
}

/* Layout vertical Web 3.0 */
.recharge-card .filter-group.minimal-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.recharge-card .filter-group.minimal-group input {
    padding: 16px 20px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(129, 140, 248, 0.3);
    border-radius: 12px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #ffffff;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.recharge-card .filter-group.minimal-group input:hover {
    background: rgba(30, 41, 59, 0.5);
    border-color: rgba(129, 140, 248, 0.4);
    box-shadow: 0 4px 16px rgba(129, 140, 248, 0.15);
}

.recharge-card .filter-group.minimal-group input:focus {
    border-color: rgba(129, 140, 248, 0.6);
    background: rgba(30, 41, 59, 0.6);
    box-shadow: 
        0 0 0 3px rgba(129, 140, 248, 0.15),
        0 4px 20px rgba(129, 140, 248, 0.25);
    transform: translateY(-1px);
}

.recharge-card .action-btn.minimal-btn {
    background: linear-gradient(
        135deg,
        #818cf8 0%,
        #8b5cf6 50%,
        #f472b6 100%
    );
    background-size: 200% 200%;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 15px;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 6px 20px rgba(129, 140, 248, 0.3),
        0 0 30px rgba(129, 140, 248, 0.2);
    animation: gradient-shift-main 4s ease infinite;
}

.recharge-card .action-btn.minimal-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.recharge-card .action-btn.minimal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 8px 30px rgba(129, 140, 248, 0.4),
        0 0 40px rgba(129, 140, 248, 0.3),
        0 0 60px rgba(244, 114, 182, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
}

.recharge-card .action-btn.minimal-btn:hover::before {
    opacity: 1;
}

.recharge-card .action-btn.minimal-btn:active {
    transform: translateY(0);
}

.section-header {
    margin-bottom: 2rem;
    text-align: center;
    padding: 1rem 0;
}

.section-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* =============================================
   STATS & DASHBOARD
   ============================================= */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.stat-item {
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    padding: 1.5rem 1rem;
    text-align: center;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--border-glass);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    text-shadow: 0 0 20px var(--primary-glow);
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =============================================
   BUTTONS & INPUTS
   ============================================= */

.action-btn {
    width: 100%;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: all 0.3s var(--ease-out);
    position: relative;
    overflow: hidden;
}

/* Primary Button */
.action-btn.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.action-btn.primary:hover {
    box-shadow: 0 4px 12px var(--primary-glow);
    transform: translateY(-1px);
}

.action-btn.primary:active {
    transform: translateY(0);
}

/* Secondary Button */
.action-btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}

.action-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Tertiary Button */
.action-btn.tertiary {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
}

.action-btn.tertiary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* Inputs */
input, select, textarea {
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--bg-input);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

select option {
    background: #0f172a;
    color: #f8fafc;
    padding: 0.5rem;
}

/* Payment details section - Web 3.0 Compact */
.payment-details.minimal {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.payment-amount.minimal {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1.5rem 0;
    border: none;
    position: relative;
}

.payment-amount.minimal::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #818cf8, #f472b6, transparent);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(129, 140, 248, 0.5);
    animation: gradient-shift-main 4s ease infinite;
    background-size: 200% 200%;
}

.payment-amount.minimal span {
    font-size: 2rem;
    font-weight: 600;
    background: linear-gradient(
        135deg,
        #ffffff 0%,
        #818cf8 50%,
        #f472b6 100%
    );
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
    animation: gradient-shift-main 4s ease infinite;
    filter: drop-shadow(0 0 10px rgba(129, 140, 248, 0.4));
}

/* État en attente (avant création du paiement) */
.payment-pending-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    text-align: center;
    padding: 40px 20px;
}

.pending-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(129, 140, 248, 0.1);
    border: 2px solid rgba(129, 140, 248, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    animation: pulse-icon-main 2s ease-in-out infinite;
}

.pending-icon i {
    font-size: 2rem;
    color: #818cf8;
}

.payment-pending-state h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.payment-pending-state p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 280px;
    line-height: 1.5;
}

.payment-active-state {
    animation: fade-in-main 0.4s ease;
}

/* Responsive */
@media (max-width: 968px) {
    .recharge-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .payment-section {
        min-height: 300px;
    }
    
    .payment-pending-state {
        min-height: 300px;
        padding: 30px 20px;
    }
    
    .pending-icon {
        width: 60px;
        height: 60px;
    }
    
    .pending-icon i {
        font-size: 1.5rem;
    }
}

/* =============================================
   CARDS & PRODUCTS
   ============================================= */

/* Compact Search Bar */
.search-filter-card {
    padding: 1rem !important;
    margin-bottom: 1.5rem !important;
    background: rgba(15, 23, 42, 0.6);
}

.search-container-compact {
    position: relative;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.search-input-compact {
    width: 100%;
    padding: 0.8rem 2.5rem 0.8rem 2.8rem !important;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    font-size: 0.95rem;
}

.search-input-compact:focus {
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
}

.search-icon-compact {
    position: absolute;
    left: 1.2rem;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

.clear-search-compact {
    position: absolute;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-search-compact:hover {
    color: var(--text-primary);
}

.search-info-compact {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-top: 1rem;
}

/* Filters */
.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-group label i {
    color: var(--primary);
}

.filter-group select {
    padding: 0.7rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card-item {
    position: relative;
    border-radius: var(--radius-lg);
    transition: transform 0.3s var(--ease-out);
    cursor: pointer;
}

.card-item:hover {
    transform: translateY(-8px) scale(1.02);
    z-index: 10;
}

/* Design Carte Bancaire (Keep original logic but updated style) */
.card-bank-design {
    aspect-ratio: 1.586;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #1e293b, #0f172a);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.1);
}

/* Image overrides for specific BINs */
.card-item.card-bin-513778 .card-bank-design { background-image: url('/static/images/cards/513778.jpg'); background-size: cover; background-position: center; }
.card-item.card-bin-513781 .card-bank-design { background-image: url('/static/images/cards/513781.jpg'); background-size: cover; background-position: center; }
.card-item.card-bin-497414 .card-bank-design { background-image: url('/static/images/cards/497414.jpg'); background-size: cover; background-position: center; }
.card-item.card-bin-418794 .card-bank-design { background-image: url('/static/images/cards/418794.jpg'); background-size: cover; background-position: center; }

/* Legacy Support */
.card-item.card-sg-4973 .card-bank-design { background-image: url('/static/images/cards/sg-4973.jpg'); background-size: cover; background-position: center; }
.card-item.card-sg-4561 .card-bank-design { background-image: url('/static/images/cards/sg-4561.jpg'); background-size: cover; background-position: center; }
.card-item.card-ca-4533 .card-bank-design { background-image: url('/static/images/cards/ca-4533.jpg'); background-size: cover; background-position: center; }


.card-bin-display {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-family: 'Courier New', monospace;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.card-holder-info {
    position: absolute;
    bottom: 4rem;
    left: 1.5rem;
}

.card-holder-name {
    font-size: 1.1rem;
    text-transform: uppercase;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    font-family: 'Courier New', monospace;
}

.card-city-postal {
    position: absolute;
    bottom: 2.5rem;
    left: 1.5rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.7);
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

.card-footer-inline {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
}

.buy-card-btn-inline {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.buy-card-btn-inline:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.05);
}

/* =============================================
   CHAT & MESSAGING
   ============================================= */

.chat-card {
    height: 650px; 
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255,255,255,0.02);
}

.chat-message {
    max-width: 85%;
    padding: 1rem;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    animation: slideUp 0.3s ease;
}

.chat-message-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.chat-username {
    color: var(--accent);
    font-weight: 700;
}

.chat-text {
    font-size: 0.95rem;
    line-height: 1.5;
}

.chat-input-container {
    background: var(--bg-glass-strong);
    padding: 0.5rem;
    border-radius: 50px;
    border: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.chat-input-container input {
    background: transparent;
    border: none;
    padding: 0.8rem 1.5rem;
    color: white;
    box-shadow: none;
}

.chat-input-container input:focus {
    background: transparent;
    box-shadow: none;
}

.send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.1) rotate(-10deg);
}

/* Media Upload */
.media-btn {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 0 1rem;
    cursor: pointer;
    transition: color 0.2s;
}

.media-btn:hover {
    color: var(--primary);
}

/* =============================================
   BANNER & HERO
   ============================================= */

.welcome-banner {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
    border: 1px solid var(--border-glass);
    height: 200px; /* Fixed height */
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-overlay {
    background: linear-gradient(to top, rgba(2, 6, 23, 0.95), rgba(2, 6, 23, 0.3));
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 1rem;
}

.banner-text {
    text-align: center;
    z-index: 2;
}

.banner-title {
    font-size: 2rem;
    font-weight: 900;
    color: #fff;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 30px rgba(129, 140, 248, 0.6);
}

.banner-link {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    margin-top: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.banner-link:hover {
    background: white;
    color: var(--primary-dark);
    transform: translateY(-2px);
}

/* Info Banner */
.info-banner {
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.1), rgba(192, 132, 252, 0.1));
    backdrop-filter: blur(var(--blur));
    -webkit-backdrop-filter: blur(var(--blur));
    border: 1px solid rgba(129, 140, 248, 0.3);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 15px rgba(129, 140, 248, 0.1);
    animation: slideDown 0.5s ease;
}

.info-icon {
    font-size: 1.5rem;
    color: var(--primary);
    flex-shrink: 0;
    background: rgba(129, 140, 248, 0.2);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.info-content {
    flex: 1;
}

.info-label {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.95rem;
    margin-right: 0.5rem;
}

.info-text {
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.4;
}

/* =============================================
   UTILITIES & ANIMATIONS
   ============================================= */

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.hidden { display: none !important; }

/* Tab System */
.tab-content {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-content.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
    animation: fadeIn 0.4s ease forwards;
}

/* Spinner */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.8);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    flex-direction: column;
    gap: 1rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* =============================================
   SELECTION CONTROLS
   ============================================= */
.selection-controls {
    position: sticky;
    top: 1rem;
    z-index: 90;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(20px);
    border: 1px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    gap: 1rem;
}

.selection-info {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.selection-info i { color: var(--success); }

.btn-buy-selection {
    background: var(--primary);
    border: none;
    color: white;
    padding: 0.7rem 1.4rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 4px 10px var(--primary-glow);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-buy-selection:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px var(--primary-glow);
}

.card-item.selected {
    transform: scale(0.98);
    opacity: 0.9;
    border: 2px solid var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.selection-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--success);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    z-index: 20;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.4);
}

/* =============================================
   ADMIN STYLES & EXTRAS
   ============================================= */
/* Keeping essential admin styles with new variables */
.admin-user-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.delivery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.delivery-modal-content {
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-glass);
}

.delivery-item-content {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: var(--radius-sm);
    font-family: monospace;
    color: var(--text-secondary);
}

/* Logout Button */
.logout-btn {
    margin-left: 1rem;
    padding: 0.5rem 0.75rem;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* =============================================
   BASE SELECTION & PRODUCTS
   ============================================= */
.base-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.base-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.base-card:hover, .base-card.selected {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 4px 15px var(--primary-glow);
}

.base-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: var(--secondary);
}

.base-name {
    font-weight: 700;
    color: var(--text-primary);
}

.base-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.base-price {
    font-size: 0.8rem;
    color: var(--success);
    font-weight: 600;
}

/* Bank Grid */
.bank-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.bank-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.bank-item:hover, .bank-item.selected {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary);
}

.bank-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.bank-count {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* =============================================
   MY CARDS & HISTORY
   ============================================= */
.my-cards-list, .history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.my-card-item {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 1rem;
    overflow: hidden;
}

.my-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-glass);
}

.my-card-number {
    font-weight: 700;
    color: var(--primary);
}

.my-card-bank {
    font-weight: 600;
    color: var(--text-primary);
}

.my-card-line {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.my-card-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-detail-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.card-detail-label {
    color: var(--text-secondary);
}

.card-detail-value {
    color: var(--text-primary);
    font-weight: 500;
}

.copy-btn {
    background: transparent;
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.copy-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* History */
.history-item {
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-md);
    padding: 1rem;
    border-left: 3px solid var(--primary);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.history-cost {
    color: var(--error);
}

.history-details {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.history-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Checkbox wrapper */
.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.checkbox-wrapper input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    margin: 0;
}

.age-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.age-inputs input {
    width: 80px;
}

/* Responsive */
@media (max-width: 768px) {
    .card.recharge-card {
        max-width: 100%;
    }
    
    .card.recharge-card.minimal {
        padding: 36px 24px;
    }
    
    .card.recharge-card h3.minimal-title {
        font-size: 1.6rem;
        margin-bottom: 2rem;
    }
    
    .amount-presets {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

@media (max-width: 600px) {
    .nav-tabs {
        width: 100%;
        bottom: 0;
        left: 0;
        transform: none;
        border-radius: 20px 20px 0 0;
        padding: 0.5rem 0;
        padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
        border-bottom: none;
        justify-content: space-around;
        gap: 0;
    }
    
    .tab-btn {
        width: 100%;
        height: auto;
        border-radius: 0;
        padding: 0.5rem 0;
    }
    
    .tab-btn.active {
        background: transparent;
        color: var(--primary);
    }
    
    .tab-icon {
        font-size: 1.4rem;
    }
    
    .nav-balance {
        top: -60px;
    }
    
    .main-content {
        padding: 1rem;
        padding-bottom: 100px;
    }
    
    .card-bank-design {
        aspect-ratio: 1.5;
    }
    
    .card.recharge-card.minimal {
        padding: 28px 20px;
        border-radius: 16px;
    }
    
    .card.recharge-card h3.minimal-title {
        font-size: 1.5rem;
    }
    
    .preset-btn {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .recharge-card .filter-group.minimal-group input {
        font-size: 1.1rem;
        padding: 16px 20px;
    }
    
    .payment-amount.minimal span {
        font-size: 2rem;
    }
}
