/**
 * Responsive styles for Nebulytic website
 * Enhances the cosmic theme across all device sizes
 */

/* Base responsive adjustments */
@media (max-width: 1200px) {
    .container {
        width: 95%;
        max-width: 1140px;
    }
    
    .service-content {
        gap: 2rem;
    }
}

@media (max-width: 992px) {
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .service-content {
        flex-direction: column;
    }
    
    .service-text, .service-gallery {
        width: 100%;
    }
    
    .service-gallery {
        order: -1; /* Show gallery first on mobile */
    }
    
    .pricing {
        flex-direction: column;
        align-items: center;
    }
    
    .price-card {
        width: 100%;
        max-width: 350px;
        margin-bottom: 1.5rem;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        margin-top: 2rem;
        justify-content: center;
    }
    
    .footer-column {
        margin-bottom: 1.5rem;
    }
}

/* Tablet adjustments */
@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(10, 10, 20, 0.95);
        backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 2rem;
        transition: left 0.3s ease;
        z-index: 100;
    }
    
    .nav-links.active {
        left: 0;
    }
    
    .nav-links li {
        margin: 1rem 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    .hero-content {
        text-align: center;
        padding: 3rem 1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-buttons .btn-primary,
    .hero-buttons .btn-secondary {
        margin: 0.5rem 0;
        width: 80%;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-content {
        flex-direction: column;
    }
    
    .contact-form-container,
    .contact-info {
        width: 100%;
    }
    
    .contact-info {
        margin-top: 2rem;
    }
    
    /* Gallery adjustments */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        width: 90%;
    }
    
    /* Cosmic background adjustments */
    .cosmic-background {
        opacity: 0.4; /* Reduce opacity on mobile for better text readability */
    }
    
    /* Reduce star count on mobile for performance */
    .star.small:nth-child(odd) {
        display: none;
    }
}

/* Mobile adjustments */
@media (max-width: 576px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    .logo span {
        font-size: 1.5rem;
    }
    
    .service-features {
        padding-left: 1rem;
    }
    
    .service-features li {
        margin-bottom: 0.75rem;
    }
    
    .robot-models {
        flex-direction: column;
    }
    
    .robot-model {
        width: 100%;
        margin-bottom: 1.5rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        width: 100%;
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .footer-links {
        flex-direction: column;
    }
    
    .footer-column {
        width: 100%;
        text-align: center;
    }
    
    /* Modal adjustments */
    .modal-content {
        padding: 1rem;
    }
    
    .modal-nav-btn {
        width: 35px;
        height: 35px;
    }
    
    /* Enhance touch targets for mobile */
    button, 
    .btn-primary,
    .btn-secondary,
    .nav-links li a {
        padding: 0.75rem 1.25rem;
    }
    
    /* Adjust nebula text effect for better mobile performance */
    .nebula-text {
        background-size: 200% auto;
        animation: nebula-text-animation 8s linear infinite; /* Slower animation on mobile */
    }
}

/* Landscape orientation adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .nav-links {
        padding-top: 1rem;
        overflow-y: auto;
    }
    
    .nav-links li {
        margin: 0.5rem 0;
    }
    
    .hero {
        min-height: auto;
        padding: 2rem 0;
    }
}

/* High resolution displays */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    h1 {
        font-size: 3.5rem;
    }
    
    h2 {
        font-size: 2.75rem;
    }
    
    .service-content {
        gap: 4rem;
    }
    
    /* Enhance cosmic effects on large screens */
    .cosmic-background {
        background-size: 200% 200%;
    }
    
    .star.large {
        width: 4px;
        height: 4px;
    }
    
    .shooting-star {
        height: 3px;
    }
}

/* Dark mode preferences */
@media (prefers-color-scheme: dark) {
    .cosmic-background {
        opacity: 0.7; /* Slightly increase opacity in dark mode */
    }
    
    .modal-close {
        color: rgba(255, 255, 255, 0.9);
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .cosmic-background,
    .star,
    .shooting-star,
    .nebula-text,
    .btn-primary,
    .btn-secondary,
    .service-card,
    .price-card,
    .gallery-item {
        animation: none !important;
        transition: opacity 0.3s ease !important;
    }
}

/* Print styles */
@media print {
    .cosmic-background,
    .stars,
    .nav-links,
    .hamburger,
    .hero-buttons,
    .footer {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .container {
        width: 100% !important;
        max-width: none !important;
    }
    
    a {
        color: #000 !important;
        text-decoration: underline !important;
    }
    
    .service-card,
    .price-card {
        break-inside: avoid;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }
}
