/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Ensure images are responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Make videos responsive */
video {
    max-width: 100%;
    height: auto;
}

/* Login Page Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.8rem;
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 500;
}

.input-group input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    min-height: 44px; /* Minimum touch target size */
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.login-btn {
    width: 100%;
    padding: 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease;
    min-height: 44px; /* Minimum touch target size */
}

.login-btn:hover {
    transform: translateY(-2px);
}

.error-message {
    color: #e74c3c;
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}

/* Dashboard Styles */
.dashboard-container {
    display: grid;
    grid-template-areas: 
        "header header"
        "sidebar main";
    grid-template-rows: 60px 1fr;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

.header {
    grid-area: header;
    background: #2c3e50;
    color: white;
    display: flex;
    align-items: center;
    padding: 0 1rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.header h1 {
    font-size: 1.5rem;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logout-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.logout-btn:hover {
    background: #c0392b;
}

.sidebar {
    grid-area: sidebar;
    background: #34495e;
    padding: 1rem 0;
}

.nav-menu {
    list-style: none;
}

.nav-menu li {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: block;
    color: #bdc3c7;
    text-decoration: none;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    background: #2c3e50;
    color: white;
    border-right: 3px solid #3498db;
}

.main-content {
    grid-area: main;
    padding: 2rem;
    background: #ecf0f1;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

.content-section h2 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card h3 {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
}

/* Enhanced Responsive Design */

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.sidebar.mobile-open {
    transform: translateX(0);
}

/* Large screens (desktops) - 1200px and up */
@media (min-width: 1200px) {
    .dashboard-container {
        grid-template-columns: 280px 1fr;
    }
    
    .main-content {
        padding: 2.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* Medium screens (tablets) - 768px to 1199px */
@media (max-width: 1199px) and (min-width: 768px) {
    .dashboard-container {
        grid-template-columns: 220px 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
    
    .main-content {
        padding: 1.5rem;
    }
}

/* Small screens (tablets in portrait) - 576px to 767px */
@media (max-width: 767px) and (min-width: 576px) {
    .dashboard-container {
        grid-template-areas: 
            "header"
            "main";
        grid-template-rows: 60px 1fr;
        grid-template-columns: 1fr;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        width: 250px;
        height: calc(100vh - 60px);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
        overflow-y: auto;
    }
    
    .nav-menu {
        flex-direction: column;
        padding: 1rem 0;
    }
    
    .nav-menu li {
        margin-bottom: 0.5rem;
        margin-right: 0;
        white-space: normal;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .login-box {
        margin: 1rem;
        padding: 1.5rem;
        max-width: 90%;
    }
    
    .main-content {
        padding: 1rem;
    }
}

/* Extra small screens (phones) - 575px and below */
@media (max-width: 575px) {
    .dashboard-container {
        grid-template-areas: 
            "header"
            "main";
        grid-template-rows: auto 1fr;
        grid-template-columns: 1fr;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .header {
        padding: 0.5rem 1rem;
        height: auto;
        min-height: 60px;
    }
    
    .header-content {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .logo-section {
        flex: 1;
        min-width: 200px;
    }
    
    .logo-section h1 {
        font-size: 1.3rem;
    }
    
    .tagline {
        font-size: 0.8rem;
        padding: 0.2rem 0.5rem;
    }
    
    .header-actions {
        gap: 0.75rem;
    }
    
    .user-menu {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.25rem;
    }
    
    .user-menu span {
        font-size: 0.85rem;
    }
    
    .logout-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .sidebar {
        position: fixed;
        top: 60px;
        left: 0;
        width: 280px;
        height: calc(100vh - 60px);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
        overflow-y: auto;
    }
    
    .nav-menu {
        flex-direction: column;
        padding: 1rem 0;
    }
    
    .nav-menu li {
        margin-bottom: 0.5rem;
        margin-right: 0;
    }
    
    .nav-link {
        padding: 1rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .main-content {
        padding: 1rem 0.75rem;
    }
    
    .login-box {
        margin: 0.5rem;
        padding: 1.25rem;
        max-width: 95%;
    }
    
    .login-box h2 {
        font-size: 1.5rem;
    }
    
    .input-group input {
        padding: 0.6rem;
        font-size: 0.95rem;
    }
    
    .login-btn {
        padding: 0.6rem;
        font-size: 0.95rem;
    }
}

/* Extra extra small screens (small phones) - 320px and below */
@media (max-width: 320px) {
    .header {
        padding: 0.25rem 0.5rem;
    }
    
    .logo-section h1 {
        font-size: 1.1rem;
    }
    
    .tagline {
        font-size: 0.7rem;
    }
    
    .main-content {
        padding: 0.75rem 0.5rem;
    }
    
    .login-box {
        margin: 0.25rem;
        padding: 1rem;
    }
    
    .sidebar {
        width: 250px;
    }
}

/* Landscape orientation on mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .login-container {
        padding: 1rem 0;
    }
    
    .login-box {
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .header {
        min-height: 50px;
    }
    
    .sidebar {
        top: 50px;
        height: calc(100vh - 50px);
    }
}