/* © HorrorJunk */
/* coded by nya & suzunay */

/* ===== Categories Section ===== */
.categories-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 48px 24px;
    position: relative;
}

.section-header {
    font-family: Outfit, sans-serif;
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.section-header::before {
    content: '';
    width: 4px;
    height: 28px;
    background: #00a3ff;
    border-radius: 2px;
    flex-shrink: 0;
}

/* ===== Bento Grid ===== */
.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 220px;
    gap: 16px;
    position: relative;
}

/* Erste 2 Cards: breit (2 Spalten) */
.card:nth-child(1),
.card:nth-child(2) {
    grid-column: span 2;
    grid-row: span 2;
}

/* ===== Card Base ===== */
.card {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.35s ease,
                border-color 0.35s ease;
    will-change: transform;
    contain: layout style;
}

.card:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}

.card a {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

/* ===== Card Image ===== */
.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                filter 0.4s ease;
    filter: brightness(0.6) saturate(0.9);
    will-change: transform;
}

.card:hover img {
    transform: scale(1.08);
    filter: brightness(0.45) saturate(1.1);
}

/* ===== Card Overlay ===== */
.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        transparent 30%,
        rgba(0, 0, 0, 0.7) 70%,
        rgba(0, 0, 0, 0.92) 100%
    );
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
    transition: background 0.4s ease;
}

.card:hover .card-overlay {
    background: linear-gradient(
        160deg,
        transparent 20%,
        rgba(0, 0, 0, 0.75) 65%,
        rgba(0, 0, 0, 0.95) 100%
    );
}

/* Featured cards get more padding */
.card:nth-child(1) .card-overlay,
.card:nth-child(2) .card-overlay {
    padding: 36px;
}

/* ===== Card Title ===== */
.card-title {
    font-family: Outfit, sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

/* Featured cards bigger title */
.card:nth-child(1) .card-title,
.card:nth-child(2) .card-title {
    font-size: 1.6rem;
    letter-spacing: 3px;
}

/* ===== Accent Line ===== */
.card-title::after {
    content: '';
    display: block;
    width: 0;
    height: 2px;
    background: var(--cat-color, #00a3ff);
    border-radius: 1px;
    margin-top: 10px;
    transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card:hover .card-title::after {
    width: 48px;
}

.card:nth-child(1):hover .card-title::after,
.card:nth-child(2):hover .card-title::after {
    width: 72px;
}

/* ===== Card Subtitle ===== */
.card-subtitle {
    font-family: Outfit, sans-serif;
    font-size: 0.82rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.3px;
    margin-top: 4px;
}

.card:hover .card-subtitle {
    color: rgba(255, 255, 255, 0.7);
}

/* ===== Card Arrow ===== */
.card-arrow {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    transition: all 0.3s ease;
    z-index: 2;
    opacity: 0;
    transform: translateX(-4px);
}

.card:hover .card-arrow {
    opacity: 1;
    transform: translateX(0);
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

/* ===== Genre Color Variables (Horror Subgenres) ===== */
.card[data-genre="slasher"] { --cat-color: #ef4444; }
.card[data-genre="zombies"] { --cat-color: #22c55e; }
.card[data-genre="vampire"] { --cat-color: #dc2626; }
.card[data-genre="aliens"] { --cat-color: #06b6d4; }
.card[data-genre="clowns"] { --cat-color: #facc15; }
.card[data-genre="dolls"] { --cat-color: #a855f7; }
.card[data-genre="werewolves"] { --cat-color: #d97706; }
.card[data-genre="cannibals"] { --cat-color: #ef4444; }
.card[data-genre="psycho"] { --cat-color: #ec4899; }
.card[data-genre="cults"] { --cat-color: #6366f1; }
.card[data-genre="found_footage"] { --cat-color: #94a3b8; }
.card[data-genre="witches"] { --cat-color: #84cc16; }
.card[data-genre="body_horror"] { --cat-color: #f97316; }
.card[data-genre="revenge"] { --cat-color: #dc2626; }
.card[data-genre="social_media"] { --cat-color: #38bdf8; }
.card[data-genre="spiders"] { --cat-color: #10b981; }
.card[data-genre="christmas"] { --cat-color: #ef4444; }
.card[data-genre="cinema"] { --cat-color: #eab308; }
.card[data-genre="animal_horror"] { --cat-color: #d97706; }
.card[data-genre="supernatural"] { --cat-color: #a855f7; }
.card[data-genre="sharks"] { --cat-color: #3b82f6; }
.card[data-genre="all_horror_movies"], .card[data-genre="alle_serien"] { --cat-color: #00a3ff; }

/* Plattformen */
.card[data-genre="netflix"] { --cat-color: #e50914; }
.card[data-genre="disney_plus"] { --cat-color: #113ccf; }
.card[data-genre="amazon_prime"] { --cat-color: #00a8e1; }

/* Spiele */
.card[data-genre="survival-horror"] { --cat-color: #ef4444; }
.card[data-genre="psychological-horror"] { --cat-color: #a855f7; }
.card[data-genre="action-horror"] { --cat-color: #f97316; }
.card[data-genre="indie-horror"] { --cat-color: #22c55e; }
.card[data-genre="coop-horror"] { --cat-color: #38bdf8; }
.card[data-genre="sci-fi-horror"] { --cat-color: #06b6d4; }
.card[data-genre="zombie-horror"] { --cat-color: #22c55e; }
.card[data-genre="gothic-horror"] { --cat-color: #6366f1; }
.card[data-genre="supernatural-horror"] { --cat-color: #a855f7; }
.card[data-genre="stealth-horror"] { --cat-color: #94a3b8; }
.card[data-genre="open-world-horror"] { --cat-color: #10b981; }

/* Bücher */
.card[data-genre="alle-horror-buecher"] { --cat-color: #00a3ff; }
.card[data-genre="uebernatuerliches"] { --cat-color: #a855f7; }
.card[data-genre="psycho-horror"] { --cat-color: #ec4899; }
.card[data-genre="geister"] { --cat-color: #94a3b8; }
.card[data-genre="kosmischer-horror"] { --cat-color: #6366f1; }
.card[data-genre="body-horror"] { --cat-color: #f97316; }
.card[data-genre="okkultismus"] { --cat-color: #dc2626; }
.card[data-genre="dystopie"] { --cat-color: #06b6d4; }

/* Glow on hover for genre color */
.card:hover {
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.5),
        0 0 30px color-mix(in srgb, var(--cat-color, #00a3ff) 15%, transparent);
}

/* ===== Front Page Cards ===== */
.categories-section > .grid > .card:nth-child(1) { --cat-color: #ef4444; }
.categories-section > .grid > .card:nth-child(2) { --cat-color: #3b82f6; }
.categories-section > .grid > .card:nth-child(3) { --cat-color: #22c55e; }
.categories-section > .grid > .card:nth-child(4) { --cat-color: #f59e0b; }

/* ===== Responsive ===== */
@media (max-width: 1200px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 200px;
    }
    .card:nth-child(1) {
        grid-column: span 2;
        grid-row: span 2;
    }
    .card:nth-child(2) {
        grid-column: span 1;
        grid-row: span 2;
    }
}

@media (max-width: 900px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 180px;
    }
    .card:nth-child(1),
    .card:nth-child(2) {
        grid-column: span 2;
        grid-row: span 1;
    }
    .card:nth-child(1) .card-title,
    .card:nth-child(2) .card-title {
        font-size: 1.3rem;
    }
    .card-overlay { padding: 20px; }
    .card-arrow { opacity: 1; transform: none; }
}

@media (max-width: 640px) {
    .categories-section {
        padding: 24px 16px;
    }
    .grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 160px;
        gap: 10px;
    }
    .card:nth-child(1),
    .card:nth-child(2) {
        grid-column: span 1;
        grid-row: span 1;
    }
    .card-title {
        font-size: 0.9rem;
        letter-spacing: 1.5px;
    }
    .card:nth-child(1) .card-title,
    .card:nth-child(2) .card-title {
        font-size: 0.9rem;
        letter-spacing: 1.5px;
    }
    .card-overlay { padding: 14px; }
    .card-arrow { display: none; }
    .section-header { font-size: 1.4rem; margin-bottom: 20px; }
}

@media (min-width: 2560px) {
    .categories-section { max-width: 1800px; }
    .grid { grid-auto-rows: 280px; }
    .card-title { font-size: 1.3rem; }
    .card:nth-child(1) .card-title,
    .card:nth-child(2) .card-title { font-size: 2rem; }
}

@media (min-width: 3840px) {
    .categories-section { max-width: 2400px; }
    .grid { grid-auto-rows: 360px; }
    .card-title { font-size: 1.6rem; }
    .card:nth-child(1) .card-title,
    .card:nth-child(2) .card-title { font-size: 2.5rem; }
}
