/**
 * AI Polaroid Photo - Custom Styles
 * 
 * Modern, dark theme with accent colors
 * Designed for high conversion and professional appearance
 */

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
    --color-dark: #0a0a0a;
    --color-dark-800: #141414;
    --color-dark-700: #1a1a1a;
    --color-dark-600: #242424;
    --color-accent: #FF6B35;
    --color-accent-light: #FF8C5A;
    --color-cream: #FFF8F0;
    
    --shadow-glow: 0 0 60px rgba(255, 107, 53, 0.15);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Base Styles
   ============================================ */
html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-dark);
}

::selection {
    background-color: var(--color-accent);
    color: white;
}

/* ============================================
   Navigation
   ============================================ */
.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* ============================================
   Hero Section
   ============================================ */
.polaroid-stack {
    min-height: 400px;
    position: relative;
}

/* Mobile polaroid stack - simpler centered layout */
.polaroid-stack-mobile {
    min-height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.polaroid-mobile {
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.1),
        0 10px 20px rgba(0, 0, 0, 0.15),
        0 20px 40px rgba(0, 0, 0, 0.2);
    animation: floatSingle 4s ease-in-out infinite;
}

@keyframes floatSingle {
    0%, 100% { transform: rotate(-3deg) translateY(0); }
    50% { transform: rotate(-1deg) translateY(-8px); }
}

.polaroid {
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.1),
        0 10px 20px rgba(0, 0, 0, 0.15),
        0 25px 50px rgba(0, 0, 0, 0.2);
}

.polaroid::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Polaroid hover effects - desktop only */
@media (min-width: 1024px) {
    .polaroid-1 { animation: float1 6s ease-in-out infinite; }
    .polaroid-2 { animation: float2 7s ease-in-out infinite; }
    .polaroid-3 { animation: float3 5s ease-in-out infinite; }
}

@keyframes float1 {
    0%, 100% { transform: rotate(-12deg) translateY(0); }
    50% { transform: rotate(-10deg) translateY(-10px); }
}

@keyframes float2 {
    0%, 100% { transform: rotate(6deg) translateY(0); }
    50% { transform: rotate(8deg) translateY(-15px); }
}

@keyframes float3 {
    0%, 100% { transform: rotate(-3deg) translateY(0); }
    50% { transform: rotate(-1deg) translateY(-8px); }
}

/* ============================================
   Drop Zone
   ============================================ */
.drop-zone {
    transition: var(--transition-smooth);
}

.drop-zone:hover {
    border-color: var(--color-accent);
    background-color: rgba(255, 107, 53, 0.05);
}

.drop-zone.drag-over {
    border-color: var(--color-accent);
    background-color: rgba(255, 107, 53, 0.1);
    transform: scale(1.02);
}

.drop-zone.drag-over .drop-zone-content {
    opacity: 0.3;
}

.drop-zone.drag-over .drop-zone-active {
    display: flex !important;
}

/* ============================================
   Preview Grid
   ============================================ */
.preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: var(--transition-smooth);
}

.preview-item:hover {
    transform: scale(1.02);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-item .remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: var(--transition-smooth);
    color: white;
}

.preview-item:hover .remove-btn {
    opacity: 1;
    transform: scale(1);
}

.preview-item .remove-btn:hover {
    background: var(--color-accent);
}

/* ============================================
   Loading Animation
   ============================================ */
.loading-animation {
    perspective: 1000px;
}

.loading-animation > div {
    animation: polaroidDevelop 2s ease-in-out infinite;
}

@keyframes polaroidDevelop {
    0%, 100% {
        transform: rotate(-3deg) scale(1);
    }
    50% {
        transform: rotate(3deg) scale(1.05);
    }
}

/* ============================================
   Example Polaroids
   ============================================ */
.example-polaroid {
    transition: var(--transition-smooth);
}

.example-polaroid:hover {
    z-index: 10;
}

/* Film grain effect for examples */
.example-polaroid::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 32px;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.05;
    pointer-events: none;
    mix-blend-mode: overlay;
}

/* ============================================
   Buttons
   ============================================ */
button, a {
    transition: var(--transition-smooth);
}

/* Primary button glow */
.shadow-accent\/25:hover {
    box-shadow: 0 0 30px rgba(255, 107, 53, 0.4);
}

/* ============================================
   FAQ Accordion
   ============================================ */
details summary {
    list-style: none;
}

details summary::-webkit-details-marker {
    display: none;
}

details[open] summary {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* ============================================
   Teaser Canvas
   ============================================ */
#teaser-canvas {
    filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.5));
}

/* ============================================
   Final Image
   ============================================ */
#final-image {
    filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.5));
    animation: revealImage 0.8s ease-out;
}

@keyframes revealImage {
    from {
        opacity: 0;
        transform: scale(0.95) rotate(-2deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* ============================================
   State Sections
   ============================================ */
.state-section {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Turnstile Widget
   ============================================ */
.cf-turnstile {
    display: flex;
    justify-content: center;
}

.cf-turnstile iframe {
    margin: 0 auto;
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-dark-800);
}

::-webkit-scrollbar-thumb {
    background: var(--color-dark-600);
    border-radius: 4px;
}

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

/* ============================================
   Responsive Adjustments
   ============================================ */

/* Mobile-first approach - handled by Tailwind classes */

/* Ensure smooth transitions on mobile */
@media (max-width: 1023px) {
    /* Prevent horizontal overflow on mobile */
    body {
        overflow-x: hidden;
    }
}

/* Desktop-specific styles */
@media (min-width: 1024px) {
    /* Ensure full Turnstile visibility on desktop */
    .cf-turnstile {
        transform: none;
    }
}

/* ============================================
   Accessibility
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles */
button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ============================================
   Utility Classes
   ============================================ */
.hidden {
    display: none !important;
}

/* Desktop-only elements - ALWAYS show on screens 1024px and wider */
.desktop-only {
    display: none !important;
}

span.desktop-only {
    display: none !important;
}

@media (min-width: 1024px) {
    .desktop-only {
        display: grid !important;
    }
    
    .desktop-only.flex-display {
        display: flex !important;
    }
    
    span.desktop-only {
        display: inline !important;
    }
    
    .desktop-only.block-display,
    div.desktop-only.block-display {
        display: block !important;
    }
}

/* Mobile-only elements - hide on screens 1024px and wider */
.mobile-only {
    display: block !important;
}

div.mobile-only.flex {
    display: flex !important;
}

span.mobile-only {
    display: inline !important;
}

@media (min-width: 1024px) {
    .mobile-only,
    span.mobile-only,
    div.mobile-only,
    div.mobile-only.flex,
    .mobile-hero-content .mobile-only {
        display: none !important;
    }
}

/* Mobile Hero Content - show only on mobile */
.mobile-hero-content {
    display: block;
}

@media (min-width: 1024px) {
    .mobile-hero-content {
        display: none !important;
    }
}

/* Mobile Polaroid - Bold, oversized, impactful */
.mobile-polaroid-container {
    overflow: visible;
}

.mobile-polaroid-container > div:first-child {
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.5),
        0 0 60px rgba(255, 107, 53, 0.15);
    animation: float-polaroid 3s ease-in-out infinite;
}

@keyframes float-polaroid {
    0%, 100% {
        transform: rotate(-3deg) translateY(0);
    }
    50% {
        transform: rotate(-3deg) translateY(-8px);
    }
}

/* Mobile hero section specific adjustments */
@media (max-width: 1023px) {
    .hero-section {
        min-height: 100svh;
        padding-top: 80px;
    }
    
    .hero-section .mobile-hero-content {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: calc(100svh - 100px);
    }
}

/* Desktop Navigation - hidden on mobile, flex on desktop */
.desktop-nav {
    display: none !important;
}

@media (min-width: 768px) {
    .desktop-nav {
        display: flex !important;
    }
}

/* Mobile Nav Button - show on mobile, hide on desktop */
button.mobile-nav-btn,
.mobile-nav-btn,
#mobile-menu-btn {
    display: block !important;
}

@media (min-width: 768px) {
    button.mobile-nav-btn,
    .mobile-nav-btn,
    #mobile-menu-btn {
        display: none !important;
    }
}

/* Gradient text helper */
.gradient-text {
    background: linear-gradient(135deg, var(--color-accent), #FF8C5A);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Glass effect */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
