/* Mobile responsive styles */

/* Base responsive breakpoints */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 15px;
    }
    
    #timesheet-grid {
        grid-template-columns: 60px repeat(14, 60px);
    }
}

@media (max-width: 992px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content {
        width: 100%;
        padding: 15px;
    }
    
    .tab-content {
        padding: 20px 10px;
        min-width: auto;
    }
    
    .tab-content h1 {
        font-size: 22px;
    }
}

@media (max-width: 768px) {
    /* Navigation adjustments */
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .sidebar-toggle {
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 1001;
        background: #2c3e50;
        color: white;
        border: none;
        padding: 10px;
        border-radius: 4px;
    }
    
    .main-content {
        padding: 60px 10px 10px 10px;
    }
    
    /* Form controls */
    .controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .control-group {
        width: 100%;
    }
    
    .button-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .button-row button {
        width: 100%;
    }
    
    /* Grid adjustments */
    .grid-container {
        max-height: 630px;
    }
    
    #timesheet-grid {
        grid-template-columns: 50px repeat(14, 50px);
        font-size: 8px;
    }
    
    .grid-header,
    .day-header,
    .column-label,
    .time-label,
    .data-cell {
        font-size: 8px;
        padding: 1px;
    }
    
    /* Totals section */
    .totals-section {
        max-height: 150px;
        padding: 10px;
    }
    
    .totals-table {
        font-size: 10px;
    }
    
    .totals-table th,
    .totals-table td {
        padding: 3px;
    }
    
    /* Tab content */
    .tab-content {
        padding: 15px 5px;
    }
    
    .tab-content h1 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    /* Clear button positioning */
    .btn-clear-top {
        position: static;
        margin-bottom: 15px;
        width: 100%;
    }
}

@media (max-width: 576px) {
    /* Extra small screens */
    .container {
        padding: 10px;
    }
    
    .main-content {
        padding: 50px 5px 5px 5px;
    }
    
    .tab-content {
        padding: 10px 0;
    }
    
    .tab-content h1 {
        font-size: 18px;
    }
    
    /* Grid further compressed */
    #timesheet-grid {
        grid-template-columns: 40px repeat(14, 40px);
        font-size: 7px;
    }
    
    .grid-container {
        max-height: 475px;
    }
    
    /* Form elements */
    .control-group select,
    .control-group input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Buttons */
    .btn-primary,
    .btn-secondary,
    .btn-blue {
        padding: 12px 16px;
        font-size: 16px;
    }
    
    /* Modal adjustments */
    .custom-alert-modal,
    .post-save-modal {
        width: 95%;
        margin: 10px;
    }
    
    .custom-alert-content {
        padding: 20px;
    }
    
    .custom-alert-message {
        font-size: 16px;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .grid-container {
        max-height: 250px;
    }
    
    .totals-section {
        max-height: 120px;
    }
    
    .sidebar {
        width: 250px;
    }
}

/* Print responsive adjustments */
@media print {
    /* Ensure content fits on page */
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .main-content {
        width: 100% !important;
        padding: 0 !important;
    }
    
    .tab-content {
        padding: 5px !important;
    }
    
    /* Grid scaling for print */
    #timesheet-grid {
        transform: scale(0.8);
        transform-origin: top left;
    }
    
    .totals-section {
        transform: scale(0.9);
        transform-origin: top left;
    }
}

/* High DPI display adjustments */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .data-cell,
    .grid-header,
    .day-header,
    .column-label,
    .time-label {
        border-width: 0.5px;
    }
}

/* Accessibility - Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .sidebar {
        transition: none;
    }
    
    .nav-subsection {
        transition: none;
    }
    
    .nav-arrow {
        transition: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    /* Note: This is a basic dark mode setup - can be expanded */
    body {
        background: #1a1a1a;
        color: #e0e0e0;
    }
    
    .container {
        background: #2d2d2d;
    }
    
    .sidebar {
        background: #1e1e1e;
    }
    
    .main-content {
        background: #2d2d2d;
    }
    
    .tab-content {
        background: #2d2d2d;
    }
    
    .control-group select,
    .control-group input {
        background: #3d3d3d;
        border-color: #555;
        color: #e0e0e0;
    }
    
    .data-cell {
        background: #3d3d3d;
        border-color: #555;
    }
    
    .data-cell.filled {
        background: #1976D2;
    }
}