/* ===============================
   RESPONSIVE DESIGN
   Mobile-First Approach
   =============================== */

/* ===============================
   MOBILE STYLES (up to 768px)
   =============================== */
@media (max-width: 767px) {
    
    /* Typography adjustments */
    :root {
        --fs-6xl: 2.5rem;      /* 40px */
        --fs-5xl: 2rem;        /* 32px */
        --fs-4xl: 1.75rem;     /* 28px */
        --fs-3xl: 1.5rem;      /* 24px */
    }
    
    /* Container adjustments */
    .container {
        padding: 0 var(--space-sm);
    }
    
    /* Header & Navigation */
    .nav-wrapper {
        position: relative;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: 100px var(--space-lg) var(--space-lg);
        transition: var(--transition-normal);
        box-shadow: var(--shadow-lg);
        z-index: var(--z-modal);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-list {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-md);
        width: 100%;
        margin-bottom: var(--space-xl);
    }
    
    .nav-item {
        width: 100%;
    }
    
    .nav-link {
        padding: var(--space-sm) 0;
        font-size: var(--fs-lg);
        width: 100%;
        border-bottom: 1px solid var(--gray);
    }
    
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        padding-left: var(--space-lg);
        background: var(--light-gray);
        margin-top: var(--space-xs);
        border-radius: var(--radius-md);
    }
    
    .nav-cta {
        width: 100%;
    }
    
    .nav-cta .btn {
        width: 100%;
        justify-content: center;
    }
    
    .mobile-menu-toggle {
        display: flex;
        z-index: var(--z-popover);
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* Hero Carousel */
    .hero-carousel {
        height: 100vh;
        min-height: 500px;
        margin-top: 70px;
    }
    
    .carousel-content {
        padding: var(--space-lg);
    }
    
    .carousel-title {
        font-size: var(--fs-4xl);
        margin-bottom: var(--space-sm);
    }
    
    .carousel-subtitle {
        font-size: var(--fs-xl);
        margin-bottom: var(--space-md);
    }
    
    .carousel-description {
        font-size: var(--fs-base);
        margin-bottom: var(--space-lg);
    }
    
    .carousel-buttons {
        flex-direction: column;
        align-items: center;
        gap: var(--space-sm);
    }
    
    .carousel-buttons .btn {
        width: 100%;
        max-width: 280px;
    }
    
    .carousel-arrow {
        width: 40px;
        height: 40px;
        font-size: var(--fs-lg);
    }
    
    .carousel-arrow.prev {
        left: 15px;
    }
    
    .carousel-arrow.next {
        right: 15px;
    }
    
    .carousel-nav {
        bottom: 20px;
    }
    
    /* Sections */
    .section {
        padding: var(--space-xl) 0;
    }
    
    .section-header {
        margin-bottom: var(--space-xl);
    }
    
    .section-title {
        font-size: var(--fs-3xl);
    }
    
    /* Grid System */
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr;
    }
    
    /* Cards */
    .card-body {
        padding: var(--space-md);
    }
    
    .card-header {
        padding: var(--space-md);
    }
    
    .card-footer {
        padding: var(--space-md);
    }
    
    /* Buttons */
    .btn {
        padding: 12px 20px;
        width: 100%;
        max-width: 100%;
    }
    
    .btn-lg {
        padding: 14px 24px;
    }
    
    .carousel-buttons .btn,
    .hero-buttons .btn {
        max-width: 280px;
    }
    
    /* Footer */
    .footer {
        padding: var(--space-xl) 0 var(--space-md);
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
        margin-bottom: var(--space-lg);
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        gap: var(--space-sm);
    }
    
    .footer-bottom-links {
        justify-content: center;
    }
    
    /* Back to top */
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    /* Form adjustments */
    .form-input,
    .form-textarea,
    .form-select {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Service cards specific */
    .service-card {
        text-align: center;
    }
    
    .service-icon {
        margin: 0 auto var(--space-md);
    }
    
    /* Portfolio grid */
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    /* Stats section */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }
    
    .stat-item {
        text-align: center;
        padding: var(--space-md);
    }
    
    /* Testimonials */
    .testimonial-slider {
        padding: 0 var(--space-sm);
    }
    
    /* Team grid */
    .team-grid {
        grid-template-columns: 1fr;
        max-width: 350px;
        margin: 0 auto;
    }
    
    /* Blog grid */
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    /* Contact form */
    .contact-form-wrapper {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }
}

/* ===============================
   TABLET STYLES (768px - 1024px)
   =============================== */
@media (min-width: 768px) and (max-width: 1024px) {
    
    /* Navigation */
    .nav-list {
        gap: var(--space-md);
    }
    
    .nav-link {
        font-size: var(--fs-sm);
    }
    
    /* Hero adjustments */
    .carousel-title {
        font-size: var(--fs-5xl);
    }
    
    .carousel-buttons {
        flex-direction: row;
        justify-content: center;
    }
    
    /* Grid adjustments */
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Services grid */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Portfolio grid */
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Stats grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Team grid */
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Blog grid */
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Footer adjustments */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===============================
   DESKTOP STYLES (1025px+)
   =============================== */
@media (min-width: 1025px) {
    
    /* Container max-width adjustments */
    .container {
        max-width: 1200px;
    }
    
    /* Large screens get full grid layouts */
    .grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Services grid */
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Portfolio grid */
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Stats grid */
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    /* Team grid */
    .team-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Blog grid */
    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Contact form layout */
    .contact-form-wrapper {
        grid-template-columns: 2fr 1fr;
    }
}

/* ===============================
   EXTRA LARGE SCREENS (1440px+)
   =============================== */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }
    
    /* Larger typography for big screens */
    .section-title {
        font-size: var(--fs-5xl);
    }
    
    .carousel-title {
        font-size: 5rem;
    }
}

/* ===============================
   LANDSCAPE PHONE ADJUSTMENTS
   =============================== */
@media (max-width: 767px) and (orientation: landscape) {
    .hero-carousel {
        height: 100vh;
        min-height: 400px;
    }
    
    .carousel-content {
        padding: var(--space-md);
    }
    
    .carousel-title {
        font-size: var(--fs-3xl);
    }
    
    .carousel-subtitle {
        font-size: var(--fs-lg);
    }
}

/* ===============================
   HIGH DPI / RETINA DISPLAYS
   =============================== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Sharper shadows for retina displays */
    .card:hover {
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
    }
    
    .header.scrolled {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    }
}

/* ===============================
   PRINT STYLES
   =============================== */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    .header,
    .footer,
    .back-to-top,
    .carousel-arrow,
    .carousel-nav {
        display: none !important;
    }
    
    .hero-carousel {
        margin-top: 0;
        height: auto;
        min-height: auto;
    }
    
    .carousel-slide {
        position: static;
        opacity: 1;
        height: auto;
        background: none !important;
    }
    
    .carousel-overlay {
        position: static;
        background: none !important;
    }
    
    .carousel-content {
        color: black !important;
    }
    
    a, a:visited {
        text-decoration: underline;
    }
    
    .btn {
        border: 1px solid black !important;
        background: transparent !important;
        color: black !important;
    }
}

/* ===============================
   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;
    }
    
    .carousel-slide {
        transition: none;
    }
}

/* ===============================
   DARK MODE PREFERENCES
   =============================== */
@media (prefers-color-scheme: dark) {
    /* Optional dark mode styles can be added here */
    /* For now, we'll maintain the light theme */
}