/* Responsive Design - Mobile First Approach */

/* Extra Small devices (phones, 576px and down) */
@media (max-width: 575.98px) {
    /* Typography adjustments */
    .display-5 {
        font-size: 1.75rem;
        line-height: 1.2;
    }
    
    .h2 {
        font-size: 1.5rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    /* Header adjustments */
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    .navbar-toggler {
        padding: 0.25rem 0.5rem;
        border: none;
    }
    
    .navbar-collapse {
        margin-top: 1rem;
        border-top: 1px solid #e9ecef;
        padding-top: 1rem;
    }
    
    /* Hero section mobile optimization */
    .hero-section {
        padding-top: 70px;
        min-height: 70vh;
        text-align: center;
    }
    
    .hero-section .container {
        padding: 1rem;
    }
    
    /* Disable animations on mobile for better performance */
    .hero-section .shape-1,
    .hero-section .shape-2 {
        display: none;
    }
    
    /* Button adjustments */
    .btn {
        font-size: 0.9rem;
        padding: 0.5rem 1.25rem;
        border-radius: 20px;
    }
    
    .btn-lg {
        font-size: 1rem;
        padding: 0.75rem 1.5rem;
    }
    
    /* Card adjustments */
    .card {
        margin-bottom: 1.5rem;
        border-radius: 10px;
    }
    
    .card-img-top {
        height: 180px;
        border-radius: 10px 10px 0 0;
    }
    
    .card-body {
        padding: 1rem;
    overflow-x: hidden;
}
    
    /* Section spacing */
    section {
        padding: 2rem 0;
    }
    
    .py-5 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
    
    /* Form adjustments */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        border-radius: 8px;
    }
    
    /* Gallery adjustments */
    #gallery .col-sm-6 {
        margin-bottom: 1rem;
    }
    
    #gallery img {
        border-radius: 8px;
    }
    
    /* Team section mobile */
    .team img {
        width: 100px;
        height: 100px;
        margin-bottom: 0.5rem;
    }
    
    /* Footer adjustments */
    #footer {
        text-align: center;
    }
    
    #footer .col-lg-4 {
        margin-bottom: 2rem;
    }
    
    /* Disable hover effects on mobile */
    .card:hover,
    [id^="services-item-"]:hover {
        transform: none;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    }
    
    #gallery img:hover {
        transform: none;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .display-5 {
        font-size: 2rem;
    }
    
    .h2 {
        font-size: 1.75rem;
    }
    
    .hero-section {
        padding-top: 80px;
        min-height: 80vh;
    }
    
    .btn-lg {
        padding: 0.875rem 2rem;
        font-size: 1.0625rem;
    }
    
    .card-img-top {
        height: 190px;
    }
    
    section {
        padding: 3rem 0;
    }
    
    .py-5 {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .hero-section {
        padding-top: 90px;
    }
    
    .card-img-top {
        height: 200px;
    }
    
    /* Adjust grid spacing */
    .g-4 > * {
        margin-bottom: 1.5rem;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    /* Restore full desktop experience */
    .hero-section {
        padding-top: 100px;
        min-height: 100vh;
    }
    
    /* Enable hover effects */
    .card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    }
    
    [id^="services-item-"]:hover {
        transform: translateY(-3px);
    }
    
    #gallery img:hover {
        transform: scale(1.05);
    }
    
    .team img:hover {
        border-color: var(--success);
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    .display-5 {
        font-size: 2.75rem;
    }
    
    .h2 {
        font-size: 2.25rem;
    }
    
    /* Increase section spacing on large screens */
    section {
        padding: 5rem 0;
    }
    
    .py-5 {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
}

/* Ultra wide screens (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    /* Enhance hero section for ultra-wide */
    .hero-section .shape-1 {
        width: 400px;
        height: 400px;
    }
    
    .hero-section .shape-2 {
        width: 300px;
        height: 300px;
    }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    .hero-section {
        min-height: auto;
        padding-top: 70px;
        padding-bottom: 2rem;
    }
    
    .hero-section .shape-1,
    .hero-section .shape-2 {
        display: none;
    }
}

/* Print styles */
@media print {
    .navbar,
    .hero-shapes,
    .btn,
    #footer {
        display: none;
    }
    
    .hero-section {
        background: white;
        color: black;
        padding-top: 0;
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
        break-inside: avoid;
    }
    
    section {
        padding: 1rem 0;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure crisp images on retina displays */
    .card-img-top,
    #gallery img,
    .team img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Reduced motion preferences - mobile specific */
@media (prefers-reduced-motion: reduce) and (max-width: 767.98px) {
    /* Completely disable animations on mobile for users who prefer reduced motion */
    * {
        animation: none !important;
        transition: none !important;
    }
    
    .card:hover,
    [id^="services-item-"]:hover,
    #gallery img:hover {
        transform: none !important;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-link {
        padding: 1rem;
    }
    
    .form-control {
        min-height: 44px;
    }
    
    /* Remove hover states on touch devices */
    .card:hover,
    [id^="services-item-"]:hover,
    #gallery img:hover,
    .team img:hover {
        transform: none;
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
        border-color: initial;
    }
    
    .navbar-nav .nav-link:hover {
        color: inherit;
    }
    
    .btn:hover {
        background-color: var(--success);
        border-color: var(--success);
    }
}

/* Dark mode support */

.hero-section h1 {
    padding-top: 150px;
}