/* D:\xampp\htdocs\mlm_project\assets\css\style.css */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --dark: #111827;
    --gray: #f3f4f6;
    --text: #374151;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: var(--gray);
    color: var(--text);
    overflow-x: hidden;
}

/* Authentication Pages */
.auth-wrapper {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
}

.auth-card {
    background: var(--white);
    padding: 40px;
    border-radius: 16px;
    width: 95%;
    max-width: 450px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

@media (max-width: 480px) {
    .auth-card {
        padding: 25px 20px;
    }
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--dark);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    transition: 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    text-align: center;
    transition: 0.2s;
    text-decoration: none;
}

.btn:hover { background: var(--primary-hover); }
.btn-block { width: 100%; }

/* Dashboard Layout */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 280px;
    background: var(--dark);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.sidebar-logo {
    padding: 24px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    flex: 0 0 80px; /* Fixed height for logo container */
    overflow: hidden;
    box-sizing: border-box;
}

.nav-menu {
    list-style: none;
    padding: 10px 0 100px 0; /* Huge bottom padding to be sure */
    margin: 0;
    flex: 1;
    overflow-y: scroll !important; /* Force scrollbar visibility */
    display: block;
    box-sizing: border-box;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: #4f46e5 #1e1b4b; /* Bright blue on dark indigo */
}

/* Custom Scrollbar for Chrome/Safari/Edge - High Visibility */
.nav-menu::-webkit-scrollbar {
    width: 8px;
    display: block !important;
}
.nav-menu::-webkit-scrollbar-track {
    background: #1e1b4b;
}
.nav-menu::-webkit-scrollbar-thumb {
    background: #4f46e5;
    border-radius: 10px;
    border: 1px solid #1e1b4b;
}
.nav-menu::-webkit-scrollbar-thumb:hover {
    background: #818cf8;
}


.nav-menu li a {
    display: flex;
    align-items: center;
    padding: 15px 24px;
    color: #9ca3af;
    text-decoration: none;
    gap: 12px;
    transition: 0.2s;
}

.nav-menu li a:hover, .nav-menu li.active a {
    background: rgba(255,255,255,0.05);
    color: var(--white);
    border-left: 4px solid var(--primary);
}

.main-panel {
    flex: 1;
    margin-left: 280px;
    min-width: 0;
    transition: margin-left 0.3s ease;
}

.top-nav {
    height: 70px;
    background: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 99;
}

.menu-toggle {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    display: none;
}

.user-profile-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

.content {
    padding: 30px;
}

/* Dashboard Cards */
.grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--white);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 20px;
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    color: white;
}

.bg-primary { background: var(--primary); }
.bg-success { background: var(--success); }
.bg-warning { background: var(--warning); }
.bg-danger { background: var(--danger); }

.stat-info p {
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 5px;
}

.stat-info h3 {
    font-size: 22px;
    color: var(--dark);
}

.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    padding: 24px;
    margin-bottom: 24px;
}


/* Mobile & PWA App Layout - Fitact v2.3 */
@media (max-width: 768px) {
    .sidebar { 
        display: none !important; 
        position: fixed;
        top: 0;
        left: -280px;
        height: 100vh !important;
        z-index: 2000 !important;
        transition: left 0.3s ease;
        flex-direction: column !important;
    }
    .sidebar.open {
        display: flex !important;
        left: 0;
    }
    .dashboard-wrapper { margin-left: 0 !important; }
    .main-panel { margin-left: 0 !important; }
    
    .top-nav {
        position: sticky !important;
        top: 0;
        width: 100% !important;
        background: #fff !important;
        z-index: 1000;
        height: 70px;
        padding: 0 15px !important;
        border-bottom: 2px solid var(--primary) !important;
        display: flex !important;
        justify-content: space-between;
        align-items: center;
    }

    .menu-toggle {
        display: block !important;
        font-size: 32px !important;
        color: var(--primary);
        padding: 5px;
        margin-right: 10px;
    }
    
    .content { 
        padding-top: 20px !important;
        padding-bottom: 90px !important; /* Space for bottom nav */
    }

    .desktop-only { display: none !important; }
    .mobile-only { display: flex !important; align-items: center; }

    /* Bottom Navigation Bar */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: white;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
        z-index: 2000;
        padding-bottom: env(safe-area-inset-bottom);
        border-top: 1px solid #f1f5f9;
        /* Allow scrolling if many items, but hide scrollbar */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .mobile-bottom-nav::-webkit-scrollbar { display: none; }
    
    .mobile-nav-item {
        flex: 1 0 70px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 10px 8px;
        color: #94a3b8;
        font-size: 10px;
        font-weight: 700;
        text-decoration: none;
        transition: 0.3s;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .mobile-nav-item ion-icon {
        font-size: 22px;
        margin-bottom: 4px;
    }
    .mobile-nav-item span, .mobile-nav-item { 
        overflow: hidden; 
        text-overflow: ellipsis; 
        white-space: nowrap; 
    }
    .mobile-nav-item.active {
        color: var(--primary);
    }
    
    /* Responsive Grid for Mobile */
    .grid-cards {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    .stat-card {
        padding: 15px !important;
        flex-direction: column !important;
        text-align: center !important;
        gap: 8px !important;
    }

    /* App Icon Grid (Main Dashboard Buttons) - Fitact Premium v2.3 */
    .app-icon-grid {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        margin-bottom: 25px;
    }
    .app-icon-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        padding: 22px 10px; /* Generous padding */
        background: white;
        border-radius: 20px;
        text-decoration: none;
        box-shadow: 0 4px 12px rgba(0,0,0,0.03);
        transition: transform 0.2s;
    }
    .app-icon-item:active {
        transform: scale(0.95);
    }
    .app-icon-item ion-icon {
        font-size: 34px; /* Scaled up */
        padding: 14px;
        border-radius: 16px;
        color: white;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }
    .app-icon-item span {
        font-size: 11px;
        font-weight: 800;
        color: #475569;
        text-align: center;
        letter-spacing: -0.2px;
    }
}

@media (min-width: 769px) {
    .mobile-only { display: none !important; }
    .mobile-bottom-nav { display: none !important; }
}
