/* ============================================
   FYND - Global Styles
   ============================================ */

/* Hide scrollbars - All browsers */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
    display: none;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: transparent;
}

::-webkit-scrollbar-thumb:hover {
    background: transparent;
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Firefox scrollbar hide */
* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

/* Prevent horizontal scrolling on mobile */
body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    position: relative;
}

/* Desktop: Full width display with minimum width */
@media (min-width: 1200px) {
    html, body {
        width: 100%;
        min-width: 100%;
    }
}

/* Ensure all containers respect viewport width */
* {
    box-sizing: border-box;
}

/* Prevent text overflow and wrapping issues on mobile */
@media (max-width: 768px) {
    html {
        min-width: 100vw !important;
    }
    
    body {
        overflow-x: hidden;
        width: 100vw;
        max-width: 100vw;
        min-width: 100vw !important;
    }
    
    /* Prevent horizontal scrolling */
    main, section, div, header, footer, nav {
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    /* Ensure text doesn't overflow */
    h1, h2, h3, h4, h5, h6, p, span, a, button {
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }
}

/* ============================================
   Checkbox Styles
   ============================================ */

#terms-checkbox,
#terms-modal-checkbox {
    accent-color: white;
}

#terms-checkbox:checked,
#terms-modal-checkbox:checked {
    background-color: white;
    border-color: white;
}

/* ============================================
   Typography
   ============================================ */

/* Editorial Typography - Landing page */
.editorial-text {
    line-height: 0.95; 
    letter-spacing: -0.04em; 
}

/* ============================================
   Image Effects
   ============================================ */

/* Fashion Image Hover Effect */
.fashion-img {
    filter: grayscale(0%);
    transition: filter 0.5s ease;
}

/* AI Tag Animation */
.ai-tag {
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.fashion-img-container:hover .ai-tag {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   Button Animations
   ============================================ */

/* Shine Button Animation */
.shine-btn {
    position: relative;
    overflow: hidden;
    background: transparent;
    border-radius: 0.5rem;
    isolation: isolate; 
}

.shine-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 400%;
    height: 400%;
    background: conic-gradient(
        from 0deg, 
        transparent 0%, 
        transparent 70%, 
        #ffffff 85%, 
        #ffffff 100%
    );
    transform: translate(-50%, -50%) rotate(0deg);
    z-index: -2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.shine-btn::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: #000000;
    border-radius: calc(0.5rem - 2px);
    z-index: -1;
}

.shine-btn:hover::before {
    opacity: 1 !important;
    animation: spin-shine 2.5s linear infinite !important;
}

@keyframes spin-shine {
    0% { 
        transform: translate(-50%, -50%) rotate(0deg); 
    }
    100% { 
        transform: translate(-50%, -50%) rotate(360deg); 
    }
}

/* ============================================
   Hero Animations
   ============================================ */

/* Hero Drop Animation - Falling Icons */
.drop-icon {
    opacity: 0; 
    animation: dropIn 1.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes dropIn {
    0% {
        transform: translateY(-150vh) rotate(-45deg);
        opacity: 0;
    }
    100% {
        transform: translateY(0) rotate(var(--rotation));
        opacity: 0.2;
    }
}

/* ============================================
   Mobile Responsive Fixes
   ============================================ */

/* Hide drop icons on very small screens for cleaner look */
@media (max-width: 480px) {
    .drop-icon {
        opacity: 0.1 !important;
    }
}

/* Reduce editorial text line-height on mobile */
@media (max-width: 640px) {
    .editorial-text {
        line-height: 1.05;
        letter-spacing: -0.02em;
    }
}

/* Touch-friendly tap targets - minimum 44px for accessibility */
@media (max-width: 768px) {
    button, 
    a[href],
    .cursor-pointer {
        min-height: 44px;
    }
    
    /* Ensure nav items are easily tappable */
    nav a, 
    nav button {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

/* Feed Profile Photos - Face Crop */
.feed-profile-photo {
    overflow: hidden;
}

/* Better spacing on mobile */
@media (max-width: 640px) {
    /* Reduce section padding on mobile */
    section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
    
    /* Ensure text doesn't overflow */
    h1, h2, h3 {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* ============================================
   Landscape Mode Fixes (Mobile)
   ============================================ */

/* Landscape mode on small devices */
@media (max-height: 500px) and (orientation: landscape) {
    /* Disable min-height: 100vh for ALL elements */
    .min-h-screen,
    [class*="min-h-screen"] {
        min-height: auto !important;
    }
    
    /* Hero section - reduce height */
    .hero-section,
    section {
        min-height: auto !important;
        padding-top: 4rem !important;
        padding-bottom: 1.5rem !important;
    }
    
    /* Main content areas */
    main {
        min-height: auto !important;
        padding-top: 4rem !important;
    }
    
    /* CRITICAL: Hero title - prevent text overlap */
    .editorial-text {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
        letter-spacing: -0.01em !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* All large headings in hero */
    h1 {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.5rem !important;
    }
    
    /* Gradient text inside h1 */
    h1 span {
        display: inline !important;
    }
    
    /* Hide falling icons in landscape for cleaner look */
    .drop-icon {
        display: none !important;
    }
    
    /* Navigation - more compact */
    nav {
        height: 48px !important;
    }
    
    nav > div {
        height: 48px !important;
    }
    
    /* Logo smaller */
    nav img {
        height: 28px !important;
    }
    
    /* Center buttons smaller */
    nav a[href="try-on.html"],
    nav a[href="find.html"] {
        padding: 0.2rem 0.4rem !important;
        gap: 0.2rem !important;
    }
    
    nav a[href="try-on.html"] span,
    nav a[href="find.html"] span {
        font-size: 0.6rem !important;
    }
    
    nav a[href="try-on.html"] i,
    nav a[href="find.html"] i {
        width: 0.65rem !important;
        height: 0.65rem !important;
    }
    
    /* Hide nav links in landscape - show only logo and buttons */
    nav .hidden.md\\:flex {
        display: none !important;
    }
    
    /* Badge - hide completely in landscape for space */
    .hero-section .inline-flex.items-center.gap-2,
    section > div > .inline-flex {
        display: none !important;
    }
    
    /* Subtitle smaller margins */
    .hero-section p,
    section p.text-gray-400,
    p.text-gray-400 {
        margin-bottom: 0.5rem !important;
        font-size: 0.7rem !important;
        line-height: 1.35 !important;
        max-width: 90% !important;
    }
    
    /* App Store button smaller */
    .shine-btn {
        padding: 0.4rem 0.8rem !important;
        min-width: 140px !important;
    }
    
    .shine-btn svg {
        width: 1rem !important;
        height: 1rem !important;
    }
    
    .shine-btn .text-xl {
        font-size: 0.75rem !important;
    }
    
    .shine-btn .text-\\[10px\\] {
        font-size: 7px !important;
    }
    
    /* Page titles smaller with proper spacing */
    h1, .text-4xl, .text-5xl, .text-6xl, .text-7xl, .text-8xl, .text-9xl {
        font-size: 1.5rem !important;
        line-height: 1.25 !important;
        margin-bottom: 0.4rem !important;
    }
    
    h2, .text-3xl {
        font-size: 1.25rem !important;
        line-height: 1.3 !important;
    }
    
    h3 {
        font-size: 1rem !important;
        line-height: 1.3 !important;
    }
    
    /* Ensure proper spacing between elements */
    .mb-8 {
        margin-bottom: 0.5rem !important;
    }
    
    .mb-12 {
        margin-bottom: 0.75rem !important;
    }
    
    .gap-4 {
        gap: 0.5rem !important;
    }
    
    /* Back to Home button - compact */
    a[href="index.html"].fixed {
        top: 3.5rem !important;
        left: 0.5rem !important;
    }
    
    a[href="index.html"].fixed > div {
        width: 2rem !important;
        height: 2rem !important;
    }
    
    a[href="index.html"].fixed span {
        display: none !important;
    }
    
    /* Upload containers smaller */
    #user-photo-container,
    #clothing-container,
    #find-photo-container {
        min-height: 120px !important;
        max-height: 150px !important;
    }
    
    /* Grid layout in landscape - side by side */
    .grid.grid-cols-1.md\\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    
    /* Action buttons compact */
    button.px-8 {
        padding: 0.5rem 1rem !important;
        font-size: 0.75rem !important;
    }
    
    /* Footer compact */
    footer {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    footer .py-16 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    /* Mobile menu top position - works with all page-specific mobile menu IDs */
    #mobile-menu {
        top: 5.5rem !important;
        right: 1.5rem !important;
    }
    #tryon-mobile-menu,
    #find-mobile-menu {
        top: 50px !important;
    }
}

/* Wider landscape screens (tablets in landscape) */
@media (max-height: 600px) and (min-width: 600px) and (orientation: landscape) {
    /* Hero section */
    .min-h-screen {
        min-height: auto !important;
    }
    
    section {
        padding-top: 5rem !important;
        padding-bottom: 3rem !important;
    }
    
    main {
        padding-top: 6rem !important;
    }
    
    /* Editorial text scaling */
    .editorial-text {
        font-size: 3rem !important;
    }
    
    /* Drop icons - reduced opacity */
    .drop-icon {
        opacity: 0.1 !important;
        transform: scale(0.5) !important;
    }
    
    /* Nav slightly bigger than phone landscape */
    nav {
        height: 56px !important;
    }
    
    nav > div {
        height: 56px !important;
    }
    
    nav img {
        height: 36px !important;
    }
}

/* Very short landscape (iPhone SE landscape, etc) */
@media (max-height: 400px) and (orientation: landscape) {
    /* Hero title - even smaller */
    .editorial-text,
    h1 {
        font-size: 1.25rem !important;
        line-height: 1.35 !important;
        margin-bottom: 0.25rem !important;
    }
    
    /* Even smaller nav */
    nav {
        height: 40px !important;
    }
    
    nav > div {
        height: 40px !important;
    }
    
    nav img {
        height: 24px !important;
    }
    
    /* Nav buttons even smaller */
    nav a[href="try-on.html"],
    nav a[href="find.html"] {
        padding: 0.15rem 0.3rem !important;
    }
    
    nav a[href="try-on.html"] span,
    nav a[href="find.html"] span {
        font-size: 0.5rem !important;
    }
    
    /* Hide badge completely */
    .inline-flex.items-center.gap-2.border,
    .hero-section .inline-flex {
        display: none !important;
    }
    
    /* Minimal padding */
    section {
        padding-top: 3rem !important;
        padding-bottom: 1rem !important;
    }
    
    main {
        padding-top: 3.25rem !important;
    }
    
    /* Subtitle even smaller */
    p.text-gray-400,
    .hero-section p {
        font-size: 0.6rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.35rem !important;
    }
    
    /* App Store button minimal */
    .shine-btn {
        padding: 0.3rem 0.6rem !important;
        min-width: 120px !important;
    }
    
    .shine-btn svg {
        width: 0.85rem !important;
        height: 0.85rem !important;
    }
    
    .shine-btn .text-xl {
        font-size: 0.65rem !important;
    }
    
    .shine-btn .text-\\[10px\\] {
        font-size: 6px !important;
    }
    
    /* Other headings */
    h2, .text-3xl, .text-4xl {
        font-size: 1rem !important;
        line-height: 1.25 !important;
    }
    
    h3, .text-2xl {
        font-size: 0.85rem !important;
    }
    
    /* Upload areas even smaller */
    #user-photo-container,
    #clothing-container,
    #find-photo-container {
        min-height: 80px !important;
        max-height: 100px !important;
    }
    
    /* Icons in upload smaller */
    #user-photo-container i,
    #clothing-container i,
    #find-photo-container i {
        width: 1.25rem !important;
        height: 1.25rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    /* Upload text smaller */
    #user-photo-container p,
    #clothing-container p,
    #find-photo-container p {
        font-size: 0.6rem !important;
    }
    
    /* Back button minimal */
    a[href="index.html"].fixed {
        top: 2.75rem !important;
    }
    
    a[href="index.html"].fixed > div {
        width: 1.5rem !important;
        height: 1.5rem !important;
    }
    
    a[href="index.html"].fixed i {
        width: 0.75rem !important;
        height: 0.75rem !important;
    }
    
    /* Action buttons compact */
    button {
        padding: 0.35rem 0.75rem !important;
        font-size: 0.65rem !important;
    }
    
    /* Footer minimal */
    footer {
        padding: 0.5rem !important;
    }
    
    footer p, footer span, footer a {
        font-size: 0.55rem !important;
    }
}

/* ============================================
   Force Override Tailwind Classes in Landscape
   ============================================ */

/* These rules specifically target Tailwind text size classes */
@media (max-height: 500px) and (orientation: landscape) {
    /* Force override all Tailwind text sizes */
    [class*="text-9xl"],
    [class*="text-8xl"],
    [class*="text-7xl"] {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }
    
    [class*="text-6xl"],
    [class*="text-5xl"] {
        font-size: 1.25rem !important;
        line-height: 1.3 !important;
    }
    
    [class*="text-4xl"] {
        font-size: 1.1rem !important;
        line-height: 1.3 !important;
    }
    
    [class*="text-3xl"] {
        font-size: 1rem !important;
        line-height: 1.3 !important;
    }
    
    [class*="text-2xl"] {
        font-size: 0.9rem !important;
        line-height: 1.3 !important;
    }
    
    [class*="text-xl"] {
        font-size: 0.8rem !important;
        line-height: 1.3 !important;
    }
    
    /* Spacing overrides */
    [class*="pt-20"] {
        padding-top: 3.5rem !important;
    }
    
    [class*="pt-28"],
    [class*="pt-32"] {
        padding-top: 4rem !important;
    }
    
    [class*="py-24"],
    [class*="py-32"] {
        padding-top: 2rem !important;
        padding-bottom: 1.5rem !important;
    }
    
    /* Gap overrides */
    [class*="gap-8"],
    [class*="gap-12"],
    [class*="gap-16"] {
        gap: 0.75rem !important;
    }
    
    /* Margin overrides */
    [class*="mb-8"],
    [class*="mb-12"],
    [class*="mb-16"] {
        margin-bottom: 0.5rem !important;
    }
}

@media (max-height: 400px) and (orientation: landscape) {
    /* Even more aggressive for very short screens */
    [class*="text-9xl"],
    [class*="text-8xl"],
    [class*="text-7xl"],
    [class*="text-6xl"],
    [class*="text-5xl"] {
        font-size: 1.1rem !important;
        line-height: 1.25 !important;
    }
    
    [class*="text-4xl"],
    [class*="text-3xl"] {
        font-size: 0.9rem !important;
        line-height: 1.25 !important;
    }
    
    [class*="text-2xl"],
    [class*="text-xl"] {
        font-size: 0.75rem !important;
        line-height: 1.25 !important;
    }
    
    [class*="pt-20"],
    [class*="pt-28"],
    [class*="pt-32"] {
        padding-top: 3rem !important;
    }
}

/* ============================================
   Scanner Slider Styles
   ============================================ */

#scanner-slider-container {
    user-select: none;
    -webkit-user-select: none;
}

#scanner-slider-container:hover {
    cursor: row-resize;
}

#scanner-handle {
    transition: top 0.1s ease-out;
    touch-action: none;
}

#scanner-handle:hover {
    cursor: row-resize;
}

/* Ensure both images are perfectly aligned - Index page slider only */
#scanner-slider-container #scanner-image-1,
#scanner-slider-container #scanner-image-2 {
    object-fit: cover !important;
    object-position: 50% 50% !important;
    transform-origin: center center !important;
    will-change: transform;
}

#scanner-slider-container #scanner-image-2-wrapper {
    transition: clip-path 0.1s ease-out;
    clip-path: inset(0% 0 0 0);
}

#scanner-labels {
    transition: opacity 0.3s ease-in-out;
}
