/* Responsive Design System */
/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--neon-blue), var(--neon-cyan));
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 10px 25px rgba(0, 198, 255, 0.4);
    cursor: pointer;
    font-size: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10002;
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggle:active {
    transform: scale(0.9);
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

@media (max-width: 1440px) {
    .container {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 1200px) {
    .sidebar {
        width: 250px;
    }

    .content {
        margin-left: 250px;
        padding: 2rem;
    }

    .hero-title {
        font-size: 3.5rem;
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 220px;
    }

    .content {
        margin-left: 220px;
        padding: 1.5rem;
    }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .news-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-title {
        font-size: 2.8rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .navbar {
        padding: 0 15px;
        flex-wrap: wrap;
        height: auto;
        min-height: 70px;
    }

    .navbar-center,
    .nav-clock-time,
    #userName {
        display: none !important;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        top: 0;
        height: 100vh;
        z-index: 10001;
    }

    .sidebar.mobile-active {
        transform: translateX(0);
    }

    .content {
        margin-left: 0 !important;
        padding: 15px;
        width: 100%;
    }

    .stat-grid,
    .news-container,
    .features-grid {
        grid-template-columns: 1fr !important;
    }

    .department-window,
    .integration-window {
        width: 100% !important;
        max-width: 100vw !important;
        height: 100vh !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        border-radius: 0 !important;
    }

    .window-header {
        padding: 1rem;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-btns {
        flex-direction: column;
        width: 100%;
        padding: 0 20px;
        gap: 15px;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 12px 20px;
    }

    .stats-section .stat-box {
        flex-direction: column;
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .logo-text {
        display: none;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .login-box {
        width: 90%;
        padding: 30px 20px;
    }
}

/* Fluid Width for large screens */
@media (min-width: 1440px) {
    .container {
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
}

/* Global Reset for Overflow */
* {
    max-width: 100%;
    box-sizing: border-box;
}

body {
    overflow-x: hidden;
    width: 100vw;
    word-wrap: break-word;
}

img,
video,
canvas,
iframe {
    max-width: 100%;
    height: auto;
}

/* Fix for Tables */
table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Fix for Grid gaps on small screens */
@media (max-width: 480px) {

    .container,
    .content {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .stat-grid,
    .news-container {
        gap: 10px !important;
    }

    .feature-card {
        padding: 20px !important;
    }

    .hero-subtitle {
        font-size: 1rem !important;
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
        /* Prevent iOS zoom */
    }
}

/* Fix for Department Windows scrolling */
.department-window .window-content {
    max-height: calc(100vh - 80px);
    height: auto !important;
    overflow-y: auto !important;
    flex-wrap: wrap;
    /* Allow sidebar to wrap on small screens */
}

.department-window .department-body {
    overflow-y: auto;
    max-height: 100%;
}

@media (max-width: 992px) {
    .department-window .window-content {
        flex-direction: column;
    }

    .road-management-sidebar {
        width: 100% !important;
        min-width: 100% !important;
        border-left: none !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        margin-top: 20px;
    }
}