/* ===== RESPONSIVE STYLES ===== */
/* Mobile First Approach */

/* Extra Small devices (phones, 576px and down) */
@media (max-width: 575.98px) {
    :root {
        --font-size-5xl: 2rem;
        --font-size-4xl: 1.75rem;
        --font-size-3xl: 1.5rem;
        --font-size-2xl: 1.25rem;
        --spacing-3xl: 2rem;
        --spacing-2xl: 1.5rem;
    }
    
    .hero-title {
        font-size: var(--font-size-4xl);
    }
    
    .hero-subtitle {
        font-size: var(--font-size-lg);
    }
    
    .section {
        padding: var(--spacing-2xl) 0;
    }
    
    .navbar-brand {
        font-size: var(--font-size-base);
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .service-card {
        padding: var(--spacing-lg);
    }
    
    .team-photo {
        width: 150px;
        height: 150px;
    }
    
    .gallery-layout {
        grid-template-columns: 1fr;
    }
    
    .card-body {
        padding: var(--spacing-md);
    }
    
    .testimonial-card {
        padding: var(--spacing-lg);
    }
    
    .footer {
        padding: var(--spacing-2xl) 0 var(--spacing-lg);
    }
    
    .additional-elements {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .hero-section {
        min-height: 80vh;
        text-align: center;
    }
    
    .hero-image {
        margin-top: var(--spacing-xl);
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-layout {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .additional-elements {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-section {
        min-height: 90vh;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-layout {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .additional-elements {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-section {
        min-height: 100vh;
    }
    
    .navbar-nav .nav-link {
        margin: 0 var(--spacing-xs);
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .gallery-layout {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .additional-elements {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Extra Large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .gallery-layout {
        grid-template-columns: repeat(5, 1fr);
    }
    
    .additional-elements {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .container {
        max-width: 1200px;
    }
}

/* ===== SPECIFIC RESPONSIVE ADJUSTMENTS ===== */

/* Navigation responsive behavior */
@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: var(--color-white);
        box-shadow: var(--shadow-md);
        border-radius: var(--border-radius-md);
        padding: var(--spacing-lg);
        margin-top: var(--spacing-md);
    }
    
    .navbar-nav .nav-link {
        padding: var(--spacing-sm) 0;
        border-bottom: 1px solid var(--color-gray-200);
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
}

/* Hero section responsive layout */
@media (max-width: 767.98px) {
    .hero-section .row {
        flex-direction: column-reverse;
    }
    
    .hero-content {
        text-align: center;
        margin-top: var(--spacing-xl);
    padding-top: 100px;
}
}

/* Form responsive behavior */
@media (max-width: 575.98px) {
    .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .btn {
        width: 100%;
        margin-bottom: var(--spacing-sm);
    }
}

/* Team section responsive grid */
@media (max-width: 767.98px) {
    .team-member {
        margin-bottom: var(--spacing-lg);
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .team-member {
        margin-bottom: var(--spacing-xl);
    }
}

/* FAQ responsive behavior */
@media (max-width: 575.98px) {
    .faq-question {
        padding: var(--spacing-md);
        font-size: var(--font-size-sm);
    }
    
    .faq-answer {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--font-size-sm);
    }
}

/* Footer responsive layout */
@media (max-width: 767.98px) {
    .footer .row > div {
        margin-bottom: var(--spacing-xl);
        text-align: center;
    }
    
    .footer-bottom {
        text-align: center;
    }
}

/* Card responsive behavior */
@media (max-width: 575.98px) {
    .card-header {
        padding: var(--spacing-md);
    }
    
    .card-title {
        font-size: var(--font-size-lg);
    }
}

/* Testimonials responsive behavior */
@media (max-width: 767.98px) {
    .testimonial-text {
        font-size: var(--font-size-base);
    }
}

/* Gallery responsive behavior */
@media (max-width: 575.98px) {
    .gallery-item {
        aspect-ratio: 4/3;
    }
}

/* Breadcrumb responsive behavior */
@media (max-width: 575.98px) {
    .breadcrumb-container {
        padding: var(--spacing-sm) 0;
    }
    
    .breadcrumb-image {
        width: 30px;
        height: 30px;
    }
}

/* Additional pages responsive behavior */
@media (max-width: 767.98px) {
    .additional-section {
        padding: var(--spacing-lg) 0;
    }
    
    .additional-element {
        padding: var(--spacing-md);
    }
    
    .additional-element-title {
        font-size: var(--font-size-base);
    }
}

/* Space section responsive behavior */
@media (max-width: 575.98px) {
    .space-section {
        min-height: 40vh;
    }
    
    #space {
        min-height: 300px;
        font-size: var(--font-size-lg);
    }
}

/* Print styles */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a, a:visited {
        text-decoration: underline;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    .navbar, .footer {
        display: none;
    }
    
    .hero-section {
        min-height: auto;
        padding: 2rem 0;
    }
    
    .section {
        padding: 1rem 0;
    }
    
    .card {
        border: 1px solid #ece3e4;
    }
    
    .btn {
        border: 1px solid #cccccc;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --color-gray-600: #000000;
        --color-gray-700: #000000;
        --color-gray-800: #000000;
    }
    
    .card {
        border: 2px solid var(--color-gray-800);
    }
    
    .btn {
        border: 2px solid var(--color-gray-800);
    }
    
    .form-control {
        border: 2px solid var(--color-gray-800);
    }
}

/* Landscape orientation specific styles */
@media (orientation: landscape) and (max-height: 500px) {
    .hero-section {
        min-height: 100vh;
    }
    
    .navbar {
        padding: var(--spacing-sm) 0;
    }
}

/* High pixel density displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-image img,
    .gallery-item img,
    .team-photo img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Touch device specific styles */
@media (hover: none) and (pointer: coarse) {
    .card:hover {
        transform: none;
        box-shadow: var(--shadow-md);
    }
    
    .service-card:hover {
        transform: none;
        box-shadow: var(--shadow-md);
    }
    
    .gallery-item:hover img {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
}

/* Reduced motion respect */
@media (prefers-reduced-motion: reduce) {
    .card,
    .service-card,
    .btn,
    .gallery-item img {
        transition: none;
    }
    
    .fade-in-up {
        animation: none;
    }
    
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}