/* ==========================================================================
   Responsive Design for Intell-Sensee Website
   Mobile-first approach with progressive enhancement
   ========================================================================== */

/* ==========================================================================
   Base Mobile Styles (default - 320px and up)
   ========================================================================== */

/* Already defined in main CSS - this is our baseline */

/* ==========================================================================
   Small Mobile (480px and up)
   ========================================================================== */

@media screen and (min-width: 480px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .hero-buttons {
        flex-direction: row;
        justify-content: flex-start;
    }
    
    .hero-stats {
        justify-content: flex-start;
    }
    
    .cookie-buttons {
        flex-direction: row;
    }
    
    .cta-buttons {
        flex-direction: row;
    }
    
    .urgent-details {
        flex-direction: row;
    }
}

/* ==========================================================================
   Tablet Portrait (768px and up)
   ========================================================================== */

@media screen and (min-width: 768px) {
    .container {
        padding: 0 2rem;
    }
    
    /* Navigation */
    .nav-toggle {
        display: none;
    }
    
    .nav-menu {
        display: flex !important;
    }
    
    /* Hero Section */
    .hero-content {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
    
    .hero-text h1 {
        font-size: 3rem;
    }
    
    /* Company Info */
    .company-grid {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    /* Process */
    .process-steps {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .step::after {
        display: block;
    }
    
    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Contact Form */
    .contact-content {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
    
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Contact Page */
    .contact-grid {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
    
    .steps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .resources-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
    
    /* Cookie Banner */
    .cookie-content {
        flex-direction: row;
        align-items: center;
    }
    
    .cookie-buttons {
        flex-shrink: 0;
    }
    
    /* Legal Pages */
    .rights-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-legal {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .browser-instructions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

/* ==========================================================================
   Tablet Landscape / Small Desktop (1024px and up)
   ========================================================================== */

@media screen and (min-width: 1024px) {
    /* Typography adjustments */
    h1 {
        font-size: 3.5rem;
    }
    
    h2 {
        font-size: 2.75rem;
    }
    
    /* Hero Section */
    .hero {
        padding: 140px 0 100px;
    }
    
    .hero-content {
        gap: 4rem;
    }
    
    .hero-text h1 {
        font-size: 3.5rem;
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Process */
    .process-steps {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Testimonials */
    .testimonials-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Contact Form */
    .contact-content {
        gap: 4rem;
    }
    
    /* Contact Page */
    .contact-grid {
        gap: 4rem;
    }
    
    .additional-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .steps-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .resources-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Trust indicators */
    .trust-indicators {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Legal Pages */
    .rights-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .rights-cookies {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .contact-legal {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .browser-instructions {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================================================
   Large Desktop (1200px and up)
   ========================================================================== */

@media screen and (min-width: 1200px) {
    .container {
        max-width: 1200px;
    }
    
    /* Hero adjustments for larger screens */
    .hero-text h1 {
        font-size: 4rem;
    }
    
    .hero-description {
        font-size: 1.375rem;
    }
    
    /* Large grid adjustments */
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
    
    .testimonials-grid {
        gap: 2.5rem;
    }
    
    /* Cookie modal larger screens */
    .cookie-modal-content {
        max-width: 700px;
    }
}

/* ==========================================================================
   Extra Large Desktop (1400px and up)
   ========================================================================== */

@media screen and (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-text h1 {
        font-size: 4.5rem;
    }
    
    .section-header h2 {
        font-size: 3rem;
    }
}

/* ==========================================================================
   Mobile-specific overrides (max-width: 767px)
   ========================================================================== */

@media screen and (max-width: 767px) {
    /* Hide desktop navigation, show mobile toggle */
    .nav-menu {
        position: fixed;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: #ffffff;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
        padding: 2rem 0;
    }
    
    .nav-menu.active {
        transform: translateX(0);
    }
    
    .nav-list {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .nav-list li {
        margin: 0;
        width: 100%;
        text-align: center;
    }
    
    .nav-link {
        display: block;
        padding: 1rem;
        width: 100%;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-toggle.active .bar:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active .bar:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Hero section mobile */
    .hero {
        padding: 100px 0 60px;
        text-align: center;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-text h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-description {
        font-size: 1.125rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
    }
    
    .hero-image {
        order: -1;
    }
    
    /* Company info mobile */
    .company-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .company-image {
        order: -1;
    }
    
    /* Services mobile */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-card.featured {
        transform: none;
    }
    
    .service-card.featured:hover {
        transform: translateY(-8px);
    }
    
    /* Process mobile */
    .process-steps {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .step::after {
        display: none;
    }
    
    /* Testimonials mobile */
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Contact form mobile */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .contact-form {
        padding: 2rem 1.5rem;
    }
    
    /* Contact page mobile */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-form-container {
        padding: 1.5rem;
    }
    
    .contact-form-detailed {
        padding: 1.5rem;
    }
    
    .additional-grid {
        grid-template-columns: 1fr;
    }
    
    /* Thank you page mobile */
    .steps-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .resources-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .trust-indicators {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .guarantees {
        flex-direction: column;
        gap: 1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .urgent-details {
        flex-direction: column;
        gap: 1rem;
    }
    
    /* Footer mobile */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* Cookie banner mobile */
    .cookie-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .cookie-buttons {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }
    
    .cookie-buttons .btn {
        width: 100%;
    }
    
    /* Cookie modal mobile */
    .cookie-modal {
        padding: 1rem;
    }
    
    .cookie-modal-content {
        max-height: 90vh;
    }
    
    .cookie-modal-header,
    .cookie-modal-body,
    .cookie-modal-footer {
        padding: 1rem;
    }
    
    .cookie-category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    /* Legal pages mobile */
    .rights-grid {
        grid-template-columns: 1fr;
    }
    
    .rights-cookies {
        grid-template-columns: 1fr;
    }
    
    .contact-legal {
        grid-template-columns: 1fr;
    }
    
    .browser-instructions {
        display: block;
    }
    
    .cookie-table {
        font-size: 0.875rem;
    }
    
    .cookie-table th,
    .cookie-table td {
        padding: 0.5rem;
    }
    
    /* Typography mobile */
    h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    .section-subtitle {
        font-size: 1.125rem;
    }
    
    /* Spacing adjustments mobile */
    section {
        padding: 60px 0;
    }
    
    .section-header {
        margin-bottom: 3rem;
    }
    
    /* Button adjustments mobile */
    .btn-large {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        width: 100%;
        justify-content: center;
    }
    
    /* Form adjustments mobile */
    .form-section h3 {
        font-size: 1.25rem;
    }
    
    .form-actions {
        text-align: stretch;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* ==========================================================================
   Small Mobile Specific (max-width: 479px)
   ========================================================================== */

@media screen and (max-width: 479px) {
    .container {
        padding: 0 1rem;
    }
    
    /* Typography even smaller */
    .hero-text h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    /* Compact spacing */
    .hero {
        padding: 80px 0 40px;
    }
    
    section {
        padding: 40px 0;
    }
    
    .section-header {
        margin-bottom: 2rem;
    }
    
    /* Cards more compact */
    .service-card,
    .testimonial-card {
        padding: 1.5rem 1rem;
    }
    
    .contact-form {
        padding: 1.5rem 1rem;
    }
    
    /* Trust indicators stack */
    .trust-indicators {
        grid-template-columns: 1fr;
    }
    
    /* Stats mobile stack */
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 1.75rem;
    }
    
    /* Cookie banner more compact */
    .cookie-banner {
        padding: 1rem;
    }
    
    .cookie-text h3 {
        font-size: 1.125rem;
        margin-bottom: 0.25rem;
    }
    
    .cookie-text p {
        font-size: 0.8125rem;
    }
    
    /* Modal padding */
    .next-steps,
    .additional-resources,
    .cta-section,
    .social-proof {
        padding: 2rem 1rem;
    }
}

/* ==========================================================================
   Landscape Mobile (height-specific adjustments)
   ========================================================================== */

@media screen and (max-height: 500px) and (orientation: landscape) {
    .hero {
        padding: 80px 0 40px;
    }
    
    .hero-text h1 {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .hero-buttons {
        margin-bottom: 1.5rem;
    }
    
    .hero-stats {
        gap: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   High DPI / Retina Displays
   ========================================================================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure crisp rendering on high DPI displays */
    .logo,
    .footer-logo {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
    
    /* Adjust thin borders for better visibility */
    .service-card,
    .testimonial-card,
    .contact-form,
    .faq-item {
        border-width: 0.5px;
    }
}

/* ==========================================================================
   Print Responsive Adjustments
   ========================================================================== */

@media print {
    .container {
        max-width: none;
        padding: 0;
    }
    
    .hero-content,
    .company-grid,
    .contact-content,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .services-grid,
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .process-steps {
        grid-template-columns: 1fr;
    }
    
    .step::after {
        display: none;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* ==========================================================================
   Accessibility Enhancements
   ========================================================================== */

/* Focus states for keyboard navigation */
@media (hover: none) and (pointer: coarse) {
    /* Touch device adjustments */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .faq-question {
        min-height: 60px;
    }
    
    .toggle-switch {
        min-width: 60px;
        min-height: 34px;
    }
    
    .checkbox-label {
        min-height: 44px;
        align-items: center;
    }
}

/* 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::before {
        animation: none;
    }
    
    .btn:hover {
        transform: none;
    }
    
    .service-card:hover,
    .testimonial-card:hover {
        transform: none;
    }
}

/* Dark mode considerations for future implementation */
@media (prefers-color-scheme: dark) {
    /* Currently maintaining light theme as requested */
    /* This section reserved for future dark mode implementation */
}

/* ==========================================================================
   Container Queries (for modern browsers)
   ========================================================================== */

@supports (container-type: inline-size) {
    .service-card {
        container-type: inline-size;
    }
    
    @container (max-width: 300px) {
        .service-card .service-features {
            font-size: 0.875rem;
        }
    }
    
    .testimonial-card {
        container-type: inline-size;
    }
    
    @container (max-width: 280px) {
        .testimonial-text {
            font-size: 0.875rem;
        }
    }
}

/* ==========================================================================
   Fallbacks for older browsers
   ========================================================================== */

/* CSS Grid fallbacks */
@supports not (display: grid) {
    .hero-content,
    .company-grid,
    .services-grid,
    .process-steps,
    .testimonials-grid,
    .contact-content,
    .contact-grid {
        display: flex;
        flex-wrap: wrap;
        gap: 2rem;
    }
    
    .hero-content > *,
    .company-grid > *,
    .contact-content > *,
    .contact-grid > * {
        flex: 1;
        min-width: 300px;
    }
    
    .services-grid > *,
    .testimonials-grid > * {
        flex: 1;
        min-width: 280px;
        max-width: 400px;
    }
    
    .process-steps > * {
        flex: 1;
        min-width: 200px;
    }
}

/* Flexbox fallbacks */
@supports not (display: flex) {
    .hero-content,
    .company-grid,
    .contact-content {
        display: block;
    }
    
    .hero-content > *,
    .company-grid > *,
    .contact-content > * {
        width: 100%;
        margin-bottom: 2rem;
    }
    
    .hero-buttons,
    .hero-stats,
    .cookie-buttons {
        display: block;
    }
    
    .hero-buttons > *,
    .cookie-buttons > * {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .nav-list {
        display: block;
    }
    
    .nav-list li {
        display: block;
        margin-bottom: 0.5rem;
    }
}
