/* ===================================
   MAIN LAYOUT - Page Specific Styles
   =================================== */

/* ============ PAGE LAYOUT ============ */
.page {
    min-height: 100vh;
    padding-top: var(--header-height);
    padding-bottom: calc(var(--bottom-nav-height) + var(--space-4));
    overflow-x: hidden;
    background: var(--color-bg-primary);
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

@media (min-width: 1024px) {
    .page {
        padding-bottom: var(--space-8);
    }
}

/* ============ HERO SECTION ============ */
.hero {
    position: relative;
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(180deg, #0f0a15 0%, #1a1025 40%, #0d0a10 100%);
    /* Fix mobile flickering */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Animated Gradient Orbs */
.hero::before {
    content: '';
    position: absolute;
    top: 5%;
    left: -10%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.6) 0%, rgba(139, 92, 246, 0.2) 50%, transparent 70%);
    border-radius: 50%;
    filter: blur(30px);
    animation: orbFloat1 8s ease-in-out infinite;
    z-index: 1;
    will-change: transform;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.hero::after {
    content: '';
    position: absolute;
    top: 15%;
    right: -10%;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.55) 0%, rgba(236, 72, 153, 0.2) 50%, transparent 70%);
    border-radius: 50%;
    filter: blur(25px);
    animation: orbFloat2 10s ease-in-out infinite;
    z-index: 1;
    will-change: transform;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

@keyframes orbFloat1 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(30px, -20px) scale(1.1);
    }
}

@keyframes orbFloat2 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(-25px, 15px) scale(1.05);
    }
}

@media (min-width: 640px) {
    .hero {
        min-height: 440px;
    }
}

@media (min-width: 1024px) {
    .hero {
        min-height: 500px;
    }
}

/* Background Template Cards - Curved/Fan Layout */
.hero-bg-cards {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 12px;
    z-index: 2;
    width: 100%;
    max-width: 700px;
    padding: 0 10px;
}

.hero-bg-card {
    width: 120px;
    height: 200px;
    object-fit: cover;
    border-radius: 14px;
    flex-shrink: 0;
    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(139, 92, 246, 0.15);
    transition: all 0.6s ease;
    animation: cardFloat 0.8s ease-out forwards;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Curved/Fan Effect */
.hero-bg-card:nth-child(1) {
    transform: rotate(-12deg) translateY(30px);
    --card-opacity: 0.7;
    animation-delay: 0s;
}

.hero-bg-card:nth-child(2) {
    transform: rotate(-5deg) translateY(10px);
    --card-opacity: 0.9;
    animation-delay: 0.1s;
}

.hero-bg-card:nth-child(3) {
    transform: rotate(5deg) translateY(10px);
    --card-opacity: 0.9;
    animation-delay: 0.15s;
}

.hero-bg-card:nth-child(4) {
    transform: rotate(12deg) translateY(30px);
    --card-opacity: 0.7;
    animation-delay: 0.2s;
}

.hero-bg-card:nth-child(5) {
    display: none;
}

@keyframes cardFloat {
    0% {
        transform: translateY(80px) scale(0.9);
        opacity: 0;
    }

    100% {
        opacity: var(--card-opacity, 0.7);
    }
}

@media (min-width: 500px) {
    .hero-bg-cards {
        gap: 16px;
        max-width: 800px;
    }

    .hero-bg-card {
        width: 140px;
        height: 230px;
    }
}

@media (min-width: 768px) {
    .hero-bg-cards {
        gap: 20px;
        max-width: 950px;
        bottom: -10px;
    }

    .hero-bg-card {
        width: 160px;
        height: 270px;
    }

    .hero::before {
        width: 320px;
        height: 320px;
        left: 5%;
        filter: blur(40px);
    }

    .hero::after {
        width: 280px;
        height: 280px;
        right: 5%;
        filter: blur(35px);
    }
}

@media (min-width: 1024px) {
    .hero-bg-cards {
        gap: 24px;
        max-width: 1150px;
        bottom: -20px;
    }

    .hero-bg-card {
        width: 180px;
        height: 300px;
    }

    .hero-bg-card:nth-child(5) {
        display: block;
        --card-opacity: 0.5;
        animation-delay: 0.25s;
    }

    .hero::before {
        width: 450px;
        height: 450px;
        left: 10%;
        filter: blur(50px);
    }

    .hero::after {
        width: 380px;
        height: 380px;
        right: 10%;
        filter: blur(45px);
    }
}

/* Hero Overlay - Lighter to show more background */
.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg,
            rgba(15, 10, 21, 0.7) 0%,
            rgba(26, 16, 37, 0.3) 40%,
            rgba(13, 10, 16, 0.5) 60%,
            #0a0a0b 88%,
            #0a0a0b 100%);
    z-index: 3;
    /* Ensure it stays on top */
    pointer-events: none;
}

/* Mobile: Extend top gradient 2px down and fix bottom pixel gap */
@media (max-width: 767px) {
    .hero-overlay {
        top: -2px;
        bottom: -1px;
    }

    .hero {
        margin-bottom: -1px;
    }
}


/* Hero Content - Properly Positioned */
.hero-content {
    position: relative;
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    max-width: 600px;
    padding: var(--space-8) var(--space-4);
    margin: 0 auto;
}

/* Hero Title Container */
.hero-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-bottom: var(--space-8);
    /* Smooth animation */
    animation: heroTitleIn 0.9s ease-out 0.2s both;
}

@keyframes heroTitleIn {
    0% {
        opacity: 0;
        transform: translateY(-20px);
        filter: blur(8px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

.hero-title-premium {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.4rem, 5.5vw, 2.4rem);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: rgba(200, 175, 150, 0.85);
    line-height: 1.2;
    text-shadow: 0 2px 20px rgba(200, 180, 150, 0.2);
}

.hero-title-main {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2rem, 10vw, 4rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #ffffff;
    line-height: 1.1;
    margin-top: -2px;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

/* Hero Prompt Container */
.hero-prompt-container {
    background: rgba(30, 30, 30, 0.7);
    border-radius: 24px;
    padding: 5px 16px;
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-5);
    animation: fadeUp 0.7s ease-out 0.5s both;
}

/* Hero Prompt */
.hero-prompt {
    font-family: 'Outfit', sans-serif;
    font-size: var(--text-sm);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.95);
    letter-spacing: 0.02em;
    margin: 0;
}

@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 640px) {
    .hero-prompt {
        font-size: var(--text-base);
    }
}

/* Watch Now Button */
.btn-watch {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    padding: 10px 28px 10px 10px;
    background: var(--gradient-accent);
    border-radius: var(--radius-full);
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: var(--text-base);
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow:
        0 8px 30px rgba(139, 92, 246, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    /* Smooth animation */
    animation: buttonIn 0.6s ease-out 0.7s both;
}

@keyframes buttonIn {
    0% {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.btn-watch:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 14px 40px rgba(139, 92, 246, 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.btn-watch:active {
    transform: translateY(-1px) scale(0.98);
    transition: all 0.1s ease;
}

.btn-watch-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transition: background 0.3s ease;
}

.btn-watch:hover .btn-watch-icon {
    background: rgba(255, 255, 255, 0.28);
}

.btn-watch-icon svg {
    width: 22px;
    height: 22px;
}

.btn-watch-text {
    padding-right: var(--space-1);
}

/* ============ CATEGORIES SECTION ============ */
.categories {
    padding: var(--space-6) var(--space-4);
    margin-bottom: var(--space-2);
    background: var(--color-bg-primary);
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.category-scroll {
    display: flex;
    gap: var(--space-4);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: var(--space-2) 0;
    margin: 0 calc(-1 * var(--space-4));
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

.category-scroll::-webkit-scrollbar {
    display: none;
}

.category-item {
    flex-shrink: 0;
    text-align: center;
    transition: transform 0.3s ease;
}

.category-item:hover {
    transform: translateY(-6px);
}

.category-image {
    width: 100px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-2);
    border: 1px solid var(--color-border);
    transition: all 0.3s ease;
}

.category-item:hover .category-image {
    border-color: var(--color-border-accent);
    box-shadow: 0 10px 30px rgba(139, 92, 246, 0.35);
}

.category-label {
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--color-text-muted);
    transition: color 0.2s ease;
    white-space: nowrap;
}

.category-item:hover .category-label {
    color: var(--color-text-primary);
}

@media (min-width: 640px) {
    .category-image {
        width: 130px;
        height: 78px;
    }

    .category-label {
        font-size: var(--text-sm);
    }
}

/* ============ TEMPLATES SECTION ============ */
.templates {
    padding: 0 var(--space-4);
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}

@media (min-width: 640px) {
    .template-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--space-4);
    }
}

@media (min-width: 1024px) {
    .template-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-5);
    }
}

@media (min-width: 1280px) {
    .template-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ============ SECTION HEADERS ============ */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.section-title {
    font-family: var(--font-heading);
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--color-text-primary);
}

.section-link {
    font-family: var(--font-body);
    font-size: var(--text-sm);
    color: var(--color-purple);
    font-weight: 600;
    transition: all 0.2s ease;
}

.section-link:hover {
    color: var(--color-cyan);
    transform: translateX(3px);
}