/* ══════════════════════════════════════════════════════════════════════════
   Landing Page Styles — Prompt-First Redesign
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Smart Navbar ─────────────────────────────────────────────────────── */
.navbar-landing-transparent {
    background: rgba(255, 255, 255, 0.85) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.6) !important;
    backdrop-filter: blur(12px);
}

.navbar-landing-solid {
    background: rgba(255, 255, 255, 0.97) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    border-bottom: 1px solid rgba(226, 232, 240, 0.8) !important;
    backdrop-filter: blur(12px);
}

#mainNavbar {
    transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* ── CSS variables that video.css needs (defined in animation.css which isn't loaded here) ── */
.landing-hero-bg {
    --white: #FFFFFF;
    --gray-50: #FAFBFC;
    --gray-100: #F5F7FA;
    --gray-200: #E8ECF0;
    --gray-300: #D7DCE3;
    --gray-400: #A0A8B5;
    --gray-500: #6C7688;
    --gray-600: #4A5567;
    --gray-700: #2D3748;
    --gray-800: #1A202C;
    --gray-900: #0F1419;
    --radius-lg: 0.875rem;
    --radius-xl: 1.125rem;
    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
}

/* ── Hero Prompt Section ──────────────────────────────────────────────── */
/* Higher specificity to beat video.css which loads after landing.css */
.landing-hero-bg .prompt-card {
    background: var(--white, #ffffff);
    border: 1.5px solid #c4b5fd;
    border-radius: 1.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 6px 24px rgba(124, 58, 237, 0.13), 0 0 0 4px rgba(139, 92, 246, 0.07);
    overflow: visible;
}

.landing-hero-bg .prompt-card:focus-within {
    border-color: #a78bfa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10), 0 8px 32px rgba(124, 58, 237, 0.18), 0 0 0 4px rgba(139, 92, 246, 0.12);
}

/* Tailwind Forms focus ring override */
.landing-hero-bg .prompt-card .prompt-textarea:focus {
    outline: none;
    box-shadow: none;
    --tw-ring-shadow: 0 0 #0000;
    --tw-ring-offset-shadow: 0 0 #0000;
}

.ds-hidden {
    display: none !important;
}

/* ── Prompt Footer & Dropdowns (matches Video page) ──────────────────── */
.prompt-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--gray-200, #e5e7eb);
    background: var(--gray-50, #f9fafb);
    border-radius: 0 0 1.25rem 1.25rem;
}

.prompt-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.aspect-ratio-wrapper {
    position: relative;
}

.aspect-ratio-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-200, #e5e7eb);
    background: var(--white, #ffffff);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-600, #4b5563);
    cursor: pointer;
    transition: all 0.15s ease;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: inherit;
}

.aspect-ratio-btn:hover {
    background: var(--gray-50, #f9fafb);
    border-color: var(--gray-300, #d1d5db);
}

.aspect-ratio-btn i {
    font-size: 1.125rem;
}

.aspect-ratio-btn .ratio-text {
    color: var(--gray-900, #111827);
}

.aspect-ratio-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    background: var(--white, #ffffff);
    border: 1px solid var(--gray-200, #e5e7eb);
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
}

.aspect-ratio-dropdown button {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--gray-700, #374151);
    font-family: inherit;
}

.aspect-ratio-dropdown button:hover {
    background: var(--gray-50, #f9fafb);
}

.aspect-ratio-dropdown button i {
    font-size: 1.125rem;
    color: var(--gray-500, #6b7280);
}

.aspect-ratio-dropdown button .ratio-label {
    flex: 1;
}

.aspect-ratio-dropdown button .ratio-value {
    color: var(--gray-500, #6b7280);
    font-size: 0.8125rem;
}

.resolution-locked {
    opacity: 0.6;
    cursor: not-allowed !important;
}

.resolution-locked:hover {
    background-color: var(--gray-50, #f9fafb) !important;
}

.aspect-ratio-dropdown button .hgi-lock-01 {
    font-size: 14px;
    margin-left: auto;
}

/* ── Prompt Create Button (landing-specific, since animation.css isn't loaded) ── */
.prompt-create-btn {
    min-width: 120px;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #7C3AED 0%, #A855F7 100%);
    color: #fff;
    border: none;
    border-radius: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
    letter-spacing: -0.01em;
    white-space: nowrap;
    flex-shrink: 0;
}

.prompt-create-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
}

.prompt-create-btn:active {
    transform: translateY(0);
}

/* Responsive: full-width on mobile */
@media (max-width: 640px) {
    .prompt-create-btn {
        width: 100%;
        justify-content: center;
    }
}

.hero-submit-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #7c3aed;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.15s ease;
    flex-shrink: 0;
}

.hero-submit-btn:hover {
    transform: scale(1.05);
}

.hero-submit-btn:active {
    transform: scale(0.95);
}

/* ── Template Sections ────────────────────────────────────────────────── */
.template-section {
    margin-bottom: 2.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1rem;
    padding: 0 0.25rem;
}

.section-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

.section-header a {
    font-size: 0.875rem;
    font-weight: 500;
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.15s ease;
}

.section-header a:hover {
    color: #2563eb;
}

/* ── Carousel ─────────────────────────────────────────────────────────── */
.carousel-wrapper {
    position: relative;
}

.template-carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    padding: 0.25rem 0;
}

.template-carousel::-webkit-scrollbar {
    display: none;
}

/* ── Cards ─────────────────────────────────────────────────────────────── */
.carousel-card {
    position: relative;
    scroll-snap-align: start;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
    overflow: hidden;
    min-width: 0;
}

/* — Landscape 16:9 — */
.carousel-card--landscape {
    flex: 0 0 340px;
}

.carousel-card--landscape .card-media {
    aspect-ratio: 16 / 9;
}

/* — Portrait 9:16 — */
.carousel-card--portrait {
    flex: 0 0 200px;
}

.carousel-card--portrait .card-media {
    aspect-ratio: 9 / 16;
}

/* — Square 1:1 — */
.carousel-card--square {
    flex: 0 0 260px;
}

.carousel-card--square .card-media {
    aspect-ratio: 1 / 1;
}

.card-media {
    position: relative;
    width: 100%;
    border-radius: 0.75rem;
    overflow: hidden;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.carousel-card:hover .card-media {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: scale(1.02);
}

.card-media img,
.card-media video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    display: block;
}

.card-media img {
    transition: opacity 0.3s ease;
}

.card-media video {
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.carousel-card.playing .card-media img {
    opacity: 0;
}

.carousel-card.playing .card-media video {
    opacity: 1;
}

.card-info {
    padding: 0.5rem 0.25rem 0;
}

.card-title {
    font-weight: 600;
    font-size: 0.875rem;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Carousel Arrows ──────────────────────────────────────────────────── */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-70%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    z-index: 10;
    opacity: 1;
    transition: opacity 0.2s ease, background 0.15s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #475569;
}

.carousel-arrow:hover {
    background: #f8fafc;
    color: #1e293b;
}

.carousel-arrow.arrow-hidden {
    opacity: 0;
    pointer-events: none;
}

.carousel-arrow-left {
    left: 4px;
}

.carousel-arrow-right {
    right: 4px;
}

/* ── SEO Text Blocks (between template carousels) ────────────────────── */
.seo-text-block {
    border-top: 1px solid #f1f5f9;
    margin-top: 1rem;
}

/* ── Scroll-reveal animations ─────────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger > .reveal-item {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.reveal-stagger.visible > .reveal-item {
    opacity: 1;
    transform: translateY(0);
}

.reveal-stagger.visible > .reveal-item:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger.visible > .reveal-item:nth-child(2) { transition-delay: 100ms; }
.reveal-stagger.visible > .reveal-item:nth-child(3) { transition-delay: 200ms; }
.reveal-stagger.visible > .reveal-item:nth-child(4) { transition-delay: 300ms; }
.reveal-stagger.visible > .reveal-item:nth-child(5) { transition-delay: 400ms; }
.reveal-stagger.visible > .reveal-item:nth-child(6) { transition-delay: 500ms; }

/* ── Modal ─────────────────────────────────────────────────────────────── */
.modal-backdrop {
    backdrop-filter: blur(4px);
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (min-width: 768px) {
    .carousel-card--landscape {
        flex: 0 0 360px;
    }

    .carousel-card--portrait {
        flex: 0 0 220px;
    }

    .carousel-card--square {
        flex: 0 0 280px;
    }
}

@media (max-width: 640px) {
    .carousel-card--landscape {
        flex: 0 0 260px;
    }

    .carousel-card--portrait {
        flex: 0 0 160px;
    }

    .carousel-card--square {
        flex: 0 0 200px;
    }

    .carousel-arrow {
        width: 32px;
        height: 32px;
        font-size: 1.125rem;
    }

    .section-header h3 {
        font-size: 1.125rem;
    }

    .template-carousel {
        gap: 0.75rem;
        scroll-padding-left: 1rem;
    }
}

/* Premium template badge */
.premium-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    z-index: 5;
    line-height: 1.4;
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* ── Upgrade Card Overlay (inline, inside template card) ────────────── */
.upgrade-card-overlay {
    position: absolute;
    inset: 0;
    z-index: 15;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.upgrade-card-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.upgrade-card-overlay-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    flex-shrink: 0;
}

.upgrade-card-overlay-text {
    color: rgba(255, 255, 255, 0.85);
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    line-height: 1.3;
    margin: 0;
}

.upgrade-card-overlay-text strong {
    color: #fff;
    font-weight: 700;
}

.upgrade-card-overlay-subtext {
    color: rgba(255, 255, 255, 0.6);
    font-size: 10px;
    font-weight: 400;
    text-align: center;
    line-height: 1.3;
    margin: 0;
}

.upgrade-card-overlay-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgb(var(--color-primary, 91 141 239));
    color: #fff !important;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 6px;
    text-decoration: none !important;
    transition: background 0.15s;
    flex-shrink: 0;
}

.upgrade-card-overlay-btn:hover {
    background: rgb(var(--color-primary-hover, 37 99 235));
}
