/* ===================================
   Donewell Research - Responsive Styles
   ================================== */

/* Large Desktop (1400px and above) */
@media (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
}

/* Desktop (1200px to 1399px) - Default styles apply */

/* Tablet Landscape (992px to 1199px) */
@media (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .section-title {
        font-size: 2.2rem;
    }
    
    .mega-menu-large {
        min-width: 500px;
    }
    
    .services-grid,
    .insights-grid,
    .support-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

/* Tablet Portrait (768px to 991px) */
@media (max-width: 991px) {
    .container {
        max-width: 720px;
    }
    
    /* Header Adjustments */
    .header-top {
        font-size: 1rem;
        padding: 0.75rem 0;
    }
    
    .header-main {
        top: 42px;
    }
    
    .logo img {
        height: 50px;
    }
    
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 90px;
        left: -100%;
        width: 80%;
        max-width: 400px;
        height: calc(100vh - 90px);
        background-color: var(--secondary-color);
        flex-direction: column;
        padding: var(--spacing-lg);
        overflow-y: auto;
        transition: left var(--transition-normal);
        box-shadow: var(--shadow-xl);
        z-index: 1000;
        gap: 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .mobile-menu-toggle {
        display: flex;
        z-index: 1001;
    }
    
    .nav-item {
        width: 100%;
        border-bottom: 1px solid rgba(244, 167, 2, 0.2);
    }
    
    .nav-link {
        width: 100%;
        justify-content: space-between;
        padding: var(--spacing-md);
    }
    
    .mega-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border-radius: 0;
        border-top: none;
        border-left: 3px solid var(--primary-color);
        margin-left: var(--spacing-md);
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition-normal);
    }
    
    .nav-item.active .mega-menu {
        max-height: 1000px;
    }
    
    .mega-menu-content {
        grid-template-columns: 1fr;
    }
    
    .mega-menu-large {
        min-width: auto;
    }
    
    /* Hero Section */
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.5rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .hero-cta {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-cta a {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }
    
    /* Carousel */
    .carousel-container {
        padding: 0 50px;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
    }
    
    .carousel-slide img {
        height: 400px;
    }
    
    /* Values Grid */
    .values-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* Mobile Landscape (576px to 767px) */
@media (max-width: 767px) {
    .container {
        max-width: 540px;
        padding: 0 var(--spacing-sm);
    }
    
    /* Typography */
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    /* Header */
    .header-top {
        font-size: 0.9rem;
        padding: 0.5rem 0;
    }
    
    .header-main {
        top: 36px;
        padding: 0.5rem 0;
    }
    
    .logo img {
        height: 40px;
    }
    
    .nav-menu {
        width: 90%;
        top: 76px;
        height: calc(100vh - 76px);
    }
    
    /* Hero Section */
    .hero-section {
        min-height: 80vh;
        padding: var(--spacing-lg) var(--spacing-sm);
    }
    
    .newsletter-box {
        padding: var(--spacing-md);
        margin-top: var(--spacing-lg);
    }
    
    .newsletter-form {
        flex-direction: column;
    }
    
    .newsletter-form input,
    .newsletter-form button {
        width: 100%;
    }
    
    /* Carousel */
    .carousel-container {
        padding: 0 40px;
    }
    
    .carousel-btn {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .carousel-slide img {
        height: 300px;
    }
    
    /* About Section */
    .about-subsection {
        padding: var(--spacing-md);
    }
    
    .values-grid {
        grid-template-columns: 1fr;
    }
    
    .disciplines-list {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .operation-cards {
        grid-template-columns: 1fr;
    }
    
    /* Services */
    .services-grid,
    .insights-grid,
    .support-grid {
        grid-template-columns: 1fr;
    }
    
    .service-card,
    .insight-card,
    .support-card {
        padding: var(--spacing-md);
    }
    
    /* Pricing */
    .pricing-content {
        grid-template-columns: 1fr;
    }
    
    .payment-options {
        grid-template-columns: 1fr;
    }
    
    /* Footer */
    .footer {
        padding: var(--spacing-lg) 0 var(--spacing-sm);
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    .footer-logo img {
        height: 60px;
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* Modal */
    .modal-content {
        padding: var(--spacing-md);
        max-width: 95%;
    }
    
    /* Cookie Consent */
    .cookie-consent {
        padding: var(--spacing-sm);
    }
    
    .cookie-buttons {
        flex-direction: column;
    }
    
    .cookie-buttons button {
        width: 100%;
    }
}

/* Mobile Portrait (up to 575px) */
@media (max-width: 575px) {
    :root {
        --font-size-base: 14px;
    }
    
    .container {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    /* Typography */
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-subtitle {
        font-size: 0.95rem;
    }
    
    /* Header */
    .header-top {
        font-size: 0.85rem;
    }
    
    .welcome-text {
        padding: 0 0.5rem;
    }
    
    .logo img {
        height: 35px;
    }
    
    .nav-menu {
        width: 100%;
        max-width: none;
    }
    
    /* Hero */
    .hero-section {
        min-height: 70vh;
        padding: var(--spacing-md) var(--spacing-sm);
    }
    
    .hero-description {
        font-size: 0.95rem;
    }
    
    .newsletter-box h3 {
        font-size: 1.2rem;
    }
    
    /* Buttons */
    .btn-primary,
    .btn-secondary,
    .btn-cta {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    /* Carousel */
    .carousel-container {
        padding: 0 35px;
    }
    
    .carousel-btn {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
    
    .carousel-slide img {
        height: 250px;
    }
    
    .carousel-caption {
        padding: var(--spacing-sm);
    }
    
    /* Cards */
    .value-card,
    .operation-card,
    .service-card,
    .insight-card,
    .support-card {
        padding: var(--spacing-sm);
    }
    
    .value-card i,
    .operation-card i,
    .support-card i {
        font-size: 2.5rem;
    }
    
    .service-icon,
    .insight-icon {
        width: 60px;
        height: 60px;
    }
    
    .service-icon i,
    .insight-icon i {
        font-size: 2rem;
    }
    
    /* Marquee */
    .marquee-content img {
        height: 100px;
    }
    
    /* Forms */
    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    /* Footer */
    .footer-logo img {
        height: 50px;
    }
    
    .footer-column h4 {
        font-size: 1.1rem;
    }
    
    .social-links a {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    /* Modal */
    .modal {
        padding: var(--spacing-sm);
    }
    
    .modal-content {
        padding: var(--spacing-sm);
    }
    
    .modal-content h2 {
        font-size: 1.3rem;
    }
    
    .modal-close {
        width: 35px;
        height: 35px;
        font-size: 1.5rem;
    }
}

/* Extra Small Devices (up to 375px) */
@media (max-width: 375px) {
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .carousel-slide img {
        height: 200px;
    }
    
    .disciplines-list {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    .header-top,
    .header-main,
    .mobile-menu-toggle,
    .cookie-consent,
    .newsletter-box,
    .footer-newsletter,
    .social-links,
    .btn-primary,
    .btn-secondary,
    .btn-cta,
    .scroll-to-top {
        display: none !important;
    }
    
    body {
        background-color: white;
        color: black;
    }
    
    .hero-section {
        background: white;
        min-height: auto;
    }
    
    .hero-overlay {
        display: none;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    .section-title {
        page-break-after: avoid;
    }
    
    .service-card,
    .insight-card,
    .support-card {
        page-break-inside: avoid;
    }
}

/* Landscape Orientation */
@media (orientation: landscape) and (max-height: 500px) {
    .hero-section {
        min-height: auto;
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    .nav-menu {
        height: calc(100vh - 60px);
    }
}

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

/* 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;
    }
    
    .marquee-content {
        animation: none;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    /* Keep the branded colors but adjust for better readability in dark mode if needed */
    /* This is optional and can be customized based on user preference */
}

/* Accessibility - Focus Visible */
@media (prefers-reduced-motion: no-preference) {
    :focus-visible {
        outline: 3px solid var(--primary-color);
        outline-offset: 2px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .nav-link,
    .btn-primary,
    .btn-secondary,
    .btn-cta,
    .carousel-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .mega-menu-column a {
        padding: var(--spacing-sm) var(--spacing-md);
    }
}