/* ===== COMPREHENSIVE RESPONSIVE DESIGN ENHANCEMENTS ===== */
/* This file provides additional responsive design improvements for Stella's Frkn Art */

/* ===== MOBILE-FIRST RESPONSIVE FOUNDATION ===== */

/* Base styles for all screen sizes */
* {
    box-sizing: border-box;
}

/* Ensure all images are responsive by default */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ===== SVG RESPONSIVE DESIGN UTILITIES ===== */

/* Base SVG responsiveness */
svg {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Special handling for inline SVGs without fixed dimensions */
svg:not([width]):not([height]) {
    width: 100%;
    height: auto;
}

/* Ensure SVGs maintain aspect ratio */
.svg-responsive {
    width: 100%;
    height: auto;
    max-width: 100%;
}

/* Floating SVG responsive container */
.floating-svg {
    width: 60px;
    height: 60px;
    position: absolute;
    z-index: 5;
}

/* Ensure child SVGs fill their containers properly */
.floating-svg svg {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    position: absolute;
    top: 0;
    left: 0;
}

/* Icon SVGs - keep them small and responsive */
.svg-icon {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: middle;
}

/* Decorative SVGs that should scale with content */
.svg-decorative {
    width: 100%;
    max-width: 200px;
    height: auto;
}

/* SVG backgrounds that should tile properly */
.svg-pattern {
    background-size: contain;
    background-repeat: repeat;
}

/* ===== DEVICE-SPECIFIC SVG ADJUSTMENTS ===== */

/* Mobile devices */
@media (max-width: 640px) {
    .floating-svg {
        display: none !important; /* Hide all floating SVGs on mobile for cleaner experience */
    }
    
    .svg-decorative {
        max-width: 120px;
    }
    
    /* Hide decorative SVGs on very small screens if needed */
    .svg-hide-mobile {
        display: none !important;
    }
}

/* Tablet devices */
@media (min-width: 641px) and (max-width: 1024px) {
    .floating-svg {
        width: 40px;
        height: 40px;
    }
    
    .svg-decorative {
        max-width: 160px;
    }
}

/* Large desktop */
@media (min-width: 1200px) {
    .floating-svg {
        width: 80px;
        height: 80px;
    }
    
    .svg-decorative {
        max-width: 250px;
    }
}

/* ===== TOUCH DEVICE SVG OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    /* Ensure SVG icons are touch-friendly */
    .svg-icon {
        min-width: 24px;
        min-height: 24px;
    }
    
    /* Reduce complex SVG animations on touch devices for performance */
    .floating-svg {
        animation-duration: 8s !important;
    }
}

/* ===== HIGH DPI DISPLAY SVG OPTIMIZATIONS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Ensure SVGs render crisply on high DPI displays */
    svg {
        shape-rendering: geometricPrecision;
    }
    
    .floating-svg svg {
        shape-rendering: auto;
    }
}

/* ===== ACCESSIBILITY SVG IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    /* Disable SVG animations for users who prefer reduced motion */
    .floating-svg {
        animation: none !important;
    }
    
    svg * {
        animation: none !important;
    }
}

/* ===== PRINT SVG STYLES ===== */
@media print {
    /* Hide decorative floating SVGs in print */
    .floating-svg {
        display: none !important;
    }
    
    /* Ensure other SVGs print properly */
    svg {
        max-width: 100% !important;
        color: black !important;
        fill: black !important;
    }
}

/* Responsive video embeds */
video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

/* ===== MOBILE STYLES (up to 640px) ===== */
@media (max-width: 640px) {
    /* Typography adjustments for small screens - MUCH BIGGER */
    h1 { font-size: 3.5rem !important; } /* Increased significantly */
    h2 { font-size: 3rem !important; } /* Much bigger */
    h3 { font-size: 2.5rem !important; } /* Increased */
    h4 { font-size: 2rem !important; } /* Much bigger */
    h5 { font-size: 1.75rem !important; } /* Increased */
    h6 { font-size: 1.5rem !important; } /* Bigger */
    
    /* Body text and paragraphs - much larger */
    p, li, span {
        font-size: 1.25rem !important; /* Increased from 0.95rem */
        line-height: 1.6;
    }
    
    /* Navigation text bigger */
    .nav-link {
        font-size: 1.75rem !important; /* Much bigger mobile nav */
        padding: 0.75rem 1.5rem !important;
        margin: 0.5rem 0 !important;
        min-height: 50px !important; /* Better touch target */
    }
    
    /* Mobile menu button bigger */
    #mobile-menu-button {
        font-size: 2.5rem !important; /* Much bigger hamburger menu */
        padding: 0.75rem !important;
        min-width: 50px !important;
        min-height: 50px !important;
    }
    
    /* Make navbar brand/logo bigger on mobile */
    .font-lobster.text-3xl {
        font-size: 2.5rem !important; /* Bigger site title on mobile */
    }
    
    /* Ensure navbar has enough height for bigger elements */
    .sticky-nav {
        padding: 1rem 0 !important;
    }
    
    /* Button text bigger */
    .funky-btn, .filter-btn {
        font-size: 1.25rem !important;
        padding: 1rem 1.5rem !important;
    }
    
    /* Form inputs bigger text */
    .form-input {
        font-size: 1.125rem !important;
    }
    
    /* Portfolio and gallery text bigger */
    .polaroid h3 {
        font-size: 1.5rem !important;
    }
    
    .polaroid p {
        font-size: 1.125rem !important;
    }
    
    /* Footer and smaller text elements */
    footer, footer * {
        font-size: 1.125rem !important;
    }
    
    /* Any small text should be readable */
    .text-sm {
        font-size: 1rem !important;
    }
    
    .text-xs {
        font-size: 0.95rem !important;
    }
    
    /* Make sure all text is at least this big */
    * {
        font-size: inherit;
    }
    
    /* Override any small text classes */
    .text-sm, .text-xs, small {
        font-size: 1.125rem !important;
    }
    
    /* Closer text shadows for better mobile readability */
    [style*="text-shadow"] {
        text-shadow: 1px 1px var(--retro-gold) !important;
    }
    
    h1[style*="text-shadow"], h2[style*="text-shadow"] {
        text-shadow: 1px 1px var(--retro-gold) !important;
    }
    
    /* Special sizing for hero text on mobile - MUCH BIGGER */
    .font-lobster.text-6xl {
        font-size: 4.5rem !important; /* "Hey, I'm" much bigger on mobile */
        line-height: 1.1;
    }
    
    .font-lobster.text-7xl {
        font-size: 5rem !important; /* "a Frkn Artist" much bigger on mobile */
        line-height: 1.1;
    }
    
    /* Make hero section text more prominent on mobile */
    header .sticker h1,
    header .sticker h2 {
        margin-bottom: 0.5rem;
    }
    
    /* Ensure text doesn't get cut off on very small screens */
    @media (max-width: 480px) {
        .font-lobster.text-6xl {
            font-size: 3.5rem !important;
        }
        
        .font-lobster.text-7xl {
            font-size: 4rem !important;
        }
        
        /* Smaller screens - still bigger than before */
        p, li, span {
            font-size: 1.125rem !important;
        }
        
        h1 { font-size: 3rem !important; }
        h2 { font-size: 2.5rem !important; }
        h3 { font-size: 2rem !important; }
    }
    
    /* Navigation improvements */
    .sticky-nav {
        padding: 0.5rem 0;
    }
    
    .nav-link {
        font-size: 1.125rem !important;
        padding: 0.75rem 1rem;
        margin: 0.25rem 0;
    }
    
    /* Container spacing adjustments */
    .container {
        padding-left: 0.5rem; /* Reduced padding for more space */
        padding-right: 0.5rem;
        max-width: none !important; /* Remove max-width constraints on mobile */
    }
    
    /* Hero sticker adjustments for mobile */
    .sticker {
        padding: 1.5rem !important; /* Increased padding for hero text */
        border-radius: 0.75rem;
        max-width: 95vw; /* Use most of viewport width */
        margin: 0 auto;
    }
    
    /* Grid system optimizations */
    .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* Button optimizations */
    .funky-btn, .filter-btn {
        width: 100%;
        max-width: 280px;
        margin: 0.5rem auto;
        display: block;
        text-align: center;
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
    
    /* Sticker and card elements */
    .sticker, .polaroid, .taped-image {
        margin: 1rem 0;
        width: 100%;
    }
    
    /* Portfolio grid mobile optimization */
    .portfolio-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    /* Form optimizations */
    .form-input {
        font-size: 1rem;
        padding: 1rem;
        min-height: 48px;
    }
    
    /* Text alignment for mobile */
    .text-center-mobile {
        text-align: center !important;
    }
    
    /* Spacing adjustments */
    .px-4 { padding-left: 1rem !important; padding-right: 1rem !important; }
    .py-4 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
    .mx-auto { margin-left: auto !important; margin-right: auto !important; }
    
    /* Hide desktop-specific elements */
    .desktop-only {
        display: none !important;
    }
    
    /* Show mobile-specific elements */
    .mobile-only {
        display: block !important;
    }
}

/* ===== TABLET STYLES (641px to 1024px) ===== */
@media (min-width: 641px) and (max-width: 1024px) {
    /* Typography for tablets */
    h1 { font-size: 3rem !important; }
    h2 { font-size: 2.5rem !important; }
    h3 { font-size: 2rem !important; }
    
    /* Container adjustments */
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    /* Grid adjustments for tablet */
    .grid-cols-1.sm\\:grid-cols-2.lg\\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Navigation for tablets */
    .nav-link {
        font-size: 1.25rem;
        padding: 0.5rem 1rem;
    }
    
    /* Button sizing for tablets */
    .funky-btn, .filter-btn {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    /* Portfolio grid for tablets */
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2rem !important;
    }
}

/* ===== LARGE TABLET/SMALL DESKTOP (1025px to 1199px) ===== */
@media (min-width: 1025px) and (max-width: 1199px) {
    .container {
        max-width: 1024px;
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    .grid-cols-1.sm\\:grid-cols-2.lg\\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 2.5rem !important;
    }
}

/* ===== LARGE DESKTOP (1200px and up) ===== */
@media (min-width: 1200px) {
    .container {
        max-width: 1200px;
        padding-left: 2.5rem;
        padding-right: 2.5rem;
    }
    
    /* Enhanced typography for large screens */
    h1 { font-size: 4rem !important; }
    h2 { font-size: 3.5rem !important; }
    
    .portfolio-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 3rem !important;
    }
}

/* ===== TOUCH DEVICE OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .nav-link, .funky-btn, .filter-btn {
        min-height: 44px;
        min-width: 44px;
        padding: 0.875rem 1rem;
    }
    
    /* Reduce hover effects on touch devices */
    .polaroid:hover,
    .sticker:hover,
    .taped-image:hover {
        transform: none !important;
    }
    
    /* Better button spacing for touch */
    .funky-btn, .filter-btn {
        margin: 0.5rem;
    }
}

/* ===== LANDSCAPE MOBILE OPTIMIZATION ===== */
@media (max-width: 896px) and (orientation: landscape) {
    /* Reduce vertical spacing in landscape mode */
    .py-16 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
    .py-12 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
    .my-16 { margin-top: 2rem !important; margin-bottom: 2rem !important; }
    
    /* Compact navigation */
    .sticky-nav {
        padding: 0.25rem 0;
    }
    
    /* Smaller hero text in landscape */
    h1 { font-size: 2.5rem !important; }
    h2 { font-size: 2rem !important; }
}

/* ===== HIGH DPI DISPLAY OPTIMIZATIONS ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Crisper images on high DPI displays */
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
    
    /* Sharper borders and shadows */
    .polaroid, .sticker, .taped-image {
        border-width: 1px;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */
@media (prefers-reduced-motion: reduce) {
    /* Disable animations for users who prefer reduced motion */
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .floating-svg {
        animation: none !important;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    /* Optimize for printing */
    .sticky-nav,
    .floating-svg,
    .funky-btn {
        display: none !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
    
    .container {
        max-width: none !important;
        padding: 0 !important;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
}

/* ===== CUSTOM RESPONSIVE UTILITIES ===== */

/* Responsive visibility utilities */
.show-mobile { display: none; }
.show-tablet { display: none; }
.show-desktop { display: block; }

@media (max-width: 640px) {
    .hide-mobile { display: none !important; }
    .show-mobile { display: block !important; }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .hide-tablet { display: none !important; }
    .show-tablet { display: block !important; }
    .show-desktop { display: none; }
}

@media (min-width: 1025px) {
    .hide-desktop { display: none !important; }
    .show-mobile { display: none; }
    .show-tablet { display: none; }
}

/* Responsive text alignment */
.text-left-mobile { text-align: left; }
.text-center-mobile { text-align: center; }
.text-right-mobile { text-align: right; }

@media (max-width: 640px) {
    .text-left-mobile { text-align: left !important; }
    .text-center-mobile { text-align: center !important; }
    .text-right-mobile { text-align: right !important; }
}

/* Responsive spacing utilities */
.spacing-mobile-sm { padding: 0.5rem; margin: 0.5rem 0; }
.spacing-mobile-md { padding: 1rem; margin: 1rem 0; }
.spacing-mobile-lg { padding: 1.5rem; margin: 1.5rem 0; }

@media (max-width: 640px) {
    .spacing-mobile-sm { padding: 0.5rem !important; margin: 0.5rem 0 !important; }
    .spacing-mobile-md { padding: 1rem !important; margin: 1rem 0 !important; }
    .spacing-mobile-lg { padding: 1.5rem !important; margin: 1.5rem 0 !important; }
}

/* ===== RESPONSIVE GRID SYSTEM ===== */

/* Custom responsive grid that works with existing classes */
.responsive-grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

@media (max-width: 640px) {
    .responsive-grid-auto {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .responsive-grid-auto {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.5rem;
    }
}

@media (min-width: 1025px) {
    .responsive-grid-auto {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 2rem;
    }
}
