/* ============================================
   MARICURE.EE - Responsive Stylesheet
   Mobile-First Responsive Design
   ============================================ */

/* ============================================
   TABLET BREAKPOINT (768px)
   ============================================ */
@media (max-width: 1024px) {
    /* Typography adjustments */
    :root {
        --text-4xl: 1.875rem;
        --text-5xl: 2.5rem;
        --text-6xl: 3rem;
        --text-7xl: 3.75rem;
    }
    
    /* Section padding */
    .section {
        padding: var(--space-16) var(--space-6);
    }
    
    /* Services grid */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Portfolio grid */
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Brand values */
    .brand-values {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Master content */
    .master-content {
        grid-template-columns: 1fr;
        gap: var(--space-12);
    }
    
    .master-image {
        max-width: 500px;
        margin: 0 auto;
    }
    
    /* Contact content */
    .contact-content {
        grid-template-columns: 1fr;
        gap: var(--space-12);
    }
    
    /* Abstract nails - reduce count on smaller screens */
    .abstract-nail:nth-child(n+6) {
        display: none;
    }
}

/* ============================================
   MOBILE BREAKPOINT (768px)
   ============================================ */
@media (max-width: 768px) {
    /* Typography adjustments */
    :root {
        --text-xl: 1.125rem;
        --text-2xl: 1.25rem;
        --text-3xl: 1.5rem;
        --text-4xl: 1.75rem;
        --text-5xl: 2rem;
        --text-6xl: 2.5rem;
    }
    
    /* Hide custom cursor on touch devices */
    .cursor-dot,
    .cursor-ring {
        display: none;
    }
    
    body {
        cursor: auto;
    }
    
    button,
    a {
        cursor: auto;
    }
    
    /* Navigation */
    .navbar {
        padding: var(--space-4) var(--space-4);
    }
    
    .nav-logo {
        z-index: 1001;
    }
    
    .nav-menu {
        padding-top: var(--space-20);
    }
    
    .nav-link {
        font-size: var(--text-lg);
    }
    
    /* Hero section */
    .hero {
        min-height: 100vh;
        padding-top: var(--space-20);
    }
    
    .hero-content {
        padding: var(--space-4);
    }
    
    .logo-svg {
        max-width: 300px;
    }
    
    .hero-tagline {
        font-size: var(--text-base);
        letter-spacing: 0.15em;
        margin-bottom: var(--space-8);
    }
    
    .hero .btn-primary {
        padding: var(--space-3) var(--space-6);
        font-size: var(--text-xs);
    }
    
    /* Hide some abstract elements on mobile */
    .abstract-nail:nth-child(n+4) {
        display: none;
    }
    
    .scroll-indicator {
        bottom: var(--space-6);
    }
    
    /* Section titles */
    .section-title {
        font-size: var(--text-3xl);
    }
    
    /* Master section */
    .master-achievements {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .achievement {
        display: flex;
        align-items: center;
        gap: var(--space-4);
        text-align: left;
        padding: var(--space-4);
        background: var(--color-bg-glass);
        border-radius: var(--radius-lg);
    }
    
    .achievement-number {
        font-size: var(--text-2xl);
        margin-bottom: 0;
    }
    
    /* Services grid */
    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
    
    .service-card {
        padding: var(--space-6);
    }
    
    .service-icon {
        width: 60px;
        height: 60px;
    }
    
    /* Brand values */
    .brand-values {
        grid-template-columns: 1fr;
    }
    
    /* Portfolio */
    .portfolio-filter {
        gap: var(--space-2);
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: var(--space-4);
        -webkit-overflow-scrolling: touch;
    }
    
    .filter-btn {
        padding: var(--space-2) var(--space-4);
        font-size: var(--text-xs);
        white-space: nowrap;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    /* Contact */
    .contact-title {
        font-size: var(--text-3xl);
    }
    
    .contact-social {
        justify-content: flex-start;
    }
    
    /* Footer */
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--space-4);
    }
    
    /* Modals */
    .modal-content {
        margin: var(--space-4);
        max-height: calc(100vh - var(--space-8));
        padding: var(--space-6);
    }
    
    .booking-form .form-row {
        grid-template-columns: 1fr;
    }
    
    .lightbox-content {
        width: 95%;
    }
    
    .lightbox-image-container {
        height: 50vh;
    }
    
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: var(--text-2xl);
    }
    
    .lightbox-nav.prev { left: var(--space-2); }
    .lightbox-nav.next { right: var(--space-2); }
}

/* ============================================
   SMALL MOBILE BREAKPOINT (480px)
   ============================================ */
@media (max-width: 480px) {
    /* Typography adjustments */
    :root {
        --text-base: 0.9375rem;
        --text-lg: 1rem;
        --text-xl: 1.125rem;
        --text-2xl: 1.25rem;
        --text-3xl: 1.5rem;
    }
    
    /* Section padding */
    .section {
        padding: var(--space-12) var(--space-4);
    }
    
    /* Hero */
    .logo-svg {
        max-width: 240px;
    }
    
    .hero-tagline {
        font-size: var(--text-sm);
        letter-spacing: 0.1em;
    }
    
    /* Hide scroll indicator on very small screens */
    .scroll-indicator {
        display: none;
    }
    
    /* Master */
    .master-name {
        font-size: var(--text-2xl);
    }
    
    .master-bio {
        font-size: var(--text-sm);
    }
    
    /* Brand */
    .brand-text {
        font-size: var(--text-base);
    }
    
    .service-card {
        padding: var(--space-5);
    }
    
    .service-title {
        font-size: var(--text-lg);
    }
    
    .service-desc {
        font-size: var(--text-xs);
    }
    
    /* Portfolio */
    .portfolio-overlay h4 {
        font-size: var(--text-lg);
    }
    
    .portfolio-view {
        padding: var(--space-2) var(--space-4);
        font-size: var(--text-xs);
    }
    
    /* Contact */
    .contact-item {
        font-size: var(--text-sm);
    }
    
    /* Footer */
    .footer-logo {
        font-size: var(--text-2xl);
    }
    
    /* Buttons */
    .btn-primary {
        padding: var(--space-3) var(--space-5);
        font-size: var(--text-xs);
    }
    
    /* Modal */
    .modal-content {
        padding: var(--space-5);
        border-radius: var(--radius-lg);
    }
    
    .modal-close {
        top: var(--space-3);
        right: var(--space-3);
    }
    
    .booking-header h3,
    .login-header h3 {
        font-size: var(--text-xl);
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: var(--space-3);
        font-size: var(--text-sm);
    }
}

/* ============================================
   LARGE DESKTOP (1440px+)
   ============================================ */
@media (min-width: 1440px) {
    .container {
        max-width: 1320px;
    }
    
    .services-grid {
        gap: var(--space-8);
    }
    
    .portfolio-grid {
        gap: var(--space-8);
    }
}

/* ============================================
   ULTRA WIDE (1920px+)
   ============================================ */
@media (min-width: 1920px) {
    :root {
        --text-4xl: 2.5rem;
        --text-5xl: 3.5rem;
        --text-6xl: 4.5rem;
        --text-7xl: 6rem;
    }
    
    .container {
        max-width: 1600px;
    }
    
    .hero-tagline {
        font-size: var(--text-2xl);
    }
    
    .abstract-nail {
        width: 180px;
        height: 240px;
    }
}

/* ============================================
   LANDSCAPE MOBILE
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: var(--space-4);
    }
    
    .hero-content {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: var(--space-8);
    }
    
    .logo-container {
        margin-bottom: 0;
    }
    
    .logo-svg {
        max-width: 200px;
    }
    
    .hero-tagline {
        display: none;
    }
    
    .scroll-indicator {
        display: none;
    }
    
    .section {
        padding: var(--space-8) var(--space-4);
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    /* Hide non-essential elements */
    .navbar,
    .scroll-indicator,
    .cursor-dot,
    .cursor-ring,
    .hero-abstracts,
    .hero-particles,
    .btn-primary,
    .portfolio-filter,
    .contact-social,
    .footer-links a[href^="/admin"] {
        display: none !important;
    }
    
    /* Reset colors for print */
    body {
        background: white;
        color: black;
    }
    
    .section {
        padding: 2cm 1cm;
    }
    
    /* Ensure text is readable */
    .master-bio,
    .brand-text,
    .service-desc {
        color: #333;
    }
    
    /* Remove gradients and effects */
    .service-card,
    .value-card {
        border: 1px solid #ccc;
        box-shadow: none;
    }
}

/* ============================================
   HIGH CONTRAST MODE
   ============================================ */
@media (prefers-contrast: high) {
    :root {
        --color-border: rgba(212, 175, 55, 0.8);
        --color-text-secondary: #FFFFFF;
        --color-text-tertiary: rgba(255, 255, 255, 0.9);
    }
    
    .service-card,
    .value-card,
    .portfolio-item {
        border-width: 2px;
    }
}

/* ============================================
   DARK MODE ENHANCEMENTS
   (Already default, but for completeness)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Already optimized for dark mode by default */
}

@media (prefers-color-scheme: light) {
    /* Optional light mode override if needed */
    :root {
        --color-bg-primary: #FFFFFF;
        --color-bg-secondary: #F5F5F5;
        --color-bg-tertiary: #EAEAEA;
        --color-text-primary: #0A0A0A;
        --color-text-secondary: rgba(0, 0, 0, 0.8);
        --color-text-tertiary: rgba(0, 0, 0, 0.6);
    }
}

/* ============================================
   TOUCH DEVICE OPTIMIZATIONS
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    .btn-primary,
    .filter-btn,
    .nav-link,
    .social-link,
    .portfolio-view {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .service-card:hover,
    .value-card:hover,
    .portfolio-item:hover {
        transform: none;
    }
    
    /* Show portfolio overlay by default on touch */
    .portfolio-overlay {
        opacity: 1;
        background: rgba(0, 0, 0, 0.6);
    }
    
    /* Increase form input sizes */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* ============================================
   REDUCED DATA MODE
   ============================================ */
@media (prefers-reduced-data: reduce) {
    /* Disable particle system */
    .hero-particles {
        display: none;
    }
    
    /* Reduce abstract elements */
    .abstract-nail:nth-child(n+4) {
        display: none;
    }
    
    /* Disable complex animations */
    .abstract-nail {
        animation: none;
    }
}

/* ============================================
   SCROLLBAR STYLING (WebKit)
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: var(--radius-full);
    border: 2px solid var(--color-bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-gold-primary);
}

/* ============================================
   SELECTION STYLING
   ============================================ */
::selection {
    background: var(--color-gold-primary);
    color: var(--color-bg-primary);
}

::-moz-selection {
    background: var(--color-gold-primary);
    color: var(--color-bg-primary);
}

/* ============================================
   FOCUS VISIBLE (Keyboard Navigation)
   ============================================ */
:focus-visible {
    outline: 2px solid var(--color-gold-primary);
    outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--color-gold-primary);
    outline-offset: 2px;
}

/* Remove default focus for mouse users */
:focus:not(:focus-visible) {
    outline: none;
}

/* ============================================
   CONTAINER QUERIES (Modern Browsers)
   ============================================ */
@supports (container-type: inline-size) {
    .service-card {
        container-type: inline-size;
    }
    
    @container (max-width: 300px) {
        .service-icon {
            width: 50px;
            height: 50px;
        }
        
        .service-title {
            font-size: var(--text-lg);
        }
    }
}
