/* ===== RESPONSIVE DESIGN ===== */

/* Mobile First Approach */
/* Base styles are for mobile (320px+) */

/* ===== MOBILE STYLES (320px - 767px) ===== */
@media (max-width: 767px) {
    /* Typography */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    /* Container */
    .container {
        padding: 0 1rem;
    }
    
    /* Navbar */
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 2rem;
        transition: var(--transition);
        z-index: 999;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu .nav-link {
        font-size: 1.125rem;
        padding: 1rem 0;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    .nav-cta {
        margin-top: 1rem;
        width: 100%;
        justify-content: center;
    }
    
    .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 */
    .hero {
        min-height: 100vh;
        padding: 2rem 0;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    /* About Section */
    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    /* Services Section */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-card {
        padding: 1.5rem;
    }
    
    /* Why Choose Us */
    .why-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .testimonial-slider {
        padding: 1.5rem;
    }
    
    .testimonial-controls {
        justify-content: center;
    }
    
    /* Services Detail */
    .service-detail-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .service-detail-icon {
        font-size: 2.5rem;
    }
    
    .service-detail-title h2 {
        font-size: 1.5rem;
    }
    
    .service-detail-body {
        padding: 1.5rem;
    }
    
    .tech-tags {
        justify-content: center;
    }
    
    /* Process Timeline */
    .process-timeline {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .process-step:not(:last-child)::after {
        display: none;
    }
    
    /* AI Services */
    .ai-services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Tech Stack */
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .tech-item {
        padding: 1.5rem;
    }
    
    .tech-icon {
        font-size: 2rem;
    }
    
    /* Success Cases */
    .cases-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Blog */
    .blog-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .blog-posts {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .blog-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .blog-search {
        width: 100%;
    }
    
    .search-input-group {
        width: 100%;
    }
    
    .search-input-group input {
        width: 100%;
    }
    
    .blog-filters {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .filter-btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    /* Portfolio */
    .filter-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .filter-btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
    }
    
    .projects-masonry {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Contact */
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-details {
        margin-bottom: 2rem;
    }
    
    .contact-item {
        margin-bottom: 1.5rem;
    }
    
    .contact-social {
        margin-top: 2rem;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .contact-form {
        padding: 1.5rem;
    }
    
    .form-group {
        margin-bottom: 1.5rem;
    }
    
    .form-actions {
        text-align: center;
    }
    
    .contact-ctas {
        margin-top: 3rem;
    }
    
    .cta-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .cta-card {
        text-align: center;
        padding: 1.5rem;
    }
    
    .map-info {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .faq-list {
        margin-top: 2rem;
    }
    
    .faq-question {
        padding: 1rem;
    }
    
    .faq-question h3 {
        font-size: 1.125rem;
    }
    
    .faq-answer {
        padding: 0 1rem 1rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .footer-bottom-links {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    /* Newsletter */
    .newsletter-content {
        flex-direction: column;
        text-align: center;
    }
    
    .newsletter-form {
        width: 100%;
    }
    
    .newsletter-input-group {
        width: 100%;
        flex-direction: column;
    }
    
    .newsletter-input-group input {
        min-width: auto;
        width: 100%;
    }
    
    .newsletter-input-group button {
        width: 100%;
    }
    
    /* CTA Sections */
    .cta-title {
        font-size: 1.75rem;
    }
    
    .cta-subtitle {
        font-size: 1rem;
    }
    
    /* Modal */
    .modal-content {
        margin: 1rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
    
    .modal-body {
        flex-direction: column;
    }
    
    .modal-gallery {
        margin-bottom: 2rem;
    }
    
    .gallery-thumbnails {
        justify-content: center;
    }
}

/* ===== TABLET STYLES (768px - 1023px) ===== */
@media (min-width: 768px) and (max-width: 1023px) {
    /* Typography */
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.75rem; }
    
    .hero-title {
        font-size: 3rem;
    }
    
    .page-title {
        font-size: 2.5rem;
    }
    
    /* Navbar */
    .nav-menu {
        gap: 1.5rem;
    }
    
    .nav-link {
        font-size: 0.875rem;
    }
    
    /* About Section */
    .about-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    /* Services Section */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    /* Why Choose Us */
    .why-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    /* Services Detail */
    .service-detail-header {
        flex-direction: row;
        text-align: left;
    }
    
    /* Process Timeline */
    .process-timeline {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    .process-step:nth-child(3n)::after {
        display: none;
    }
    
    /* AI Services */
    .ai-services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    /* Tech Stack */
    .tech-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
    
    /* Success Cases */
    .cases-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    /* Blog */
    .blog-layout {
        grid-template-columns: 1fr 300px;
        gap: 2rem;
    }
    
    .blog-posts {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .blog-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Portfolio */
    .filter-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .projects-masonry {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    /* Contact */
    .contact-layout {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
    
    .contact-ctas {
        margin-top: 3rem;
    }
    
    .cta-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .map-info {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    /* Newsletter */
    .newsletter-content {
        flex-direction: row;
        text-align: left;
    }
    
    .newsletter-form {
        flex: 1;
    }
    
    .newsletter-input-group {
        flex-direction: row;
    }
    
    .newsletter-input-group input {
        min-width: 200px;
    }
}

/* ===== DESKTOP STYLES (1024px+) ===== */
@media (min-width: 1024px) {
    /* Typography */
    h1 { font-size: 3rem; }
    h2 { font-size: 2.5rem; }
    h3 { font-size: 2rem; }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .page-title {
        font-size: 3rem;
    }
    
    /* Navbar */
    .nav-toggle {
        display: none;
    }
    
    .nav-menu {
        display: flex;
        position: static;
        background: none;
        backdrop-filter: none;
        border: none;
        padding: 0;
        height: auto;
        width: auto;
    }
    
    /* About Section */
    .about-content {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    /* Services Section */
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    /* Why Choose Us */
    .why-content {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }
    
    /* Services Detail */
    .service-detail-header {
        flex-direction: row;
        text-align: left;
    }
    
    /* Process Timeline */
    .process-timeline {
        grid-template-columns: repeat(5, 1fr);
        gap: 2rem;
    }
    
    .process-step:not(:last-child)::after {
        display: block;
    }
    
    /* AI Services */
    .ai-services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    /* Tech Stack */
    .tech-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 2rem;
    }
    
    /* Success Cases */
    .cases-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    /* Blog */
    .blog-layout {
        grid-template-columns: 1fr 300px;
        gap: 3rem;
    }
    
    .blog-posts {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .blog-filters {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Portfolio */
    .filter-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .projects-masonry {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    /* Contact */
    .contact-layout {
        grid-template-columns: 1fr 1fr;
        gap: 4rem;
    }
    
    .contact-ctas {
        margin-top: 4rem;
    }
    
    .cta-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    .map-info {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
    
    /* Newsletter */
    .newsletter-content {
        flex-direction: row;
        text-align: left;
    }
    
    .newsletter-form {
        flex: 1;
    }
    
    .newsletter-input-group {
        flex-direction: row;
    }
    
    .newsletter-input-group input {
        min-width: 250px;
    }
}

/* ===== LARGE DESKTOP STYLES (1440px+) ===== */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }
    
    /* Services Section */
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
    
    /* AI Services */
    .ai-services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
    
    /* Tech Stack */
    .tech-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 2.5rem;
    }
    
    /* Success Cases */
    .cases-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 2.5rem;
    }
    
    /* Blog */
    .blog-posts {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
    
    /* Portfolio */
    .projects-masonry {
        grid-template-columns: repeat(4, 1fr);
        gap: 2.5rem;
    }
    
    /* Contact */
    .cta-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
}

/* ===== LANDSCAPE ORIENTATION ===== */
@media (orientation: landscape) and (max-height: 500px) {
    .hero {
        min-height: auto;
        padding: 4rem 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .page-hero {
        padding: 6rem 0 3rem;
    }
}

/* ===== HIGH DPI DISPLAYS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-particles {
        background-size: 50px 50px;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .navbar,
    .hero-scroll,
    .cta-section,
    .footer {
        display: none;
    }
    
    .hero {
        min-height: auto;
        padding: 2rem 0;
    }
    
    .section-title,
    .page-title {
        color: #000 !important;
    }
    
    .btn {
        display: none;
    }
    
    a {
        color: #000 !important;
        text-decoration: underline;
    }
    
    .service-card,
    .ai-service-card,
    .case-card,
    .blog-post {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}

/* ===== ACCESSIBILITY ===== */
@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;
    }
}

@media (prefers-contrast: high) {
    :root {
        --primary: #0000ff;
        --secondary: #800080;
        --accent: #ff0080;
        --dark: #000000;
        --light: #ffffff;
        --gray: #333333;
    }
    
    .btn-primary {
        background: #0000ff;
        color: #ffffff;
    }
    
    .btn-secondary {
        background: #ffffff;
        color: #000000;
        border: 2px solid #000000;
    }
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --dark: #f8fafc;
        --light: #0f172a;
        --gray: #94a3b8;
    }
    
    body {
        background: #0f172a;
        color: #f8fafc;
    }
    
    .navbar {
        background: rgba(15, 23, 42, 0.1);
    }
    
    .navbar.scrolled {
        background: rgba(15, 23, 42, 0.95);
    }
    
    .service-card,
    .ai-service-card,
    .case-card,
    .blog-post,
    .stat-card {
        background: rgba(15, 23, 42, 0.1);
        border: 1px solid rgba(248, 250, 252, 0.1);
    }
    
    .footer {
        background: #020617;
    }
}
