/* Modern Deep Dark / Fintech Theme for Wallet System */
:root {
    --bg-dark: #040814;
    --bg-card: #0a1122;
    --bg-card-hover: #121e36;
    --primary-gradient: linear-gradient(135deg, #007BFF 0%, #004A99 100%);
    --primary: #004A99;
    --primary-hover: #007BFF;
    --success: #10b981;
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --danger: #ef4444;
    --warning: #f59e0b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(10, 17, 34, 0.65);
    --glass-border: rgba(0, 123, 255, 0.12);
    --sidebar-width: 260px;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    margin: 0;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: #273147;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #374665;
}

/* Glassmorphism Classes */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

/* Card Styling */
.wallet-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.wallet-card:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.5);
}

/* Premium Credit Card Graphic */
.premium-cc {
    background: linear-gradient(135deg, #1e1b4b 0%, #311042 50%, #4c1d95 100%);
    border-radius: 20px;
    padding: 24px;
    aspect-ratio: 1.586/1;
    position: relative;
    overflow: hidden;
    color: white;
    box-shadow: 0 20px 40px -15px rgba(0,0,0,0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.6s;
    transform-style: preserve-3d;
}
.premium-cc::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    pointer-events: none;
}
.cc-chip {
    width: 45px;
    height: 35px;
    background: linear-gradient(135deg, #ffd700 0%, #e5a900 100%);
    border-radius: 6px;
    position: relative;
    border: 1px solid rgba(0,0,0,0.1);
}
.cc-chip::after {
    content: '';
    position: absolute;
    top: 5px;
    left: 10px;
    right: 10px;
    bottom: 5px;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 3px;
}
.cc-vendor {
    font-size: 20px;
    font-weight: 800;
    font-style: italic;
    background: linear-gradient(90deg, #f8fafc, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.cc-number {
    font-size: 21px;
    letter-spacing: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    margin: 24px 0 12px 0;
}
.cc-label {
    font-size: 9px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 1px;
}
.cc-value {
    font-size: 14px;
    font-weight: 500;
}

/* Sidebar Navigation (Desktop) */
.sidebar-nav {
    width: var(--sidebar-width);
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    background-color: #0c1220;
    border-right: 1px solid var(--border-color);
    padding: 24px;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: all 0.3s ease;
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: 40px;
    padding-left: 8px;
}
.sidebar-logo i, .sidebar-logo svg {
    color: var(--primary);
}
.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.nav-item-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.2s ease;
    font-weight: 500;
}
.nav-item-link:hover, .nav-item-link.active {
    color: var(--text-primary);
    background-color: rgba(99, 102, 241, 0.15);
}
.nav-item-link.active {
    background: var(--primary-gradient);
    color: white !important;
}
.nav-item-link svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    transition: stroke 0.2s;
}

/* Bottom Navigation (Mobile) */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background-color: rgba(12, 18, 32, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
}
.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 10px;
    gap: 4px;
    width: 20%;
    height: 100%;
    transition: color 0.2s;
}
.mobile-nav-item.active, .mobile-nav-item:hover {
    color: var(--primary);
}
.mobile-nav-item svg {
    width: 22px;
    height: 22px;
}

/* Main Content Area */
.main-wrapper {
    margin-left: var(--sidebar-width);
    padding: 40px;
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* Auth Pages Style */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.12) 0%, transparent 45%),
                var(--bg-dark);
}
.auth-card {
    width: 100%;
    max-width: 440px;
    padding: 40px;
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 40px -15px rgba(0,0,0,0.6);
}

/* Custom Input Fields */
.form-group-custom {
    position: relative;
    margin-bottom: 24px;
}
.form-input-custom {
    width: 100%;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px 16px;
    color: white;
    font-size: 15px;
    transition: all 0.2s ease;
}
.form-input-custom:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    background-color: rgba(15, 23, 42, 0.8);
}
.form-label-custom {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: block;
}

/* Buttons */
.btn-wallet-primary {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 24px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}
.btn-wallet-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.45);
    background: linear-gradient(135deg, #7174ff 0%, #5850ee 100%);
    color: white;
}
.btn-wallet-primary:active {
    transform: translateY(1px);
}

.btn-wallet-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 12px;
    padding: 14px 24px;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}
.btn-wallet-secondary:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255,255,255,0.15);
    color: white;
}

/* Quick Action Buttons on Dashboard */
.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-decoration: none !important;
}
.quick-action-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background-color: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.quick-action-btn:hover .quick-action-icon {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 8px 16px -4px rgba(99, 102, 241, 0.3);
}
.quick-action-btn span {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Transactions Table & List */
.transaction-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-radius: 14px;
    background-color: rgba(255,255,255,0.01);
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}
.transaction-item:hover {
    background-color: rgba(255,255,255,0.03);
    border-color: var(--border-color);
}
.transaction-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tx-in {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success);
}
.tx-out {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}
.tx-card {
    background-color: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}
.transaction-details {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-grow: 1;
    min-width: 0; /* allows text truncation */
}
.tx-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.tx-meta {
    font-size: 12px;
    color: var(--text-secondary);
}
.tx-amount {
    font-size: 16px;
    font-weight: 700;
    text-align: right;
}
.amount-plus {
    color: var(--success);
}
.amount-minus {
    color: var(--text-primary);
}

/* OTP Code Box Styles */
.otp-inputs {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin: 24px 0;
}
.otp-field {
    width: 50px;
    height: 56px;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    border-radius: 12px;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    color: white;
    transition: all 0.2s ease;
}
.otp-field:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    background-color: rgba(15, 23, 42, 0.8);
}

/* User Profile Badge */
.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 12px;
    background-color: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    margin-top: auto;
}
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}
.user-info {
    line-height: 1.2;
}
.user-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}
.user-role {
    font-size: 11px;
    color: var(--text-secondary);
}

/* Responsive styling overrides */
@media (max-width: 991px) {
    .sidebar-nav {
        transform: translateX(-100%);
    }
    .sidebar-nav.open {
        transform: translateX(0);
    }
    .main-wrapper {
        margin-left: 0;
        padding: 24px 16px 88px 16px;
    }
    .mobile-nav {
        display: flex;
    }
}

/* Card flip effect details */
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: left;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}
.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 20px;
}
.flip-card-back {
    background: linear-gradient(135deg, #100e26 0%, #1c0926 50%, #290e52 100%);
    transform: rotateY(180deg);
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.flipped .flip-card-inner {
    transform: rotateY(180deg);
}
.card-magnetic-strip {
    height: 45px;
    background: #000;
    margin: 10px -24px 0 -24px;
}
.card-signature-area {
    background: #eee;
    color: #000;
    padding: 6px;
    font-style: italic;
    font-size: 12px;
    font-family: sans-serif;
    border-radius: 4px;
    width: 70%;
    display: inline-block;
}
.card-cvv {
    background: #fff;
    color: #000;
    font-weight: bold;
    padding: 6px 12px;
    border-radius: 4px;
    display: inline-block;
}

/* Responsive Spacing Optimization on Mobile */
@media (max-width: 576px) {
    /* 1. Reduce main wrapper padding to expand card to edges */
    .main-wrapper {
        padding: 16px 8px 88px 8px !important;
    }
    
    /* 2. Reduce card padding to expand contents inside card */
    .wallet-card {
        padding: 14px 10px !important;
        border-radius: 12px !important;
    }
    
    /* 3. Reduce transaction items padding and sizes */
    .transaction-item {
        padding: 10px 8px !important;
        border-radius: 10px !important;
        gap: 8px !important;
    }
    .transaction-icon-box {
        width: 34px !important;
        height: 34px !important;
        border-radius: 8px !important;
    }
    .transaction-icon-box svg {
        width: 16px !important;
        height: 16px !important;
    }
    
    /* 4. Text sizes and alignment */
    .tx-title {
        font-size: 13px !important;
    }
    .tx-meta {
        font-size: 10px !important;
    }
    .tx-amount {
        font-size: 13px !important;
        min-width: 72px !important;
    }
    
    /* 5. Make the category buttons horizontally scrollable instead of squeezed */
    #filterCategoryGroup {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 6px !important;
        border: none !important;
        padding-bottom: 6px !important;
    }
    #filterCategoryGroup .btn-filter {
        border-radius: 30px !important;
        padding: 6px 12px !important;
        font-size: 11px !important;
        flex-shrink: 0 !important;
        border: 1px solid rgba(255, 255, 255, 0.15) !important;
    }
    #filterCategoryGroup .btn-filter.active {
        background: var(--primary-gradient) !important;
        border-color: var(--primary) !important;
        color: white !important;
    }
}
