/* Responsive Design Enhancements */

/* Large screens (1200px and above) */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }
    
    .content-main {
        padding: 3rem;
    }
    
    .hero-content h1 {
        font-size: 3.5rem;
    }
}

/* Medium screens (768px to 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
    .content-grid {
        grid-template-columns: 1fr 250px;
        gap: 2rem;
    }
    
    .hero-section {
        padding: 6rem 2rem 3rem;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
}

/* Small tablets and large phones (481px to 767px) */
@media (min-width: 481px) and (max-width: 767px) {
    .nav-container {
        padding: 0 1.5rem;
    }
    
    .hero-section {
        padding: 5rem 1.5rem 2rem;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .content-main {
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.4rem;
    }
    
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* Very small devices (up to 480px) */
@media (max-width: 480px) {
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-logo h1 {
        font-size: 1.5rem;
    }
    
    .hero-section {
        padding: 4rem 1rem 2rem;
        margin-top: 70px;
    }
    
    .hero-content h1 {
        font-size: 1.6rem;
        margin-bottom: 0.8rem;
    }
    
    .hero-content p {
        font-size: 0.9rem;
    }
    
    .content-section {
        padding: 2rem 0;
    }
    
    .content-main {
        padding: 1rem;
        border-radius: 8px;
    }
    
    h1 {
        font-size: 1.6rem;
    }
    
    h2 {
        font-size: 1.3rem;
        margin-top: 1.5rem;
    }
    
    h3 {
        font-size: 1.1rem;
        margin-top: 1.2rem;
    }
    
    p {
        font-size: 0.95rem;
        margin-bottom: 0.8rem;
    }
    
    .image-container {
        margin: 1.5rem 0;
    }
    
    .image-caption {
        font-size: 0.8rem;
        margin-top: 0.8rem;
    }
    
    .footer {
        padding: 2rem 0 1rem;
        margin-top: 2rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .footer-section h3 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }
    
    .footer-section p,
    .footer-section a {
        font-size: 0.9rem;
        margin-bottom: 0.4rem;
    }
    
    .footer-bottom {
        font-size: 0.8rem;
    }
}

/* Ultra-wide screens (1800px and above) */
@media (min-width: 1800px) {
    .container {
        max-width: 1600px;
    }
    
    .content-main {
        padding: 4rem;
    }
    
    .hero-content h1 {
        font-size: 4rem;
    }
    
    .hero-content p {
        font-size: 1.4rem;
    }
    
    h1 {
        font-size: 3rem;
    }
    
    h2 {
        font-size: 2.2rem;
    }
    
    h3 {
        font-size: 1.7rem;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        padding: 3rem 2rem 2rem;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .content-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .header {
        background: rgba(44, 62, 80, 0.95);
    }
    
    .nav-logo h1 {
        color: #ecf0f1;
    }
    
    .bar {
        background: #ecf0f1;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .content-image:hover {
        transform: none;
    }
    
    .nav-link::after {
        transition: none;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .nav-link:hover {
        color: #2c3e50;
    }
    
    .nav-link.active:hover {
        color: #e74c3c;
    }
    
    .content-image:hover {
        transform: none;
    }
}

/* Print media queries */
@media print {
    .header,
    .footer {
        background: white !important;
        color: black !important;
    }
    
    .content-main {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .hero-section {
        background: white !important;
        color: black !important;
    }
    
    .hero-content h1,
    .hero-content p {
        color: black !important;
    }
    
    h1, h2, h3 {
        color: black !important;
    }
    
    a {
        color: black !important;
        text-decoration: underline !important;
    }
}

/* Orientation-specific styles */
@media (orientation: portrait) {
    .hero-section {
        background-attachment: scroll;
    }
}

@media (orientation: landscape) {
    .hero-section {
        background-attachment: fixed;
    }
}

/* Specific device optimizations */
/* iPhone X and similar notched devices */
@supports (padding-top: env(safe-area-inset-top)) {
    .header {
        padding-top: env(safe-area-inset-top);
    }
    
    .hero-section {
        padding-top: calc(8rem + env(safe-area-inset-top));
    }
}

/* Foldable devices */
@media (screen-spanning: single-fold-vertical) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* Accessibility improvements for screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus visible for keyboard navigation */
:focus-visible {
    outline: 2px solid #e74c3c;
    outline-offset: 2px;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}