/* =====================================================
   Responsive CSS - Mobile-First Responsive Design
   ===================================================== */

/* Mobile First Approach - Base styles for mobile */

/* Extra Small Devices (phones, 576px and down) */
@media (max-width: 576px) {
    .container {
        padding: 0 15px;
    }
    
    /* Typography adjustments */
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* Navigation */
    .nav-container {
        padding: 0 15px;
    }
    
    .nav-menu {
        position: fixed;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 2rem;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
        transform: translateY(0);
        transition: transform 0.3s ease;
        gap: 1rem;
    }
    
    .nav-menu.active {
        transform: translateY(-100%);
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .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 Section */
    .hero {
        padding: 4rem 0;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-buttons {
        justify-content: center;
    }
    
    .hero-image {
        order: -1;
    }
    
    /* Sections */
    section {
        padding: 3rem 0;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-card {
        padding: 1.5rem;
    }
    
    /* About */
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Contact */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* Blog */
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .blog-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Article */
    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
    
    /* Forms */
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .newsletter-form .form-group {
        flex-direction: column;
    }
    
    /* Buttons */
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .hero-buttons .btn,
    .thank-you-actions .btn {
        width: auto;
        min-width: 150px;
    }
    
    /* Cookie Banner */
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .cookie-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Modal */
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header {
        padding: 1.5rem 1.5rem 0;
        margin-bottom: 1.5rem;
    }
    
    .modal-body {
        padding: 0 1.5rem;
    }
    
    .modal-footer {
        padding: 1.5rem;
        margin-top: 1.5rem;
    }
    
    /* Cookie Categories */
    .cookie-category {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    /* Legal Tables */
    .cookie-table table {
        font-size: 0.875rem;
    }
    
    .cookie-table th,
    .cookie-table td {
        padding: 0.75rem 0.5rem;
    }
    
    /* Process Flow */
    .process-flow {
        flex-direction: column;
        align-items: stretch;
    }
    
    .process-arrow {
        transform: rotate(90deg);
        align-self: center;
    }
    
    /* Cost Overview */
    .cost-overview {
        grid-template-columns: 1fr;
    }
    
    /* Document Items */
    .document-item {
        flex-direction: column;
        text-align: center;
    }
    
    .document-icon {
        align-self: center;
    }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .testimonials-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .cost-overview {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
    
    .countries-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .hero-content {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
    
    .about-content {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
    
    .contact-content {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .testimonials-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr;
        gap: 2rem;
    }
    
    .stats {
        flex-direction: row;
        justify-content: space-around;
    }
    
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .newsletter-form .form-group {
        flex-direction: row;
    }
    
    .cookie-content {
        flex-direction: row;
        align-items: center;
    }
    
    .cookie-buttons {
        flex-direction: row;
    }
    
    .change-comparison {
        grid-template-columns: 1fr 1fr;
    }
    
    .process-flow {
        flex-direction: row;
    }
    
    .process-arrow {
        transform: rotate(0deg);
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199px) {
    .hero h1 {
        font-size: 3rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .testimonials-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
    
    .blog-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
    
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
    
    .hero h1 {
        font-size: 3.5rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .testimonials-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .blog-grid {
        grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    }
    
    .countries-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .cost-overview {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Ultra Wide Screens (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-content {
        gap: 5rem;
    }
    
    .about-content {
        gap: 5rem;
    }
    
    .contact-content {
        gap: 5rem;
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .cookie-banner,
    .modal,
    .btn,
    .social-links,
    .nav-toggle {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: black;
        background: white;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        color: black;
    }
    
    .legal-content,
    .article-content {
        padding: 0;
    }
    
    .info-box,
    .warning-box,
    .error-box,
    .cta-box,
    .case-study {
        border: 1pt solid #ccc;
        background: white !important;
        color: black !important;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    .cookie-table table {
        border-collapse: collapse;
        width: 100%;
    }
    
    .cookie-table th,
    .cookie-table td {
        border: 1pt solid #ccc;
        padding: 8pt;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .btn-primary {
        background-color: #000;
        border-color: #000;
        color: #fff;
    }
    
    .btn-outline {
        border-color: #000;
        color: #000;
    }
    
    .service-card,
    .testimonial-card,
    .blog-card {
        border: 2px solid #000;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    select,
    textarea {
        border-color: #000;
    }
}

/* Reduced Motion */
@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;
    }
    
    .service-card:hover,
    .testimonial-card:hover,
    .blog-card:hover,
    .btn:hover {
        transform: none;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a202c;
        --bg-secondary: #2d3748;
        --text-primary: #f7fafc;
        --text-secondary: #e2e8f0;
        --border-color: #4a5568;
    }
    
    /* Only apply if user hasn't set a preference */
    @supports not (color-scheme: light dark) {
        body {
            background-color: var(--bg-primary);
            color: var(--text-primary);
        }
        
        .header {
            background-color: var(--bg-secondary);
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
        }
        
        .service-card,
        .testimonial-card,
        .blog-card,
        .modal-content {
            background-color: var(--bg-secondary);
            color: var(--text-primary);
        }
        
        input[type="text"],
        input[type="email"],
        input[type="tel"],
        select,
        textarea {
            background-color: var(--bg-secondary);
            border-color: var(--border-color);
            color: var(--text-primary);
        }
    }
}

/* Focus Styles for Accessibility */
@media (any-hover: none) {
    .btn:hover {
        transform: none;
        box-shadow: none;
    }
}

/* Touch Device Optimizations */
@media (any-pointer: coarse) {
    .btn {
        min-height: 44px;
        padding: 0.875rem 1.5rem;
    }
    
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    select,
    textarea {
        min-height: 44px;
        padding: 0.875rem 1rem;
    }
    
    .nav-menu a {
        padding: 1rem 0;
    }
    
    .close {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Landscape Orientation on Mobile */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 2rem 0;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    section {
        padding: 2rem 0;
    }
    
    .modal-content {
        max-height: 90vh;
    }
}

/* Very Small Screens */
@media (max-width: 320px) {
    .container {
        padding: 0 10px;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }
    
    .service-card,
    .testimonial-card {
        padding: 1rem;
    }
    
    .modal-content {
        width: 98%;
        margin: 0.5rem;
    }
    
    .cookie-table th,
    .cookie-table td {
        padding: 0.5rem 0.25rem;
        font-size: 0.75rem;
    }
}
