/* ===================================
   RESPONSIVE DESIGN - GLASSMORPHISM
   =================================== */

/* Mobile First Approach */

/* ===================================
   MOBILE (< 768px)
   =================================== */
@media (max-width: 767px) {
    :root {
        --sidebar-width: 100%;
        --header-height: 60px;
    }
    
    /* Header */
    .app-header {
        padding: 0 1rem;
        left: 0 !important;
    }
    
    .header-left {
        margin-left: 60px; /* Space for hamburger on mobile */
    }
    
    .logo-img {
        height: 35px; /* Smaller logo on mobile */
    }
    
    .app-title {
        font-size: 0.875rem; /* Smaller font on mobile */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 200px; /* Limit width on mobile */
    }
    
    .user-name {
        display: none;
    }
    
    /* Sidebar */
    .app-sidebar {
        width: 85%;
        max-width: 300px;
    }
    
    /* Main Content */
    .app-main {
        flex-direction: column;
        margin-left: 0 !important;
    }
    
    .content-left {
        height: 50%;
        min-height: 300px;
        flex: none;
    }
    
    .content-right {
        width: 100%;
        height: 50%;
        flex: 1;
        padding: 1rem;
        overflow-y: auto;
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* Footer */
    .app-footer {
        left: 0 !important;
        font-size: 0.75rem;
    }
    
    .footer-logo {
        height: 24px; /* Smaller footer logo on mobile */
    }
    
    .footer-text {
        font-size: 0.65rem; /* Even smaller text on mobile */
    }
    
    /* Panels */
    .panel {
        padding: 1rem;
    }
    
    .panel-title {
        font-size: 1rem;
    }
    
    /* Map Controls */
    .map-controls {
        top: 0.5rem;
        right: 0.5rem;
    }
    
    .map-control-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
}

/* ===================================
   TABLET (768px - 1024px)
   =================================== */
@media (min-width: 768px) and (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }
    
    .app-header {
        padding: 0 1.5rem;
    }
    
    .header-left {
        margin-left: 60px; /* Space for hamburger on tablet */
    }
    
    .logo-img {
        height: 40px; /* Medium logo on tablet */
    }
    
    .app-title {
        font-size: 1rem; /* Medium size on tablet */
    }
    
    /* Sidebar HIDDEN by default on tablet - toggle with hamburger */
    .app-sidebar {
        transform: translateX(-100%);
    }
    
    .app-sidebar.open {
        transform: translateX(0);
    }
    
    /* Show hamburger on tablet */
    .hamburger {
        display: flex !important;
    }
    
    .content-right {
        width: 350px;
        padding: 1.25rem;
    }
    
    .footer-logo {
        height: 28px; /* Medium footer logo on tablet */
    }
    
    .footer-text {
        font-size: 0.75rem; /* Slightly smaller text on tablet */
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   DESKTOP (> 1024px)
   =================================== */
@media (min-width: 1025px) {
    /* Sidebar VISIBLE by default on desktop - can toggle with hamburger */
    .app-sidebar {
        transform: translateX(0);
    }
    
    /* Show hamburger menu on desktop for toggle functionality */
    .hamburger {
        display: flex !important;
    }
    
    /* Sidebar can be toggled on desktop */
    .app-sidebar:not(.open) {
        transform: translateX(0); /* Default: visible */
    }
    
    /* When sidebar is explicitly closed (has 'closed' class) */
    .app-sidebar.closed {
        transform: translateX(-100%);
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* ===================================
   LARGE DESKTOP (> 1440px)
   =================================== */
@media (min-width: 1441px) {
    .content-right {
        width: 450px;
    }
}

/* ===================================
   LANDSCAPE MOBILE
   =================================== */
@media (max-width: 767px) and (orientation: landscape) {
    .app-main {
        flex-direction: row;
    }
    
    .content-left {
        width: 60%;
        height: 100%;
    }
    
    .content-right {
        width: 40%;
        height: 100%;
    }
}

/* ===================================
   PRINT
   =================================== */
@media print {
    .app-header,
    .app-sidebar,
    .app-footer,
    .sidebar-overlay,
    .map-controls,
    .panel-actions {
        display: none !important;
    }
    
    .app-main {
        margin: 0 !important;
    }
    
    .content-left,
    .content-right {
        width: 100% !important;
    }
}

/* ===================================
   HIDE/SHOW UTILITIES
   =================================== */
@media (max-width: 767px) {
    .hide-mobile { display: none !important; }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .hide-tablet { display: none !important; }
}

@media (min-width: 1025px) {
    .hide-desktop { display: none !important; }
}

.show-mobile { display: none !important; }
@media (max-width: 767px) {
    .show-mobile { display: block !important; }
}

.show-tablet { display: none !important; }
@media (min-width: 768px) and (max-width: 1024px) {
    .show-tablet { display: block !important; }
}

.show-desktop { display: none !important; }
@media (min-width: 1025px) {
    .show-desktop { display: block !important; }
}
