/* Responsive Design - Mobile First Approach */

/* Extra Small Devices (phones, 0-576px) */
@media (max-width: 575.98px) {
    .container {
        padding: 0 15px;
    }
    
    /* Typography */
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .section {
        padding: 60px 0;
    }
    
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--bg-white);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: left 0.3s ease;
        z-index: 999;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 40px;
        text-align: center;
    }
    
    .nav-link {
        font-size: 1.2rem;
    }
    
    .nav-toggle {
        display: flex;
        z-index: 1001;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    
    /* Hero Section */
    .hero {
        padding: 120px 0 80px;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
    
    /* Page Header */
    .page-header {
        padding: 120px 0 60px;
    }
    
    .page-title {
        font-size: 2.5rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    /* About Section */
    .about-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .about-stats {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stat-item {
        flex: 1;
        min-width: 150px;
    }
    
    /* Services Grid */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    /* Benefits */
    .benefits-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .benefit-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    /* Reviews */
    .reviews-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    /* Newsletter */
    .newsletter-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .newsletter-text h2 {
        font-size: 2rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .footer-links {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    /* Process Steps */
    .steps-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .step-item {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .step-number {
        align-self: center;
    }
    
    /* Documents */
    .documents-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    /* Tips */
    .tips-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* CTA */
    .cta-content h2 {
        font-size: 2rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .cta-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
    
    /* Districts */
    .districts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Comparison Table */
    .comparison-table {
        overflow-x: auto;
    }
    
    .table-header,
    .table-row {
        grid-template-columns: 150px repeat(5, 80px);
        min-width: 550px;
    }
    
    .header-cell,
    .cell {
        padding: 15px 10px;
        font-size: 0.9rem;
    }
    
    /* Investment Tips */
    .tips-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .tip-item {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .social-links-large {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    /* FAQ */
    .faq-question {
        padding: 20px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .faq-answer p {
        padding: 0 20px 20px;
    }
    
    /* Thanks Page */
    .thanks-title {
        font-size: 2.5rem;
    }
    
    .thanks-info {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .thanks-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .thanks-actions .btn {
        width: 100%;
        max-width: 300px;
    }
    
    /* Recommendations */
    .recommendations-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    /* Legal Document */
    .legal-document {
        padding: 40px 20px;
    }
    
    /* Cookie Management */
    .cookie-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .cookie-controls .btn {
        width: 100%;
        max-width: 300px;
    }
    
    /* Cookie Consent */
    .cookie-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .cookie-buttons {
        justify-content: center;
    }
    
    .cookie-buttons .btn {
        flex: 1;
        min-width: 120px;
    }
    .nav-brand .logo {
        font-size: 1rem;
    }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .container {
        max-width: 540px;
    }
    
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--bg-white);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: left 0.3s ease;
        z-index: 999;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 40px;
        text-align: center;
    }
    
    .nav-toggle {
        display: flex;
        z-index: 1001;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Hero */
    .hero-title {
        font-size: 3rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    /* About */
    .about-content {
        grid-template-columns: 1fr;
        gap: 50px;
        text-align: center;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    /* Newsletter */
    .newsletter-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    /* Process Steps */
    .steps-grid {
        grid-template-columns: 1fr;
    }
    
    /* Districts */
    .districts-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }
    
    /* Form */
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container {
        max-width: 720px;
    }
    
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 300px;
        height: 100vh;
        background-color: var(--bg-white);
        display: flex;
        align-items: center;
        justify-content: center;
        transition: left 0.3s ease;
        z-index: 999;
        box-shadow: var(--shadow-medium);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }
    
    .nav-toggle {
        display: flex;
        z-index: 1001;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* About */
    .about-content {
        grid-template-columns: 1fr;
        gap: 50px;
        text-align: center;
    }
    
    .about-stats {
        flex-direction: row;
        justify-content: space-around;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    /* Benefits */
    .benefits-list {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    /* Newsletter */
    .newsletter-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 50px;
    }
    
    /* Process Steps */
    .steps-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
    
    /* Documents */
    .documents-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
    
    /* Districts */
    .districts-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 50px;
    }
    
    /* Recommendations */
    .recommendations-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }
    
    /* All desktop styles from main CSS apply */
    .nav-toggle {
        display: none;
    }
    
    .nav-menu {
        position: relative;
        display: flex;
        background: none;
        height: auto;
        width: auto;
        left: 0;
    }
    
    .nav-list {
        flex-direction: row;
        gap: 25px;
    }
    
    /* About */
    .about-content {
        grid-template-columns: 2fr 1fr;
    }
    
    /* Newsletter */
    .newsletter-content {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Form */
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
    
    /* Enhanced spacing for larger screens */
    .section {
        padding: 100px 0;
    }
    
    .hero {
        padding: 180px 0 120px;
    }
    
    .page-header {
        padding: 180px 0 100px;
    }
}

/* Extra Extra Large Devices (extra large desktops, 1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    /* Even more spacing for very large screens */
    .section {
        padding: 120px 0;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
}

/* Landscape Phone Specific */
@media (max-width: 767.98px) and (orientation: landscape) {
    .hero {
        padding: 100px 0 60px;
    }
    
    .page-header {
        padding: 100px 0 60px;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .section {
        padding: 40px 0;
    }
    
    .nav-menu {
        padding-top: 80px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure crisp rendering on high DPI displays */
    .service-icon,
    .step-icon,
    .section-icon,
    .page-icon,
    .recommendation-icon {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .hero-background {
        animation: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .service-card:hover,
    .district-card:hover,
    .review-card:hover {
        transform: none;
    }
}

/* Print Styles */
@media print {
    .nav-toggle,
    .cookie-consent,
    .social-links,
    .hero-buttons,
    .cta-buttons,
    .thanks-actions,
    .cookie-controls {
        display: none !important;
    }
    
    .hero,
    .page-header {
        background: none !important;
        color: black !important;
        padding: 20px 0 !important;
    }
    
    .hero-title,
    .page-title {
        color: black !important;
    }
    
    .section {
        padding: 20px 0 !important;
        break-inside: avoid;
    }
    
    .service-card,
    .benefit-item,
    .review-card,
    .district-card,
    .tip-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
    
    a {
        color: black !important;
        text-decoration: underline !important;
    }
    
    .container {
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
}

/* Accessibility Improvements */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000080;
        --primary-light: #0000cc;
        --text-dark: #000000;
        --text-light: #333333;
        --border-color: #666666;
    }
    
    .btn-outline {
        border-width: 3px;
    }
    
    .nav-link::after {
        height: 3px;
    }
    
    input:focus,
    textarea:focus,
    select:focus {
        border-width: 3px;
    }
}

/* Focus Management for Mobile */
@media (max-width: 767.98px) {
    .nav-menu.active {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-menu.active .nav-link:first-child {
        margin-top: 40px;
    }
    
    .nav-menu.active .nav-link:last-child {
        margin-bottom: 40px;
    }
    
    /* Touch-friendly button sizes */
    .btn {
        min-height: 44px;
        padding: 12px 24px;
    }
    
    .faq-question {
        min-height: 60px;
    }
    
    .contact-item {
        min-height: 60px;
    }
}

/* Tablet Specific Adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Optimize for tablet viewing */
    .hero-title {
        font-size: 3.2rem;
    }
    
    .section-title {
        font-size: 2.3rem;
    }
    
    .comparison-table {
        font-size: 0.95rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .benefits-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .reviews-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .districts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .tips-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .recommendations-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Very Large Screens */
@media (min-width: 1600px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: 4.5rem;
    }
    
    .section-title {
        font-size: 3.5rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .benefits-list {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .reviews-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .districts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .tips-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .recommendations-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
