/* ==========================================================================
   Responsive Stylesheet - Simplified Bytes
   Mobile-First Responsive Design for All Screen Sizes
   ========================================================================== */

/* Mobile First Base Styles Already Defined in main.css */

/* Small Tablets and Large Phones (768px and up) */
@media screen and (max-width: 1024px) {
    .container {
        padding: 0 var(--space-4);
    }
    
    .section {
        padding: var(--space-16) 0;
    }
    
    .section-title {
        font-size: var(--font-size-3xl);
    }
    
    .hero-stats {
        gap: var(--space-8);
    }
    
    .about-content {
        grid-template-columns: 1fr;
        gap: var(--space-12);
    }
    
    .about-visual {
        order: -1;
    }
    
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: var(--space-6);
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--space-12);
    }
    
    .contact-info {
        order: -1;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-8);
    }
    
    .footer-content .footer-section:first-child {
        grid-column: span 2;
    }
}

/* Tablets (768px and up) */
@media screen and (max-width: 768px) {
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: var(--white);
        flex-direction: column;
        align-items: flex-start;
        padding: var(--space-20) var(--space-6) var(--space-6);
        box-shadow: var(--shadow-xl);
        transition: right var(--transition-normal);
        z-index: var(--z-modal);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-link {
        padding: var(--space-3) 0;
        font-size: var(--font-size-lg);
        width: 100%;
        border-bottom: 1px solid var(--gray-100);
    }
    
    .nav-link.cta-btn {
        margin: var(--space-6) 0 0 0;
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    .nav-toggle {
        display: flex;
        z-index: var(--z-tooltip);
    }
    
    .nav-toggle.active .bar:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    
    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active .bar:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
    
    /* Hero Section */
    .hero-title {
        font-size: var(--font-size-4xl);
    }
    
    .hero-description {
        font-size: var(--font-size-lg);
        margin-bottom: var(--space-8);
    }
    
    .hero-cta {
        flex-direction: column;
        gap: var(--space-4);
        margin-bottom: var(--space-12);
    }
    
    .hero-stats {
        flex-wrap: wrap;
        gap: var(--space-6);
    }
    
    .stat-number {
        font-size: var(--font-size-3xl);
    }
    
    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    
    .service-card {
        padding: var(--space-6);
    }
    
    /* Portfolio */
    .portfolio-filters {
        gap: var(--space-2);
    }
    
    .filter-btn {
        padding: var(--space-2) var(--space-4);
        font-size: var(--font-size-xs);
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }
    
    /* Contact Form */
    .contact-form {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .form-group.full-width {
        grid-column: span 1;
    }
    
    .captcha-container {
        grid-column: span 1;
    }
    
    .submit-btn {
        grid-column: span 1;
        width: 100%;
    }
    
    .contact-form-container {
        padding: var(--space-6);
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }
    
    .footer-content .footer-section:first-child {
        grid-column: span 1;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }
    
    .footer-legal {
        justify-content: center;
    }
}

/* Large Phones (480px and up) */
@media screen and (max-width: 480px) {
    /* Base */
    .container {
        padding: 0 var(--space-3);
    }
    
    .section {
        padding: var(--space-12) 0;
    }
    
    .section-title {
        font-size: var(--font-size-2xl);
    }
    
    .section-description {
        font-size: var(--font-size-base);
    }
    
    /* Navigation */
    .nav-container {
        padding: var(--space-3) var(--space-3);
    }
    
    .nav-menu {
        width: 100%;
        right: -100%;
    }
    
    .logo-text,
    .logo-accent {
        font-size: var(--font-size-xl);
    }
    
    /* Hero */
    .hero-title {
        font-size: var(--font-size-3xl);
        margin-bottom: var(--space-4);
    }
    
    .hero-description {
        font-size: var(--font-size-base);
        margin-bottom: var(--space-6);
    }
    
    .hero-cta .btn {
        width: 100%;
        justify-content: center;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: var(--space-4);
        text-align: center;
    }
    
    /* About */
    .about-features {
        gap: var(--space-4);
    }
    
    .feature-item {
        flex-direction: column;
        text-align: center;
        gap: var(--space-2);
    }
    
    .about-visual {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .visual-card:nth-child(3) {
        grid-column: span 1;
    }
    
    .visual-card {
        padding: var(--space-6);
    }
    
    /* Services */
    .service-card {
        padding: var(--space-5);
    }
    
    .service-features {
        gap: var(--space-1);
    }
    
    .feature-tag {
        font-size: var(--font-size-xs);
        padding: 2px var(--space-2);
    }
    
    /* Portfolio */
    .portfolio-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-btn {
        text-align: center;
    }
    
    .portfolio-image {
        height: 250px;
    }
    
    .portfolio-tags {
        flex-direction: column;
        align-items: center;
    }
    
    /* Contact */
    .contact-info {
        gap: var(--space-6);
    }
    
    .info-item {
        flex-direction: column;
        text-align: center;
        gap: var(--space-2);
    }
    
    .social-links {
        justify-content: center;
    }
    
    /* Components */
    .modal-content {
        width: 95%;
        padding: var(--space-6);
    }
    
    .notification {
        left: var(--space-3);
        right: var(--space-3);
        max-width: none;
    }
    
    /* Form Elements */
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: var(--space-3);
        font-size: var(--font-size-sm);
    }
    
    .btn {
        padding: var(--space-3) var(--space-5);
        font-size: var(--font-size-sm);
    }
    
    .btn-small {
        padding: var(--space-2) var(--space-4);
        font-size: var(--font-size-xs);
    }
}

/* Small Phones (360px and up) */
@media screen and (max-width: 360px) {
    /* Base */
    .container {
        padding: 0 var(--space-2);
    }
    
    /* Navigation */
    .nav-container {
        padding: var(--space-3) var(--space-2);
    }
    
    /* Hero */
    .hero-title {
        font-size: var(--font-size-2xl);
        line-height: 1.2;
    }
    
    .hero-description {
        font-size: var(--font-size-sm);
    }
    
    .stat-number {
        font-size: var(--font-size-2xl);
    }
    
    .stat-label {
        font-size: var(--font-size-xs);
    }
    
    /* Buttons */
    .btn {
        padding: var(--space-3) var(--space-4);
        font-size: var(--font-size-xs);
    }
    
    /* Cards */
    .service-card,
    .visual-card,
    .portfolio-item {
        margin-bottom: var(--space-4);
    }
    
    .service-card {
        padding: var(--space-4);
    }
    
    .service-icon {
        width: 64px;
        height: 64px;
        margin-bottom: var(--space-4);
    }
    
    .service-icon i {
        font-size: var(--font-size-2xl);
    }
    
    /* Contact Form */
    .contact-form-container {
        padding: var(--space-4);
    }
    
    /* Footer */
    .footer {
        padding: var(--space-12) 0 var(--space-6);
    }
    
    .footer-social {
        justify-content: center;
        margin-bottom: var(--space-4);
    }
}

/* High DPI Displays */
@media screen and (min-resolution: 192dpi), screen and (min-resolution: 2dppx) {
    /* Optimize for high DPI displays */
    .hero-background,
    .gradient-overlay {
        background-image: 
            linear-gradient(135deg, rgba(102, 102, 255, 0.8) 0%, rgba(118, 75, 162, 0.8) 100%),
            radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    }
}

/* Landscape Phone Orientation */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: var(--space-8) 0;
    }
    
    .hero-title {
        font-size: var(--font-size-3xl);
        margin-bottom: var(--space-3);
    }
    
    .hero-description {
        font-size: var(--font-size-base);
        margin-bottom: var(--space-4);
    }
    
    .hero-cta {
        margin-bottom: var(--space-6);
    }
    
    .hero-stats {
        margin-top: var(--space-8);
    }
    
    .scroll-indicator {
        display: none;
    }
}

/* Print Styles */
@media print {
    /* Hide interactive elements */
    .nav-toggle,
    .hero-cta,
    .scroll-indicator,
    .portfolio-filters,
    .contact-form,
    .social-links,
    .modal,
    .notification {
        display: none !important;
    }
    
    /* Optimize for print */
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    .section {
        padding: 20pt 0;
        page-break-inside: avoid;
    }
    
    .hero {
        min-height: auto;
        padding: 40pt 0;
        background: #fff !important;
    }
    
    .hero-title,
    .section-title {
        color: #000 !important;
    }
    
    /* Ensure links are visible */
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }
    
    /* Page breaks */
    .section:nth-child(odd) {
        page-break-before: always;
    }
}

/* 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;
    }
    
    .floating-element {
        animation: none !important;
    }
    
    .scroll-indicator {
        animation: none !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --white: #1a1a1a;
        --gray-50: #0f0f0f;
        --gray-100: #1f1f1f;
        --gray-200: #2a2a2a;
        --gray-300: #3a3a3a;
        --gray-400: #6a6a6a;
        --gray-500: #8a8a8a;
        --gray-600: #a0a0a0;
        --gray-700: #c0c0c0;
        --gray-800: #e0e0e0;
        --gray-900: #ffffff;
        --black: #ffffff;
    }
    
    .navbar {
        background: rgba(26, 26, 26, 0.95);
        border-bottom-color: var(--gray-200);
    }
    
    .hero-background {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }
    
    .about-section {
        background: var(--gray-50);
    }
    
    .portfolio-section {
        background: var(--gray-50);
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0066ff;
        --primary-dark: #0052cc;
        --secondary-color: #ff0066;
        --accent-color: #00cc99;
    }
    
    .btn-outline {
        border-width: 3px;
    }
    
    .service-card,
    .visual-card,
    .portfolio-item {
        border-width: 2px;
        border-style: solid;
        border-color: var(--gray-400);
    }
    
    .nav-link:focus,
    .btn:focus,
    input:focus,
    select:focus,
    textarea:focus {
        outline: 3px solid var(--primary-color);
        outline-offset: 2px;
    }
}

/* Container Queries (Future-proofing) */
@supports (container-type: inline-size) {
    .services-grid {
        container-type: inline-size;
    }
    
    @container (max-width: 600px) {
        .service-card {
            padding: var(--space-4);
        }
        
        .service-features {
            flex-direction: column;
            align-items: center;
        }
    }
}

/* Large Screens (1400px and up) */
@media screen and (min-width: 1400px) {
    .container {
        max-width: 1400px;
    }
    
    .hero-title {
        font-size: 4.5rem;
    }
    
    .section-title {
        font-size: var(--font-size-5xl);
    }
    
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Ultra-wide Screens (1600px and up) */
@media screen and (min-width: 1600px) {
    .container {
        max-width: 1600px;
    }
    
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-10);
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
