/*
 * Wisdom Bites Dental Clinic
 * Responsive Stylesheet
 * Version: 3.0.0
 */

/* ===== Media Query Breakpoints ===== */
/* 
 * - Extra Large Devices (xl): >= 1200px (no media query needed - default styles)
 * - Large Devices (lg): 992px - 1199px
 * - Medium Devices (md): 768px - 991px
 * - Small Devices (sm): 576px - 767px
 * - Extra Small Devices (xs): < 576px
 */

/* ===== Large Devices (Desktops, 992px - 1199px) ===== */
@media (max-width: 1199px) {
    /* === Typography === */
    h1 {
        font-size: var(--font-3xl);
    }
    
    h2 {
        font-size: var(--font-2xl);
    }
    
    h3 {
        font-size: var(--font-xl);
    }
    
    /* === Layout === */
    .container {
        width: 95%;
    }
    
    section {
        padding: var(--spacing-12) 0;
    }
    
    /* === Header === */
    .site-header .nav-item {
        margin: 0 var(--spacing-3);
    }
    
    .nav-cta {
        margin-left: var(--spacing-4);
    }
    
    /* === Hero Section === */
    .hero-content {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-text {
        max-width: 100%;
        margin-bottom: var(--spacing-8);
    }
    
    .hero-cta {
        justify-content: center;
    }
    
    .hero-feature {
        margin-left: 0;
    }
    
    .hero-feature-card {
        margin: 0 auto;
    }
    
    /* === Services === */
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* === Features === */
    .features-wrapper {
        gap: var(--spacing-8);
    }
    
    /* === Testimonials === */
    .testimonials-cta {
        flex-direction: column;
        gap: var(--spacing-6);
        text-align: center;
    }
    
    .rating-summary {
        justify-content: center;
    }
    
    /* === Dentists === */
    .dentists-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* === Insurance === */
    .insurance-wrapper {
        padding: var(--spacing-8);
    }
    
    /* === Footer === */
    .footer-widgets {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===== Medium Devices (Tablets, 768px - 991px) ===== */
@media (max-width: 991px) {
    /* === Typography === */
    body {
        font-size: 15px;
    }
    
    h1 {
        font-size: var(--font-2xl);
    }
    
    h2 {
        font-size: var(--font-xl);
    }
    
    h3 {
        font-size: var(--font-lg);
    }
    
    /* === Header === */
    .site-header {
        padding: var(--spacing-4) 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .nav-container {
        position: fixed;
        top: 0;
        right: -320px;
        width: 320px;
        height: 100vh;
        background-color: var(--white);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 80px var(--spacing-6) var(--spacing-6);
        box-shadow: var(--shadow-xl);
        transition: right var(--transition-normal) ease;
        z-index: var(--z-20);
        overflow-y: auto;
    }
    
    .nav-container.active {
        right: 0;
    }
    
    .nav-list {
        flex-direction: column;
        width: 100%;
    }
    
    .nav-item {
        margin: 0;
        width: 100%;
        border-bottom: 1px solid var(--gray-200);
    }
    
    .nav-item a {
        padding: var(--spacing-3) 0;
        font-size: var(--font-base);
    }
    
    .dropdown-menu {
        position: static;
        width: 100%;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 0 0 0 var(--spacing-4);
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition-normal) ease;
    }
    
    .has-dropdown.active .dropdown-menu {
        max-height: 500px;
    }
    
    .dropdown-toggle::before {
        right: var(--spacing-2);
    }
    
    .nav-cta {
        margin: var(--spacing-6) 0 0;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-4);
    }
    
    .phone-link {
        margin-right: 0;
    }
    
    .nav-cta .btn {
        width: 100%;
    }
    
    /* === Hero Section === */
    .hero {
        min-height: 80vh;
    }
    
    .hero-title {
        font-size: var(--font-2xl);
    }
    
    .hero-subtitle {
        font-size: var(--font-md);
    }
    
    /* === Services === */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-6);
    }
    
    /* === Why Choose Us === */
    .features-wrapper {
        flex-direction: column;
    }
    
    .features-content,
    .features-image {
        width: 100%;
    }
    
    .features-image {
        order: -1;
        margin-bottom: var(--spacing-8);
    }
    
    /* === Testimonials === */
    .testimonial-card {
        padding: var(--spacing-6);
    }
    
    /* === Dentists === */
    .dentists-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-6);
    }
    
    /* === Insurance === */
    .insurance-wrapper {
        flex-direction: column;
    }
    
    .insurance-logos {
        width: 100%;
        margin-top: var(--spacing-8);
    }
    
    .logos-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* === Footer === */
    .footer-top {
        padding: var(--spacing-12) 0;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-legal {
        justify-content: center;
    }
    
    /* === Back to Top Button === */
    .back-to-top {
        bottom: var(--spacing-6);
        right: var(--spacing-6);
    }
}

/* ===== Small Devices (Small Tablets & Large Phones, 576px - 767px) ===== */
@media (max-width: 767px) {
    /* === Typography === */
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: var(--font-xl);
    }
    
    h2 {
        font-size: var(--font-lg);
    }
    
    h3 {
        font-size: var(--font-md);
    }
    
    /* === Layout === */
    .container {
        width: 90%;
    }
    
    section {
        padding: var(--spacing-10) 0;
    }
    
    .section-header {
        margin-bottom: var(--spacing-8);
    }
    
    /* === Hero Section === */
    .hero {
        min-height: 70vh;
    }
    
    .hero-content {
        padding: var(--spacing-16) 0 var(--spacing-8);
    }
    
    .hero-cta {
        flex-direction: column;
        width: 100%;
    }
    
    .hero-cta .btn {
        width: 100%;
    }
    
    /* === Services === */
    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-6);
    }
    
    /* === Testimonials === */
    .testimonials-slider {
        margin-bottom: var(--spacing-8);
    }
    
    /* === Dentists === */
    .dentists-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-8);
    }
    
    /* === Insurance === */
    .logos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-4);
    }
    
    .insurance-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .insurance-actions .btn {
        width: 100%;
    }
    
    /* === CTA Section === */
    .cta-title {
        font-size: var(--font-xl);
    }
    
    .cta-description {
        font-size: var(--font-base);
    }
    
    .cta-actions .btn {
        width: 100%;
    }
    
    /* === Footer === */
    .footer-widgets {
        grid-template-columns: 1fr;
        gap: var(--spacing-8);
    }
    
    .footer-widget {
        text-align: center;
    }
    
    .footer-heading::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .social-links {
        justify-content: center;
    }
    
    .contact-item {
        justify-content: center;
    }
    
    .contact-item i {
        margin-top: 0;
    }
    
    .hours-list li {
        justify-content: center;
        flex-direction: column;
    }
    
    .footer-links {
        columns: 1;
    }
    
    /* === Booking Sticky === */
    .booking-sticky .container {
        justify-content: center;
    }
}

/* ===== Extra Small Devices (Phones, < 576px) ===== */
@media (max-width: 575px) {
    /* === Typography === */
    h1 {
        font-size: var(--font-lg);
    }
    
    h2 {
        font-size: var(--font-md);
    }
    
    h3 {
        font-size: var(--font-base);
    }
    
    /* === Layout === */
    .container {
        width: 95%;
    }
    
    section {
        padding: var(--spacing-8) 0;
    }
    
    /* === Header === */
    .logo img {
        width: 150px;
    }
    
    .scrolled .logo img {
        width: 120px;
    }
    
    .nav-container {
        width: 100%;
        right: -100%;
    }
    
    /* === Hero Section === */
    .hero-feature-card {
        width: 100%;
        max-width: none;
    }
    
    /* === Features === */
    .feature-item {
        flex-direction: column;
        text-align: center;
    }
    
    .feature-item .feature-icon {
        margin: 0 auto var(--spacing-4);
    }
    
    /* === Testimonials === */
    .testimonial-author {
        flex-direction: column;
        text-align: center;
    }
    
    .author-image {
        margin: 0 auto var(--spacing-3);
    }
    
    .slider-button {
        width: 40px;
        height: 40px;
    }
    
    /* === Insurance === */
    .insurance-wrapper {
        padding: var(--spacing-6);
    }
    
    .logos-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-6);
    }
    
    /* === Back to Top Button === */
    .back-to-top {
        bottom: var(--spacing-4);
        right: var(--spacing-4);
        width: 40px;
        height: 40px;
    }
}

/* ===== Ultra Small Devices (Small Phones, < 375px) ===== */
@media (max-width: 374px) {
    /* === Layout === */
    .container {
        width: 100%;
        padding: 0 var(--spacing-3);
    }
    
    /* === Services === */
    .service-card {
        padding: var(--spacing-4);
    }
    
    /* === Testimonials === */
    .testimonial-card {
        padding: var(--spacing-4);
    }
    
    .testimonials-navigation {
        flex-direction: column;
        gap: var(--spacing-4);
    }
    
    /* === Footer === */
    .footer-legal {
        flex-direction: column;
        gap: var(--spacing-3);
    }
}

/* ===== Height-Based Media Queries ===== */

/* For very short screens - adjust hero height */
@media (max-height: 600px) {
    .hero {
        min-height: auto;
        padding: 100px 0 50px;
    }
    
    .hero-content {
        padding: var(--spacing-8) 0;
    }
}

/* ===== Print Styles ===== */
@media print {
    /* Hide navigation, forms, and interactive elements */
    .site-header,
    .main-nav,
    form,
    .btn,
    .back-to-top,
    .booking-sticky,
    .swiper-navigation,
    .footer-bottom {
        display: none !important;
    }
    
    /* Reset all colors to black and white */
    body {
        color: #000;
        background: #fff;
        font-size: 12pt;
        line-height: 1.5;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    /* Show URL after links */
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 90%;
    }
    
    /* Don't show URL for internal links */
    a[href^="#"]:after,
    a[href^="javascript:"]:after {
        content: "";
    }
    
    /* Expand all content to be visible */
    .dropdown-menu {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        position: static !important;
        box-shadow: none !important;
        max-height: none !important;
    }
    
    /* Page breaks */
    h1, h2, h3 {
        page-break-after: avoid;
    }
    
    .service-card,
    .feature-item,
    .testimonial-card,
    .dentist-card {
        page-break-inside: avoid;
    }
    
    /* Add page margins */
    @page {
        margin: 2cm;
    }
}

/* ===== Special Feature Queries ===== */

/* High contrast mode */
@media (prefers-contrast: more) {
    :root {
        --primary: #0055aa;
        --primary-dark: #003c7e;
        --secondary: #007722;
        --secondary-dark: #005511;
        --accent: #dd7700;
        --dark: #000000;
        --light: #ffffff;
        --gray-100: #f9f9f9;
        --gray-200: #eeeeee;
        --gray-300: #dddddd;
        --gray-400: #cccccc;
        --gray-500: #aaaaaa;
        --gray-600: #666666;
        --gray-700: #444444;
        --gray-800: #222222;
        --gray-900: #111111;
    }
    
    .btn,
    .nav-item a,
    .service-card,
    .testimonial-card,
    .dentist-card,
    .feature-item {
        border: 1px solid #000;
    }
    
    .hero-overlay {
        background: rgba(0, 0, 0, 0.7);
    }
}

/* Dark mode - prepared but not active by default */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles would go here if activated */
    /* Currently not implementing dark mode, but keeping the query for future reference */
}

/* Touch device optimizations */
@media (hover: none) {
    /* Increase touch targets */
    .nav-item a,
    .btn,
    .service-link,
    .footer-links a {
        padding: var(--spacing-3) var(--spacing-4);
    }
    
    /* Remove hover effects that don't work on touch devices */
    .hover-scale:hover,
    .hover-lift:hover,
    .hover-rotate:hover {
        transform: none;
    }
    
    .hover-underline:hover::after {
        width: 0;
    }
}