/* Mobile First Responsive Design */

/* Extra Small Devices (Portrait Phones) */
@media (max-width: 575.98px) {
    /* Disable animations on mobile for better performance */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    /* Typography adjustments */
    .display-4 {
        font-size: 1.87rem;
    }
    
    .h1 {
        font-size: 1.59rem;
    }
    
    .h4 {
        font-size: 1.13rem;
    }
    
    .lead {
        font-size: 1rem;
    }
    
    /* Navigation */
    .navbar-brand {
        font-size: 1.14rem;
    }
    
    .navbar-toggler {
        border: none;
        padding: 0.25rem 0.5rem;
    }
    
    .navbar-collapse {
        margin-top: 1rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 0;
        text-align: center;
    }
    
    /* Hero Section */
    #hero {
        min-height: 80vh;
        padding: 2rem 0;
    }
    
    #hero .container {
        text-align: center;
    }
    
    #hero .col-lg-6:first-child {
        margin-bottom: 2rem;
    }
    
    /* Button adjustments */
    .btn {
        font-size: 1.03rem;
        padding: 0.625rem 1.5rem;
    }
    
    .btn-lg {
        font-size: 1rem;
        padding: 0.75rem 2rem;
    }
    
    /* Card spacing */
    .card {
        margin-bottom: 1.69rem;
    }
    
    .card-body {
        padding: 1.25rem;
    overflow-x: hidden;
}
    
    /* Section spacing */
    section {
        padding: 2.5rem 0;
    }
    
    .py-5 {
        padding-top: 2.56rem;
        padding-bottom: 2.66rem;
    }
    
    /* Form adjustments */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Gallery adjustments */
    #gallery img {
        height: 200px;
        margin-bottom: 1rem;
    }
    
    /* Team member images */
    .rounded-circle {
        width: 100px;
        height: 100px;
    }
    
    /* Contact info stacking */
    #contacts .row.mt-5 .col-md-4 {
        margin-bottom: 2rem;
        text-align: center;
    }
    
    /* Footer adjustments */
    #footer .col-lg-4 {
        text-align: center;
        margin-bottom: 2rem;
    }
}

/* Small Devices (Landscape Phones) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .h1 {
        font-size: 1.77rem;
    }
    
    /* Hero adjustments */
    #hero {
        min-height: 85vh;
    }
    
    /* Card grid adjustments */
    .col-md-6.col-lg-4 {
        margin-bottom: 1.67rem;
    }
    
    /* Gallery grid */
    #gallery .col-md-4 {
        margin-bottom: 1rem;
    }
    
    #gallery img {
        height: 220px;
    }
    
    /* Team layout */
    .col-md-6.col-lg-2 {
        margin-bottom: 2rem;
        text-align: center;
    }
}

/* Medium Devices (Tablets) */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Typography fine-tuning */
    .display-4 {
        font-size: 2.33rem;
    }
    
    /* Hero section */
    #hero {
        min-height: 90vh;
    }
    
    /* Services grid */
    .col-md-6.col-lg-4 .card {
        height: 100%;
    }
    
    /* Gallery adjustments */
    #gallery img {
        height: 240px;
    }
    
    /* Team layout adjustments */
    .col-md-6.col-lg-2 {
        flex: 0 0 auto;
        width: 20%;
    }
    
    /* Pricing cards */
    #priceplan .col-lg-4 {
        margin-bottom: 2rem;
    }
}

/* Large Devices (Desktops) */
@media (min-width: 993px) and (max-width: 1199.98px) {
    /* Container adjustments */
    .container {
        max-width: 960px;
    }
    
    /* Fine-tune card heights */
    .card.h-100 {
        min-height: 300px;
    }
    
    /* Gallery optimization */
    #gallery img {
        height: 250px;
    }
}

/* Extra Large Devices (Large Desktops) */
@media (min-width: 1200px) {
    /* Container max width */
    .container {
        max-width: 1140px;
    }
    
    /* Enhanced spacing for large screens */
    section {
        padding: 6rem 0;
    }
    
    /* Gallery full height */
    #gallery img {
        height: 280px;
    }
    
    /* Hero section enhanced */
    #hero {
        min-height: 100vh;
    }
}

/* Landscape Orientation */
@media (orientation: landscape) and (max-height: 600px) {
    #hero {
        min-height: 100vh;
        padding: 1rem 0;
    }
    
    section {
        padding: 2rem 0;
    }
    
    .py-5 {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure crisp text rendering */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .card:hover {
        transform: none;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    
    .btn:hover {
        transform: none;
    }
    
    .rounded-circle:hover {
        transform: none;
        border-color: var(--light-blue);
    }
    
    #gallery img:hover {
        transform: none;
        box-shadow: none;
    }
    
    /* Larger touch targets */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .navbar-toggler {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Print Styles */
@media print {
    /* Hide non-essential elements */
    .navbar,
    .btn,
    #gallery,
    footer {
        display: none;
    }
    
    /* Optimize for print */
    body {
        color: black;
        background: white;
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .container {
        width: 100%;
        max-width: none;
    }
    
    section {
        padding: 1rem 0;
        page-break-inside: avoid;
    }
    
    .card {
        border: 1px solid #e0e0e0;
        box-shadow: none;
    }
}

/* Accessibility Improvements */
@media (prefers-contrast: high) {
    /* High contrast mode */
    :root {
        --primary-blue: #1921ff;
        --gray-700: #000000;
        --gray-600: #000000;
    }
    
    .card {
        border: 2px solid #000;
    }
    
    .btn-primary {
        background-color: #1a0cf6;
        border: 2px solid #000;
        color: white;
    }
    
    .btn-outline-primary {
        border: 2px solid #0002f0;
        color: #1538ff;
    }
}

/* Dark Mode Support */