/* ===== EcoGallery Responsive Styles ===== */

/* Mobile First - Extra Small devices (portrait phones, less than 576px) */
@media (max-width: 575.98px) {
    /* Typography */
    #hero .display-4 {
        font-size: 1.8rem;
        line-height: 1.3;
    }
    
    #hero .lead {
        font-size: 1rem;
    }
    
    h1, .h1 {
        font-size: 1.75rem;
    }
    
    h2, .h2 {
        font-size: 1.5rem;
    }
    
    /* Spacing */
    section {
        padding: 2rem 0;
    }
    
    .py-5 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    /* Header */
    #header .navbar-brand {
        font-size: 1.25rem;
    }
    
    #header .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Hero Section */
    #hero {
        min-height: 100vh;
        padding-top: 100px;
    }
    
    #hero .hero-decoration {
        display: none;
    }
    
    /* Cards */
    .card-img-top {
        height: 180px;
    }
    
    .card-body {
        padding: 1rem;
    overflow-x: hidden;
}
    
    /* Services Grid */
    #services .col-lg-4 {
        margin-bottom: 1rem;
    }
    
    /* Gallery */
    #gallery .col-lg-4 {
        margin-bottom: 1rem;
    }
    
    #gallery img {
        margin-bottom: 0.5rem;
    }
    
    /* Team Section */
    #team .col-lg-2 {
        margin-bottom: 1.5rem;
    }
    
    #team img {
        width: 100px;
        height: 100px;
    }
    
    /* Contact Form */
    #contacts .form-control {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    #contacts .btn-lg {
        width: 100%;
        margin-top: 1rem;
    }
    
    /* Footer */
    #footer .col-lg-4 {
        text-align: center;
        margin-bottom: 2rem;
    }
    
    /* Disable animations on mobile for better performance */
    .card:hover {
        transform: none;
    }
    
    #gallery img:hover {
        transform: none;
    }
    
    #team img:hover {
        transform: none;
    }
    
    /* Feature Icons */
    .feature-icon {
        width: 60px;
        height: 60px;
    }
    
    .feature-icon .fa-2x {
        font-size: 1.5em;
    }
    
    /* Process Steps - Mobile Stack */
    .bg-primary.text-white {
        width: 40px;
        height: 40px;
    }
    
    .bg-primary.text-white .h4 {
        font-size: 1rem;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    /* Typography */
    #hero .display-4 {
        font-size: 2rem;
    }
    
    /* Spacing */
    section {
        padding: 2.5rem 0;
    }
    
    /* Cards */
    .card-img-top {
        height: 190px;
    }
    
    /* Gallery Grid */
    #gallery .col-md-6 {
        margin-bottom: 1rem;
    }
    
    /* Team Section - 2 columns */
    #team .col-md-4 {
        margin-bottom: 1.5rem;
    }
    
    /* Disable some hover effects */
    .card:hover {
        transform: translateY(-2px);
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Typography */
    #hero .display-4 {
        font-size: 2.25rem;
    }
    
    /* Spacing */
    section {
        padding: 3rem 0;
    }
    
    /* Cards */
    .card-img-top {
        height: 195px;
    }
    
    /* Services Grid - 2 columns */
    #services .col-lg-4:nth-child(3n) {
        margin-bottom: 1rem;
    }
    
    /* Gallery - 2 columns */
    #gallery .col-lg-4 {
        margin-bottom: 1rem;
    }
    
    /* Team Section - Better spacing */
    #team .col-md-4 {
        margin-bottom: 1.5rem;
    }
    
    /* Price Plans - Stack on medium */
    #priceplan .col-lg-4 {
        margin-bottom: 1rem;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* Fine-tune spacing for large screens */
    .container {
        max-width: 960px;
    }
    
    /* Cards */
    .card-img-top {
        height: 200px;
    }
    
    /* Team Section - 5 columns adjustment */
    #team .col-lg-2 {
        flex: 0 0 20%;
        max-width: 20%;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    /* Optimal spacing for very large screens */
    .container {
        max-width: 1140px;
    }
    
    /* Enhanced hover effects for desktop */
    .card:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 40px rgba(45, 138, 71, 0.2);
    }
    
    /* Gallery enhanced hover */
    #gallery img:hover {
        transform: scale(1.08);
    }
    
    /* Team enhanced hover */
    #team img:hover {
        transform: scale(1.15);
    }
}

/* Ultra-wide screens (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    /* Larger feature icons for ultra-wide */
    .feature-icon {
        width: 100px;
        height: 100px;
    }
    
    /* Larger typography */
    #hero .display-4 {
        font-size: 3rem;
    }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    #hero {
        min-height: auto;
        padding: 120px 0 60px;
    }
    
    section {
        padding: 2rem 0;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Sharper borders and shadows */
    .card {
        border-radius: 16px;
    }
    
    .shadow-sm {
        box-shadow: 0 0.25rem 0.5rem rgba(45, 138, 71, 0.1) !important;
    }
}

/* Print styles */
@media print {
    /* Hide navigation and interactive elements */
    #header,
    #footer,
    .btn,
    .navbar {
        display: none !important;
    }
    
    /* Optimize for print */
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    /* Force black text for better printing */
    * {
        color: #000 !important;
        background: #fff !important;
    }
}

/* Accessibility - Reduce motion preferences */
@media (prefers-reduced-motion: reduce) {
    /* Disable all animations for users who prefer reduced motion */
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    /* Remove hover effects that rely on transforms */
    .card:hover,
    #gallery img:hover,
    #team img:hover {
        transform: none !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #1a5229;
        --secondary-color: #5a9d7a;
        --border-color: #333;
        --text-color: #000;
    }
    
    .card {
        border: 2px solid var(--border-color);
    }
    
    .btn {
        border-width: 2px;
    }
}

/* Focus improvements for keyboard navigation */
@media (prefers-reduced-motion: no-preference) {
    .btn:focus,
    .nav-link:focus,
    .form-control:focus {
        transition: all 0.2s ease;
    }
}

/* Container max-width adjustments for different breakpoints */
@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Additional mobile optimizations */
@media (max-width: 767.98px) {
    /* Optimize touch targets */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    /* Better mobile menu */
    .navbar-collapse {
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        border-radius: 10px;
        margin-top: 10px;
        padding: 1rem;
    }
    
    /* Mobile-friendly form inputs */
    .form-control {
        font-size: 16px;
        padding: 12px;
    }
    
    /* Stack price plan features */
    #priceplan .list-unstyled {
        text-align: left;
    }
    
    /* Better mobile gallery layout */
    #gallery .row {
        margin: 0 -5px;
    }
    
    #gallery .col-lg-4 {
        padding: 0 5px;
        margin-bottom: 10px;
    }
}

/* Tablet specific optimizations */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Optimize for tablet landscape/portrait */
    .card-columns {
        column-count: 2;
    }
    
    /* Better team layout for tablets */
    #team .row {
        justify-content: center;
    }
    
    /* Adjust hero for tablets */
    #hero .col-lg-6 {
        margin-bottom: 2rem;
    }
} 