/* assets/css/style.css - VERSION 4.0 (COMPLETE & FIXED) */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --bg-dark: #090c15;
    --card-bg: rgba(22, 28, 45, 0.7);
    --primary: #3b82f6; /* Electric Blue */
    --accent: #8b5cf6; /* Neon Purple */
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
    padding-bottom: 90px; /* Space for Bottom Nav */
    overflow-x: hidden;
    transition: background-color 0.3s ease;
}

/* ===========================
   1. GLOBAL COMPONENTS
   =========================== */

/* Premium Inputs (Global) */
.app-input {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-radius: 12px;
    padding: 15px;
    width: 100%;
    outline: none;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace; 
}
.app-input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
    background: rgba(0, 0, 0, 0.6) !important;
}

/* Premium Buttons */
.btn-premium {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    padding: 16px;
    border-radius: 50px;
    font-weight: 600;
    width: 100%;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.9rem;
    margin-top: 20px;
    display: block;
    transition: transform 0.2s;
}
.btn-premium:active { transform: scale(0.98); }

/* Glass Cards */
.app-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
}

/* Stylish Line (Dashboard) */
.stylish-line {
    height: 1px;
    width: 100%;
    margin: 10px 0 25px 0;
    background: linear-gradient(90deg, transparent 0%, var(--primary) 50%, transparent 100%);
    opacity: 0.6;
    position: relative;
}
.stylish-line::after {
    content: '';
    position: absolute; top: -3px; left: 50%; transform: translateX(-50%);
    width: 60px; height: 7px;
    background: var(--primary);
    filter: blur(8px);
    border-radius: 10px;
}

/* Header Fix */
.app-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.app-header h5 { font-weight: 700; letter-spacing: 0.5px; }

/* Utilities */
.text-white { color: var(--text-main) !important; }
.bg-dark { background-color: var(--bg-dark) !important; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ===========================
   2. BOTTOM NAVIGATION
   =========================== */
.mobile-nav {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 70px;
    background: rgba(9, 12, 21, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255,255,255,0.1);
    display: flex; justify-content: space-around; align-items: center;
    z-index: 9999;
    padding-bottom: 5px;
}
.nav-item {
    color: var(--text-muted); text-align: center; font-size: 0.7rem; text-decoration: none;
    display: flex; flex-direction: column; align-items: center; width: 25%;
}
.nav-item i { font-size: 1.4rem; margin-bottom: 4px; display: block; }
.nav-item.active { color: var(--primary); }
.nav-item.active i { filter: drop-shadow(0 0 8px var(--primary)); }

/* ===========================
   3. SIDEBAR MENU (CHARCOAL FIXED)
   =========================== */
.sidebar-menu {
    height: 100%;
    width: 280px;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: -280px; /* Hidden by default */
    background-color: #212429 !important; /* CHARCOAL COLOR */
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column; 
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

/* Profile Header */
.sidebar-profile {
    position: relative;
    padding: 40px 20px 20px 20px;
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.15) 0%, #212429 100%);
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.sidebar-avatar {
    width: 85px; height: 85px;
    border-radius: 50% !important;
    border: 4px solid #282c34;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    object-fit: cover;
    margin-bottom: 12px;
    background: #fff;
    display: block; margin-left: auto; margin-right: auto;
}

.user-name { font-size: 1.2rem; letter-spacing: 0.5px; color: #ffffff; font-weight: 700; }
.user-email { font-size: 0.8rem; color: #94a3b8; margin-bottom: 10px; }

.user-id-badge {
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.75rem;
    color: #cbd5e1;
    display: inline-block;
}

.sidebar-balance {
    margin-top: 15px; padding: 12px;
    background: rgba(0,0,0,0.25);
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.03);
}

/* Menu Links */
.sidebar-scroll {
    flex-grow: 1; overflow-y: auto; padding: 20px 15px;
}
.sidebar-link {
    display: flex; align-items: center; padding: 14px 18px;
    text-decoration: none; font-size: 0.95rem; color: #b0b3b8;
    border-radius: 12px; margin-bottom: 5px; transition: all 0.2s ease;
}
.sidebar-link i { width: 30px; font-size: 1.1rem; color: #3b82f6; }
.sidebar-link:hover, .sidebar-link.active {
    background: rgba(59, 130, 246, 0.1); color: #ffffff; font-weight: 600;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid rgba(255,255,255,0.05);
    text-align: center;
}
.btn-logout {
    display: block; background: #ef4444; color: white; width: 100%;
    padding: 12px; border-radius: 50px; font-weight: 600; text-decoration: none;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2); transition: transform 0.2s;
}
.btn-logout:active { transform: scale(0.98); }

/* ===========================
   4. FIXED AUTH PAGES (LOGIN / REGISTER)
   =========================== */
.auth-container {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.auth-card {
    width: 100%; max-width: 400px;
    background: rgba(22, 28, 45, 0.9) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px; padding: 40px 30px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

/* FIX: Input Groups (The White Box Issue) */
.input-group-text {
    background-color: rgba(0, 0, 0, 0.4) !important; /* Force Dark */
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #94a3b8 !important; 
    border-right: none !important;
}

/* FIX: The Input Field Itself */
.auth-input {
    background-color: rgba(0, 0, 0, 0.4) !important; /* Force Dark */
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-left: none !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

/* Focus State */
.auth-input:focus, .input-group-text:has(+ .auth-input:focus) {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2) !important;
}

.auth-link { color: #3b82f6; text-decoration: none; font-weight: 600; }
.auth-link:hover { text-decoration: underline; color: #8b5cf6; }
::placeholder { color: #64748b !important; opacity: 1; }

/* ===========================
   5. LIGHT MODE SUPPORT
   =========================== */
body.light-mode { background-color: #f4f7fe; color: #1e293b; }
body.light-mode .app-card { background: #ffffff; border: 1px solid rgba(0,0,0,0.05); box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
body.light-mode .mobile-nav { background: #ffffff; border-top: 1px solid rgba(0,0,0,0.05); }
body.light-mode .text-white { color: #1e293b !important; }
body.light-mode .text-white-50 { color: #64748b !important; }
body.light-mode .sidebar-menu { background: #ffffff !important; border-right: 1px solid #e2e8f0; }
body.light-mode .sidebar-profile { background: linear-gradient(180deg, #eef2ff 0%, #ffffff 100%); }
body.light-mode .sidebar-avatar { border-color: #ffffff; }
body.light-mode .user-name { color: #1e293b; }
body.light-mode .sidebar-balance { background: #f8fafc; border-color: #e2e8f0; }
body.light-mode .sidebar-balance h3 { color: #1e293b !important; }
body.light-mode .sidebar-link { color: #64748b; }
body.light-mode .sidebar-link:hover { background: #eff6ff; color: #3b82f6; }
body.light-mode .sidebar-footer { background: #f8fafc; border-top: 1px solid #e2e8f0; }

/* ===========================
   PROFILE MODAL STYLES
   =========================== */
.profile-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none; /* Hidden by default */
    align-items: flex-start; /* Align to top */
    justify-content: flex-end; /* Align to right */
    padding: 70px 20px 0 0; /* Position below header */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-backdrop.show {
    display: flex;
    opacity: 1;
}

.profile-modal {
    width: 320px;
    background: #161b22; /* Darker charcoal */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profile-backdrop.show .profile-modal {
    transform: translateY(0);
}

.pm-header {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(9, 12, 21, 0));
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.pm-balance {
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 15px;
    margin: 15px 15px 0 15px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
}

.pm-actions {
    display: flex;
    padding: 15px;
    gap: 10px;
}

.pm-btn {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    padding: 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    text-align: center;
    text-decoration: none;
    transition: 0.2s;
}
.pm-btn:hover { background: rgba(59, 130, 246, 0.2); border-color: #3b82f6; color: white; }

.pm-list { padding: 5px 0; }
.pm-link {
    display: block; padding: 12px 20px;
    color: #94a3b8; text-decoration: none; font-size: 0.9rem;
    transition: 0.2s;
    border-left: 3px solid transparent;
}
.pm-link:hover {
    background: rgba(255,255,255,0.03);
    color: white;
    border-left-color: #3b82f6;
    padding-left: 25px;
}
.pm-logout { color: #ef4444; }
.pm-logout:hover { border-left-color: #ef4444; background: rgba(239, 68, 68, 0.1); }

/* ===========================
   PREMIUM PROFILE MODAL
   =========================== */
.profile-backdrop {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: none; /* Hidden by default */
    align-items: flex-start;
    justify-content: flex-end;
    padding: 75px 20px 0 0; /* Position just under the avatar */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-backdrop.show {
    display: flex;
    opacity: 1;
}

.profile-modal {
    width: 320px;
    background: #161b22; /* Dark Charcoal */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profile-backdrop.show .profile-modal { transform: translateY(0); }

.pm-header {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(9, 12, 21, 0));
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.pm-balance {
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    padding: 15px;
    margin: 15px 15px 0 15px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.05);
}

.pm-actions { display: flex; padding: 15px; gap: 10px; }

.pm-btn {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: white;
    padding: 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    text-align: center;
    text-decoration: none;
    transition: 0.2s;
}
.pm-btn:hover { background: rgba(59, 130, 246, 0.2); border-color: #3b82f6; color: white; }

.pm-list { padding: 5px 0; }
.pm-link {
    display: block; padding: 12px 20px;
    color: #94a3b8; text-decoration: none; font-size: 0.9rem;
    transition: 0.2s;
    border-left: 3px solid transparent;
}
.pm-link:hover {
    background: rgba(255,255,255,0.03);
    color: white;
    border-left-color: #3b82f6;
    padding-left: 25px;
}
.pm-logout { color: #ef4444; }
.pm-logout:hover { border-left-color: #ef4444; background: rgba(239, 68, 68, 0.1); }
