/* =========== RESPONSIVE STYLES FOR ALL PAGES =========== */
/* Optimized for 15.6" laptops at 125% zoom and mobile devices */

/* Base responsive settings */
* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

/* Mobile menu toggle - Hidden on desktop */
.mobile-menu-toggle {
    display: none;
}

/* =========== LAPTOP 15.6" at 125% (1024px - 1366px) =========== */
@media screen and (min-width: 1024px) and (max-width: 1366px) {
    .container {
        max-width: 95%;
        padding: 0 20px;
    }

    /* Header adjustments */
    header .navbar {
        padding: 15px 20px;
    }

    .logo {
        font-size: 22px;
    }

    nav ul {
        gap: 20px;
    }

    nav ul li a {
        font-size: 14px;
    }

    /* Hero sections */
    .hero-section {
        padding: 40px 30px;
    }

    .hero-section h1 {
        font-size: 32px;
    }

    .hero-section p {
        font-size: 16px;
    }

    /* Card grids */
    .features-grid,
    .support-options,
    .laundry-options,
    .report-options {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }

    /* Form elements */
    .form-section,
    .support-form-section,
    .issue-form {
        padding: 30px;
    }

    input,
    textarea,
    select {
        font-size: 14px;
        padding: 10px 14px;
    }

    .btn {
        padding: 10px 24px;
        font-size: 14px;
    }

    /* Tables */
    .orders-table th,
    .orders-table td {
        padding: 12px 10px;
        font-size: 13px;
    }

    /* Modal */
    .modal-content {
        max-width: 450px;
        padding: 25px;
    }
}

/* =========== TABLET (768px - 1023px) =========== */
@media screen and (max-width: 1023px) {
    .container {
        max-width: 100%;
        padding: 0 20px;
    }

    /* Header */
    header .navbar {
        flex-wrap: wrap;
        padding: 15px 20px;
    }

    nav {
        order: 3;
        width: 100%;
        margin-top: 15px;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .header-actions {
        gap: 15px;
    }

    /* Hero sections */
    .hero-section {
        padding: 30px 20px;
    }

    .hero-section h1 {
        font-size: 28px;
    }

    .hero-section p {
        font-size: 15px;
    }

    /* Grid layouts */
    .features-grid,
    .support-options,
    .laundry-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .report-options,
    .contact-options-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    /* Two-column forms */
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Profile sections */
    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-nav {
        flex-direction: column;
        width: 100%;
    }

    /* Contact manager */
    .contact-header {
        flex-direction: column;
    }

    .manager-info-card {
        min-width: 100%;
    }
}

/* =========== MOBILE - LARGE (576px - 767px) =========== */
@media screen and (max-width: 767px) {
    html {
        font-size: 14px;
    }

    .container {
        padding: 0 15px;
    }

    /* Header - Mobile Menu */
    header {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: var(--white-color);
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    header .navbar {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: space-between;
        align-items: center;
        padding: 12px 15px;
        gap: 0;
    }

    .logo {
        font-size: 20px;
        order: 1;
    }

    /* Mobile menu toggle button */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        font-size: 28px;
        color: var(--text-color);
        cursor: pointer;
        padding: 5px;
        order: 2;
    }

    .header-actions {
        order: 3;
        gap: 10px;
        display: flex;
        align-items: center;
    }

    .header-actions img {
        width: 32px;
        height: 32px;
    }

    .theme-toggle {
        width: 50px;
        height: 26px;
    }

    /* Hide nav by default on mobile */
    nav {
        order: 4;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease-in-out;
    }

    nav.mobile-menu-open {
        max-height: 500px;
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid var(--border-color);
    }

    nav ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    nav ul li {
        width: 100%;
        border-bottom: 1px solid var(--border-color);
    }

    nav ul li:last-child {
        border-bottom: none;
    }

    nav ul li a {
        display: block;
        width: 100%;
        font-size: 15px;
        padding: 12px 15px;
        text-align: left;
        transition: all 0.3s ease;
    }

    nav ul li a:hover,
    nav ul li a.active {
        background: var(--primary-color);
        color: white;
        border-radius: 0;
    }

    /* Hero sections */
    .hero-section {
        padding: 25px 15px;
        border-radius: 10px;
    }

    .hero-section h1 {
        font-size: 24px;
        line-height: 1.3;
    }

    .hero-section h2 {
        font-size: 20px;
    }

    .hero-section p {
        font-size: 14px;
    }

    /* All grid layouts to single column */
    .features-grid,
    .support-options,
    .laundry-options,
    .report-options,
    .contact-options-grid,
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    /* Cards */
    .feature-card,
    .support-option,
    .laundry-card,
    .report-card,
    .contact-method {
        padding: 20px;
    }

    .feature-card h3,
    .support-option h3,
    .laundry-card h3 {
        font-size: 18px;
    }

    /* Forms */
    .form-section,
    .support-form-section,
    .issue-form,
    .contact-form-container,
    .report-issue-section {
        padding: 20px 15px;
        border-radius: 10px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .input-group {
        margin-bottom: 15px;
    }

    input,
    textarea,
    select {
        font-size: 14px;
        padding: 10px 12px;
    }

    label {
        font-size: 13px;
    }

    /* Buttons */
    .btn {
        width: 100%;
        padding: 12px 20px;
        font-size: 14px;
        justify-content: center;
    }

    .form-actions {
        flex-direction: column;
        gap: 10px;
    }

    .form-actions .btn {
        width: 100%;
    }

    /* Tables - make scrollable */
    .table-container {
        overflow-x: auto;
        /* smooth scrolling hint was using -webkit-overflow-scrolling which is not widely supported; remove to avoid warnings */
    }

    .orders-table {
        min-width: 600px;
    }

    .orders-table th,
    .orders-table td {
        padding: 10px 8px;
        font-size: 12px;
    }

    /* History controls */
    .history-controls {
        flex-direction: column;
        gap: 12px;
    }

    .filter-buttons {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }

    .filter-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .search-box {
        width: 100%;
    }

    /* Summary cards */
    .summary-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .summary-card {
        padding: 15px;
    }

    /* Profile */
    .profile-container {
        padding: 15px;
    }

    .profile-avatar {
        width: 80px;
        height: 80px;
        font-size: 32px;
    }

    .profile-info h2 {
        font-size: 20px;
    }

    .profile-nav {
        gap: 8px;
    }

    .profile-nav-item {
        padding: 10px 15px;
        font-size: 13px;
    }

    .profile-content {
        padding: 20px 15px;
    }

    /* Modal */
    .modal-content {
        width: 95%;
        max-width: 95%;
        padding: 20px;
        margin: 20px;
    }

    .modal-header h3 {
        font-size: 18px;
    }

    .close-modal {
        font-size: 28px;
    }

    #qrcode {
        width: 200px !important;
        height: 200px !important;
    }

    /* Submit form specifics */
    .item-list {
        gap: 10px;
    }

    .item-entry {
        padding: 12px;
    }

    .remove-item {
        padding: 4px 8px;
        font-size: 12px;
    }

    /* Track page */
    .tracking-info {
        padding: 15px;
    }

    .status-badge {
        padding: 4px 10px;
        font-size: 11px;
    }

    /* Contact manager */
    .manager-info-card {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .manager-avatar {
        font-size: 50px;
    }

    .manager-contact-quick {
        flex-direction: column;
        width: 100%;
    }

    .quick-contact-btn {
        width: 100%;
        justify-content: center;
    }

    .contact-icon {
        width: 60px;
        height: 60px;
        font-size: 28px;
    }

    /* Priority options */
    .priority-options {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .priority-badge {
        padding: 8px 12px;
        font-size: 13px;
    }

    /* Report format selector */
    .format-options {
        flex-direction: column;
    }

    .format-option span {
        width: 100%;
        justify-content: center;
    }

    /* Footer */
    footer {
        padding: 20px 15px;
        font-size: 13px;
    }

    /* Issue header */
    .issue-header,
    .contact-header {
        flex-direction: column;
        gap: 20px;
    }

    .issue-image,
    .option-image {
        width: 100%;
        text-align: center;
    }

    .issue-image img,
    .option-image img {
        width: 100px;
        height: 100px;
    }
}

/* =========== MOBILE - SMALL (320px - 575px) =========== */
@media screen and (max-width: 575px) {
    html {
        font-size: 13px;
    }

    .container {
        padding: 0 12px;
    }

    /* Header */
    .logo {
        font-size: 18px;
    }

    .logo i {
        font-size: 22px;
    }

    nav ul li a {
        font-size: 12px;
        padding: 5px 10px;
    }

    .header-actions img {
        width: 30px;
        height: 30px;
    }

    /* Hero */
    .hero-section {
        padding: 20px 12px;
    }

    .hero-section h1 {
        font-size: 20px;
    }

    .hero-section h2 {
        font-size: 18px;
    }

    /* Cards */
    .feature-card,
    .support-option,
    .laundry-card,
    .report-card {
        padding: 15px;
    }

    /* Forms */
    .form-section,
    .support-form-section,
    .report-issue-section {
        padding: 15px 12px;
    }

    input,
    textarea,
    select {
        padding: 8px 10px;
        font-size: 13px;
    }

    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }

    /* Tables */
    .orders-table th,
    .orders-table td {
        padding: 8px 6px;
        font-size: 11px;
    }

    /* Modal */
    .modal-content {
        padding: 15px;
    }

    #qrcode {
        width: 180px !important;
        height: 180px !important;
    }

    /* Summary cards */
    .summary-card h3 {
        font-size: 14px;
    }

    .summary-card .count {
        font-size: 24px;
    }

    /* Profile avatar */
    .profile-avatar {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }

    /* Manager card */
    .manager-info-card {
        padding: 15px;
    }

    .manager-avatar {
        font-size: 45px;
    }

    .manager-details h3 {
        font-size: 18px;
    }

    /* Priority badges */
    .priority-options {
        grid-template-columns: 1fr;
    }

    .priority-badge {
        width: 100%;
        text-align: center;
    }
}

/* =========== LANDSCAPE ORIENTATION (PHONES) =========== */
@media screen and (max-width: 900px) and (orientation: landscape) {
    .hero-section {
        padding: 20px 15px;
    }

    .features-grid,
    .support-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal-content {
        max-height: 85vh;
        overflow-y: auto;
    }
}

/* =========== ACCESSIBILITY & TOUCH IMPROVEMENTS =========== */
@media (hover: none) and (pointer: coarse) {
    /* Touch-friendly sizing */
    .btn,
    a,
    button,
    input[type="radio"],
    input[type="checkbox"] {
        min-height: 44px;
        min-width: 44px;
    }

    nav ul li a {
        padding: 10px 15px;
    }

    .filter-btn {
        padding: 10px 16px;
    }
}

/* =========== PRINT STYLES =========== */
@media print {
    header,
    footer,
    .theme-toggle,
    .header-actions,
    .btn,
    button {
        display: none !important;
    }

    .container {
        max-width: 100%;
    }

    * {
        background: white !important;
        color: black !important;
    }
}

/* =========== HIGH DPI SCREENS =========== */
@media screen and (min-resolution: 2dppx) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}
