/* Responsive Design - Mobile First Approach */

/* Extra Small devices (phones, 576px and down) */
@media (max-width: 575.98px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section h2 {
        font-size: 1.53rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .navbar-brand {
        font-size: 1.31rem;
    }
    
    .service-card {
        margin-bottom: 2rem;
    }
    
    .feature-card {
        margin-bottom: 2rem;
    }
    
    .feature-icon {
        font-size: 2.65rem;
    }
    
    .service-content {
        padding: 1rem;
    }
    
    .service-image {
        height: 150px;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .about-section,
    .services-section {
        padding: 3rem 0;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .hero-section h1 {
        font-size: 2.29rem;
    }
    
    .hero-section h2 {
        font-size: 1.86rem;
    }
    
    .service-image {
        height: 180px;
    }
    
    .feature-card,
    .service-card {
        margin-bottom: 1.65rem;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .hero-section h1 {
        font-size: 2.59rem;
    }
    
    .hero-section h2 {
        font-size: 2rem;
    }
    
    .service-image {
        height: 200px;
    }
    
    /* На средних экранах делаем col-md-3 и col-md-4 на половину ширины */
    .col-md-4,
    .col-md-3 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        margin-bottom: 2rem;
    }
}

/* Large devices (desktops, 992px and up) - стили уже определены в основном медиа-запросе */

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    .hero-section h1 {
        font-size: 3rem;
    }
    
    .hero-section h2 {
        font-size: 2.31rem;
    }
    
    .service-image {
        height: 220px;
    }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 600px) {
    .hero-section {
        min-height: 100vh;
        padding: 2rem 0;
    }
    
    .hero-section h1 {
        font-size: 2rem;
        padding-top: 150px !important;
    }
    
    .hero-section h2 {
        font-size: 1.58rem;
    }
    
    .navbar {
        padding: 0.5rem 0;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .service-image,
    .hero-section::before {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print styles */
@media print {
    .navbar,
    .hero-section,
    .service-card:hover,
    .feature-card:hover {
        box-shadow: none;
        transform: none;
    }
    
    .hero-section {
        background: var(--white);
        color: var(--black);
        min-height: auto;
    }
    
    .hero-section h1 {
        padding-top: 150px !important;
    }
    
    .hero-section h1,
    .hero-section h2,
    .hero-section p {
        color: var(--black);
    }
    
    .navbar {
        background: var(--white);
        border-bottom: 1px solid var(--gray-medium);
    }
    
    .navbar-brand,
    .nav-link {
        color: var(--black) !important;
    }
    
    .service-card,
    .feature-card {
        border: 1px solid var(--gray-medium);
        break-inside: avoid;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    .service-card,
    .feature-card {
        transition: none;
    }
    
    .service-card:hover,
    .feature-card:hover {
        transform: none;
    }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    /* Note: User specified not to create dark theme for accessibility */
    /* Keeping this section empty but available for future use */
}

/* Custom Bootstrap Grid System - Fixed for proper responsive behavior */
.container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-right: auto;
    margin-left: auto;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.col-md-3,
.col-md-4,
.col-md-6,
.col-md-12 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

/* Responsive grid behavior - Override Tailwind with !important */
@media (min-width: 768px) {
    .col-md-3 {
        flex: 0 0 25% !important;
        max-width: 25% !important;
    }
    
    .col-md-4 {
        flex: 0 0 33.333333% !important;
        max-width: 33.333333% !important;
    }
    
    .col-md-6 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    
    .col-md-12 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* Focus states for accessibility */
.nav-link:focus,
.navbar-brand:focus {
    outline: 2px solid var(--primary-mint);
    outline-offset: 2px;
}

/* Ensure adequate spacing on all devices */
.section-padding {
    padding: 3rem 0;
}

@media (min-width: 768px) {
    .section-padding {
        padding: 5rem 0;
    }
}

/* Image optimization for different screen sizes */
.service-image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Ensure text remains readable on all devices */
@media (max-width: 767.98px) {
    .service-content p,
    .feature-card p {
        font-size: 0.92rem;
    }
    
    .service-content h4,
    .feature-card h4 {
        font-size: 1.34rem;
    }
}

/* Additional Bootstrap responsive utilities */
.d-block { display: block !important; }
.d-none { display: none !important; }

@media (min-width: 768px) {
    .d-md-block { display: block !important; }
    .d-md-none { display: none !important; }
}

@media (min-width: 992px) {
    .d-lg-block { display: block !important; }
    .d-lg-none { display: none !important; }
} 