/* Responsive Styles for BookAfri */

/* Extra small devices (phones, less than 576px) */
@media (max-width: 575.98px) {
    .container {
        padding: 0 var(--spacing-3);
    }

    h1 { font-size: var(--font-size-3xl); }
    h2 { font-size: var(--font-size-2xl); }
    h3 { font-size: var(--font-size-xl); }

    /* Navigation */
    .navbar-toggler {
        display: block;
    }

    .navbar-menu {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background-color: var(--bg-primary);
        border-top: 1px solid var(--border-color);
        flex-direction: column;
        padding: var(--spacing-4);
        display: none;
        box-shadow: var(--shadow-lg);
        z-index: 999;
    }

    .navbar-menu.show {
        display: flex;
    }

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

    .navbar-search {
        max-width: 100%;
        order: 3;
        margin-top: var(--spacing-4);
    }

    .navbar-actions {
        flex-direction: column;
        gap: var(--spacing-3);
        width: 100%;
    }

    .user-dropdown {
        width: 100%;
    }

    .user-menu-toggle {
        width: 100%;
        justify-content: center;
    }

    .dropdown-menu {
        position: static;
        width: 100%;
        border: none;
        box-shadow: none;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-6);
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--spacing-4);
        text-align: center;
    }

    /* Cards */
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    /* Forms */
    .address-fields {
        grid-template-columns: 1fr;
    }

    /* Product/Service Cards */
    .product-actions {
        flex-direction: column;
    }

    /* Calendar */
    .calendar-grid {
        grid-template-columns: repeat(7, 1fr);
        font-size: var(--font-size-xs);
    }

    .calendar-day {
        padding: var(--spacing-2);
    }

    .time-slot-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .calendar-grid {
        grid-template-columns: repeat(7, 1fr);
    }

    .time-slot-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .grid-3,
    .grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Navigation */
    .navbar-menu {
        gap: var(--spacing-4);
    }

    .navbar-nav {
        gap: var(--spacing-2);
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Navigation */
    .navbar-menu {
        gap: var(--spacing-6);
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1280px;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .form-control,
    .search-form,
    .theme-toggle,
    .cart-icon,
    .user-dropdown {
        display: none !important;
    }

    body {
        background-color: white !important;
        color: black !important;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    a {
        color: black !important;
        text-decoration: underline !important;
    }

    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: #000000;
        --text-primary: #000000;
        --text-secondary: #333333;
    }

    .btn {
        border: 2px solid currentColor;
    }

    .form-control {
        border: 2px solid var(--border-color);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .spinner {
        animation: none;
        border: 3px solid var(--border-color);
        border-top-color: var(--primary-color);
    }
}

/* Dark Mode Media Query */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-tertiary: #334155;
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-muted: #94a3b8;
        --border-color: #475569;
    }
}

/* Orientation Specific */
@media (orientation: portrait) {
    .hero-section {
        min-height: 70vh;
    }
}

@media (orientation: landscape) {
    .hero-section {
        min-height: 50vh;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn,
    .nav-link,
    .dropdown-item,
    .calendar-day,
    .time-slot,
    .payment-method,
    .notification-item {
        min-height: 44px;
        min-width: 44px;
    }

    .form-control,
    select,
    textarea {
        font-size: 16px; /* Prevents iOS zoom */
    }

    .product-actions .btn {
        min-height: 36px;
    }
}

/* Foldable Devices */
@media (max-width: 319.98px) {
    .container {
        padding: 0 var(--spacing-2);
    }

    .btn {
        padding: var(--spacing-2) var(--spacing-3);
    }

    .card-body,
    .card-header,
    .card-footer {
        padding: var(--spacing-3);
    }
}

/* Ultra-wide screens */
@media (min-width: 1920px) {
    .container {
        max-width: 1600px;
    }

    .grid-4 {
        grid-template-columns: repeat(5, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(4, 1fr);
    }
}