/* ============================================
   GLOBAL STYLES & VARIABLES
   ============================================ */

:root {
    --primary-blue: #2c3e50;
    --secondary-blue: #3498db;
    --accent-green: #27ae60;
    --accent-red: #e74c3c;
    --accent-orange: #e67e22;
    --light-gray: #ecf0f1;
    --dark-gray: #34495e;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ============================================
   HEADER STYLES (Desktop - Default)
   ============================================ */

header {
    background-color: var(--primary-blue);
    color: white;
    padding: 20px 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 80px; /* Fixed height for consistent layout */
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    font-size: 2rem;
    color: var(--secondary-blue);
}

.logo-text h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.2;
}

.logo-text p {
    font-size: 0.85rem;
    opacity: 0.8;
    margin: 0;
}

/* User info in header */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--secondary-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    color: white;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-details strong {
    font-size: 0.9rem;
}

.user-details span {
    font-size: 0.8rem;
    opacity: 0.8;
}

.logout-btn {
    background-color: var(--accent-red);
    color: white;
    border: none;
    border-radius: var(--radius);
    padding: 8px 15px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.3s;
    text-decoration: none;
}

.logout-btn:hover {
    background-color: #c0392b;
}

.logout-text {
    display: inline;
}

.logout-icon {
    display: none;
}

/* Mobile Menu Toggle - Hidden by default on desktop
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: white;
    cursor: pointer;
    padding: 8px;
    margin-left: 15px;
    position: relative;
    z-index: 1002;
} */

/* ============================================
   SIDEBAR NAVIGATION (Desktop - Default)
   ============================================ */

/* Only show this sidebar on desktop */
.desktop-sidebar {
    width: 250px;
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 100px; /* Below header */
    transition: all 0.3s ease;
}

.desktop-sidebar h3 {
    color: var(--primary-blue);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--light-gray);
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
}

/* Navigation Menu */
.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-menu li {
    position: relative;
    margin-bottom: 8px;
}

/* Checkbox Navigation */
.nav-checkbox {
    display: none; /* Hide the actual checkbox */
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--dark-gray);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.nav-link:hover {
    background-color: var(--light-gray);
    color: var(--primary-blue);
}

/* Active/Checked state */
.nav-checkbox:checked + .nav-link {
    background-color: var(--secondary-blue);
    color: white;
}

.nav-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.nav-text {
    flex: 1;
    font-size: 0.95rem;
}

.checkbox-indicator {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ============================================
   MOBILE SIDEBAR NAVIGATION (Hidden by default)
   ============================================ */

.mobile-sidebar {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: -280px; /* Hidden off-screen */
    width: 280px;
    height: 100vh;
    background-color: var(--white);
    z-index: 1001;
    transition: left 0.3s ease;
    box-shadow: 2px 0 15px rgba(0,0,0,0.1);
    padding: 20px;
    overflow-y: auto;
}

.mobile-sidebar.active {
    left: 0; /* Slide in when active */
}

/* Mobile sidebar specific styles */
.mobile-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--light-gray);
}

.mobile-sidebar-header h3 {
    color: var(--primary-blue);
    font-family: 'Poppins', sans-serif;
    font-size: 1.3rem;
    margin: 0;
}

.mobile-sidebar-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark-gray);
    cursor: pointer;
    padding: 5px;
}

/* Mobile navigation specific styles */
.mobile-nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav-menu li {
    margin-bottom: 5px;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    color: var(--dark-gray);
    text-decoration: none;
    border-radius: var(--radius);
    transition: all 0.3s ease;
}

.mobile-nav-link:hover {
    background-color: var(--light-gray);
    color: var(--primary-blue);
}

.mobile-nav-checkbox:checked + .mobile-nav-link {
    background-color: var(--secondary-blue);
    color: white;
}

/* Mobile Overlay */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
}

.mobile-overlay.active {
    display: block;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */

.dashboard {
    display: flex;
    margin-top: 30px;
    gap: 30px;
    position: relative;
}

.main-content {
    flex: 1;
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    min-height: 600px;
}

.page-title {
    color: var(--primary-blue);
    margin-bottom: 25px;
    font-family: 'Poppins', sans-serif;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-icon {
    color: var(--secondary-blue);
}


/* ============================================
   MOBILE RESPONSIVE STYLES
   ============================================ */

/* Base mobile styles */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        overflow-x: hidden;
    }
    
    /* Fixed header */
    header {
        position: fixed !important;
        top: 0;
        left: 0;
        right: 0;
        background: white !important;
        z-index: 1000;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        height: 60px;
        padding: 0 !important;
    }
    
    .header-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0 15px !important;
        height: 60px;
        max-width: 100% !important;
    }
    
    /* Logo mobile */
    .logo {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    
    .logo-icon {
        font-size: 1.5rem !important;
        color: #007bff;
    }
    
    .logo-text h1 {
        font-size: 1rem !important;
        margin: 0;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }
    
    .logo-text p {
        display: none !important;
    }
    
    /* Mobile menu toggle - ALWAYS VISIBLE on mobile */
    .mobile-menu-toggle {
        display: block !important;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: #333;
        padding: 8px;
        cursor: pointer;
        position: relative;
        z-index: 1002;
    }
    
    /* User info mobile */
    .user-info {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .user-avatar {
        width: 35px;
        height: 35px;
        border-radius: 50%;
        background: #007bff;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: bold;
        font-size: 0.9rem;
    }
    
    .user-details {
        display: none !important;
    }
    
    .logout-btn {
        padding: 8px 10px !important;
        font-size: 0.8rem;
        min-width: auto;
    }
    
    .logout-text {
        display: none !important;
    }
    
    .logout-icon {
        display: inline !important;
        margin: 0 !important;
    }
    
    /* Mobile sidebar */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -280px !important;
        width: 280px !important;
        height: 100vh !important;
        background: white !important;
        z-index: 1001 !important;
        transition: left 0.3s ease !important;
        padding: 20px 0 !important;
        overflow-y: auto !important;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1) !important;
        border-radius: 0 !important;
    }
    
    .sidebar.active {
        left: 0 !important;
    }
    
    .sidebar-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 0 20px 20px !important;
        border-bottom: 1px solid rgba(0,0,0,0.1) !important;
    }
    
    .sidebar-header h3 {
        color: #2c3e50 !important;
        margin: 0;
        font-size: 1.2rem;
    }
    
    .sidebar-close {
        display: block !important;
        background: none;
        border: none;
        color: #666;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 5px;
    }
    
    /* Mobile overlay */
    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1000;
    }
    
    .mobile-overlay.active {
        display: block;
    }
    
    /* Main content mobile */
    .dashboard {
        padding-top: 60px !important;
        min-height: 100vh;
        flex-direction: column !important;
        margin-top: 0 !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 15px !important;
        background: #f8f9fa !important;
        min-height: calc(100vh - 60px) !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    
    /* Navigation menu mobile */
    .nav-menu {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    
    .nav-menu li {
        border-bottom: 1px solid rgba(0,0,0,0.1);
    }
    
    .nav-menu li:last-child {
        border-bottom: none;
    }
    
    .nav-menu a {
        display: flex;
        align-items: center;
        gap: 15px;
        padding: 15px 20px !important;
        color: #333 !important;
        text-decoration: none;
        transition: all 0.3s;
    }
    
    .nav-menu a:hover,
    .nav-menu a.active {
        background: rgba(0,123,255,0.1) !important;
        color: #007bff !important;
    }
    
    .nav-menu i {
        width: 20px;
        text-align: center;
        font-size: 1.1rem;
    }
    
    .nav-menu span {
        font-size: 0.95rem;
    }
    
    /* Table mobile fixes */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 8px !important;
        white-space: nowrap;
    }
    
    /* Form mobile fixes */
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-group {
        width: 100%;
        margin-bottom: 15px;
    }
    
    input, select, textarea {
        font-size: 16px !important;
    }
    
    /* Button mobile fixes */
    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

/* Tablet styles (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 220px !important;
    }
    
    .main-content {
        margin-left: 220px !important;
        width: calc(100% - 220px) !important;
    }
    
    .logo-text h1 {
        font-size: 1.3rem !important;
    }
    
    .logo-text p {
        font-size: 0.85rem !important;
    }
    
    /* Hide mobile toggle on tablet */
    .mobile-menu-toggle {
        display: none !important;
    }
}

/* Desktop styles (1025px and above) */
@media (min-width: 1025px) {
    /* Hide mobile elements on desktop */
    .mobile-menu-toggle,
    .sidebar-close,
    .mobile-overlay {
        display: none !important;
    }
    
    /* Show desktop sidebar normally */
    .sidebar {
        position: sticky !important;
        top: 100px !important;
        width: 250px !important;
        height: calc(100vh - 130px) !important;
        left: 0 !important;
        background: white !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    .dashboard {
        display: grid !important;
        grid-template-columns: 250px 1fr !important;
        gap: 30px !important;
    }
}

/* Small mobile phones (up to 480px) */
@media (max-width: 480px) {
    .logo-text h1 {
        font-size: 0.9rem !important;
        max-width: 120px;
    }
    
    .user-avatar {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    .logout-btn {
        padding: 5px !important;
        min-width: 40px;
    }
    
    .main-content {
        padding: 10px !important;
    }
    
    .card {
        padding: 12px !important;
    }
    
    h2.page-title {
        font-size: 1.3rem !important;
    }
    
    .page-icon {
        font-size: 1.5rem !important;
    }
}



/* ============================================
   COMPONENT STYLES (Common for all devices)
   ============================================ */

/* Cards */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.card {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 25px;
    border-top: 5px solid var(--secondary-blue);
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

.card h3 {
    color: var(--primary-blue);
    margin-bottom: 15px;
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-icon {
    color: var(--secondary-blue);
}

/* Buttons */
.btn {
    padding: 12px 25px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--secondary-blue);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-blue);
}

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-gray);
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: var(--radius);
    font-size: 1rem;
    transition: border 0.3s;
}

.form-control:focus {
    border-color: var(--secondary-blue);
    outline: none;
}

/* Additional mobile-specific component fixes */
@media (max-width: 768px) {
    .cards-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .card {
        padding: 15px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    input, select, textarea {
        font-size: 16px !important; /* Prevents zoom on iOS */
    }
}





