/* Cyber Synthesis - Responsive Styles */
/* Mobile-First Responsive Design */

/* Large Desktop (1400px and up) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    h1 {
        font-size: 4rem;
    }
    
    .hero-container {
        gap: 6rem;
    }
    
    .services-grid,
    .portfolio-grid,
    .team-grid,
    .testimonials-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop (1200px to 1399px) */
@media (max-width: 1399px) {
    .container {
        max-width: 1140px;
    }
}

/* Large Tablet (992px to 1199px) */
@media (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
    
    .hero-container {
        gap: 3rem;
    }
    
    .contact-content {
        gap: 3rem;
    }
    
    .blog-content {
        gap: 3rem;
    }
}

/* Medium Tablet (768px to 991px) */
@media (max-width: 991px) {
    .container {
        max-width: 720px;
    }
    
    /* Navigation */
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }
    
    .nav-menu.active {
        display: flex;
    }
    
    .nav-menu li {
        margin: 0.5rem 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
    
    /* Hero Section */
    .hero-container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-visual {
        order: -1;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    /* Services Grid */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .service-card {
        padding: 2rem;
    }
    
    /* Portfolio Grid */
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    /* Team Grid */
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    /* Testimonials Grid */
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Contact Section */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Blog Layout */
    .blog-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .blog-card.featured {
        grid-template-columns: 1fr;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    /* Newsletter */
    .newsletter-form .form-group {
        flex-direction: column;
    }
    
    .newsletter-form input {
        margin-bottom: 1rem;
    }
}

/* Small Tablet (576px to 767px) */
@media (max-width: 767px) {
    .container {
        max-width: 540px;
    }
    
    /* Typography adjustments */
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    /* Hero Section */
    .hero {
        padding: 6rem 0 4rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
    
    /* Services Grid */
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    /* Portfolio Grid */
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    /* Team Grid */
    .team-grid {
        grid-template-columns: 1fr;
    }
    
    /* Contact Form */
    .contact-form {
        padding: 1.5rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-section .social-links {
        justify-content: center;
    }
    
    /* Cookie Banner */
    .cookie-buttons {
        flex-direction: column;
    }
    
    .cookie-buttons .btn {
        width: 100%;
    }
    
    /* Modal */
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    /* Article Page */
    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .article-navigation {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .share-buttons {
        flex-direction: column;
    }
    
    .thanks-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .thanks-actions .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* Mobile (up to 575px) */
@media (max-width: 575px) {
    .container {
        padding: 0 0.75rem;
    }
    
    /* Typography */
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.25rem;
    }
    
    .lead {
        font-size: 1.125rem;
    }
    
    /* Navigation */
    .nav-container {
        padding: 0 0.75rem;
    }
    
    .nav-logo img {
        height: 32px;
    }
    
    /* Hero Section */
    .hero {
        padding: 5rem 0 3rem;
    }
    
    .hero-container {
        gap: 1.5rem;
    }
    
    /* Sections padding */
    .services,
    .portfolio,
    .team,
    .testimonials,
    .contact {
        padding: 4rem 0;
    }
    
    .newsletter {
        padding: 4rem 0;
    }
    
    /* Cards padding */
    .service-card,
    .testimonial-card {
        padding: 1.5rem;
    }
    
    .team-member {
        padding: 1.5rem;
    }
    
    .contact-form {
        padding: 1rem;
    }
    
    /* Footer */
    .footer {
        padding: 3rem 0 1.5rem;
    }
    
    /* Blog */
    .blog-hero {
        padding: 6rem 0 3rem;
    }
    
    .blog-content {
        padding: 3rem 0;
    }
    
    .blog-card .blog-content {
        padding: 1.5rem;
    }
    
    .sidebar-section {
        padding: 1.5rem;
    }
    
    /* Article Page */
    .article-page {
        padding: 6rem 0 3rem;
    }
    
    .article-header {
        margin-bottom: 2rem;
    }
    
    .article-body {
        font-size: 1rem;
    }
    
    /* Legal Pages */
    .legal-page {
        padding: 6rem 0 3rem;
    }
    
    /* Thanks Page */
    .thanks-page {
        padding: 6rem 0 3rem;
    }
    
    .thanks-content {
        padding: 0 1rem;
    }
    
    .thanks-details {
        padding: 1.5rem;
    }
    
    /* Social Links */
    .social-link {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }
    
    /* Cookie Table */
    .cookie-table {
        font-size: 0.75rem;
    }
    
    .cookie-table th,
    .cookie-table td {
        padding: 0.5rem;
    }
}

/* Extra Small Mobile (up to 375px) */
@media (max-width: 375px) {
    /* Further reduce spacing for very small screens */
    .container {
        padding: 0 0.5rem;
    }
    
    .hero {
        padding: 4rem 0 2rem;
    }
    
    .services,
    .portfolio,
    .team,
    .testimonials,
    .contact,
    .newsletter {
        padding: 3rem 0;
    }
    
    .service-card,
    .testimonial-card,
    .team-member {
        padding: 1rem;
    }
    
    .blog-hero {
        padding: 5rem 0 2rem;
    }
    
    .article-page,
    .legal-page,
    .thanks-page {
        padding: 5rem 0 2rem;
    }
    
    /* Button adjustments */
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
    
    /* Form adjustments */
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Optimize for high-resolution displays */
    .nav-logo img,
    .hero-visual img,
    .service-icon img,
    .member-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Landscape Mobile Orientation */
@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        padding: 3rem 0 2rem;
    }
    
    .hero-container {
        grid-template-columns: 1fr 1fr;
        align-items: center;
    }
    
    .hero-visual {
        order: 1;
    }
    
    .modal-content {
        max-height: 90vh;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-light: #9ca3af;
        
        --bg-primary: #111827;
        --bg-secondary: #1f2937;
        --bg-dark: #0f172a;
        
        --border-color: #374151;
        --border-light: #4b5563;
    }
    
    .header {
        background: rgba(17, 24, 39, 0.95);
    }
    
    .hero {
        background: linear-gradient(135deg, var(--bg-secondary) 0%, #1e293b 100%);
    }
    
    .service-card,
    .portfolio-item,
    .team-member,
    .testimonial-card,
    .contact-form,
    .blog-card,
    .sidebar-section {
        background: var(--bg-secondary);
        border: 1px solid var(--border-color);
    }
}

/* Reduced Motion Preferences */
@media (prefers-reduced-motion: reduce) {
    .hero-container,
    .service-card,
    .portfolio-item,
    .team-member,
    .testimonial-card,
    .blog-card {
        animation: none;
    }
    
    .service-card:hover,
    .portfolio-item:hover,
    .team-member:hover,
    .testimonial-card:hover,
    .blog-card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
}

/* Print Responsive Adjustments */
@media print {
    .container {
        max-width: none;
        padding: 0;
    }
    
    .hero-container {
        grid-template-columns: 1fr;
    }
    
    .services-grid,
    .portfolio-grid,
    .team-grid,
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .contact-content,
    .blog-content {
        grid-template-columns: 1fr;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets for mobile devices */
    .btn {
        min-height: 48px;
        padding: 0.875rem 1.5rem;
    }
    
    .nav-menu a {
        padding: 1rem 0;
    }
    
    .social-links a {
        padding: 0.75rem;
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Remove hover effects on touch devices */
    .service-card:hover,
    .portfolio-item:hover,
    .team-member:hover,
    .testimonial-card:hover,
    .blog-card:hover {
        transform: none;
        box-shadow: var(--shadow-md);
    }
    
    .btn:hover {
        transform: none;
    }
}

/* Large Screen Optimizations */
@media (min-width: 1600px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-container {
        gap: 8rem;
    }
    
    .services,
    .portfolio,
    .team,
    .testimonials,
    .contact {
        padding: 8rem 0;
    }
    
    .newsletter {
        padding: 8rem 0;
    }
}

/* Accessibility - High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0000ff;
        --text-primary: #000000;
        --text-secondary: #000000;
        --bg-primary: #ffffff;
        --border-color: #000000;
    }
    
    .btn-primary {
        background: #0000ff;
        border: 2px solid #000000;
    }
    
    .btn-outline {
        border-width: 3px;
    }
    
    .service-card,
    .portfolio-item,
    .team-member,
    .testimonial-card {
        border: 2px solid #000000;
    }
}

/* Focus Management for Mobile */
@media (max-width: 767px) {
    /* Ensure focus indicators are visible on mobile */
    button:focus,
    input:focus,
    select:focus,
    textarea:focus,
    a:focus {
        outline-width: 3px;
        outline-offset: 3px;
    }
}
