/* © WatchJunk */
/* 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.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.3s ease,
                border-color 0.3s ease;
    contain: layout style paint;
}

.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.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.3s ease;
    filter: brightness(0.6) saturate(0.9);
}

.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;
}

.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: 48px;
    height: 2px;
    background: var(--cat-color, #00a3ff);
    border-radius: 1px;
    margin-top: 10px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card:hover .card-title::after {
    transform: scaleX(1);
}

.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;
    transition: color 0.3s ease;
}

.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(30, 30, 40, 0.75);
    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: opacity 0.25s ease, transform 0.25s ease, background 0.25s ease, color 0.25s ease;
    z-index: 2;
    opacity: 0;
    transform: translateX(-4px);
}

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

/* ===== Genre Color Variables ===== */
.card[data-genre="action"] { --cat-color: #f97316; }
.card[data-genre="komoedie"] { --cat-color: #facc15; }
.card[data-genre="drama"] { --cat-color: #3b82f6; }
.card[data-genre="thriller"] { --cat-color: #dc2626; }
.card[data-genre="science-fiction"] { --cat-color: #06b6d4; }
.card[data-genre="fantasy"] { --cat-color: #a855f7; }
.card[data-genre="liebesfilm"], .card[data-genre="romantik"] { --cat-color: #ec4899; }
.card[data-genre="animation"] { --cat-color: #22c55e; }
.card[data-genre="dokumentarfilm"], .card[data-genre="dokumentation"] { --cat-color: #d97706; }
.card[data-genre="krimi"] { --cat-color: #94a3b8; }
.card[data-genre="mystery"] { --cat-color: #6366f1; }
.card[data-genre="abenteuer"], .card[data-genre="adventure"] { --cat-color: #10b981; }
.card[data-genre="kriegsfilm"] { --cat-color: #84cc16; }
.card[data-genre="western"] { --cat-color: #d4a24c; }
.card[data-genre="musik"] { --cat-color: #d946ef; }
.card[data-genre="familie"] { --cat-color: #38bdf8; }
.card[data-genre="historie"] { --cat-color: #eab308; }
.card[data-genre="marvel"] { --cat-color: #ef4444; }
.card[data-genre="dc"] { --cat-color: #3b82f6; }
.card[data-genre="superhelden"] { --cat-color: #f59e0b; }
.card[data-genre="rpg"] { --cat-color: #a855f7; }
.card[data-genre="strategie"] { --cat-color: #6366f1; }
.card[data-genre="simulation"] { --cat-color: #06b6d4; }
.card[data-genre="sport"] { --cat-color: #22c55e; }
.card[data-genre="rennspiele"] { --cat-color: #f97316; }
.card[data-genre="puzzle"] { --cat-color: #eab308; }
.card[data-genre="plattformer"] { --cat-color: #ec4899; }
.card[data-genre="shooter"] { --cat-color: #ef4444; }
.card[data-genre="fighting"] { --cat-color: #dc2626; }
.card[data-genre="sachbuch"] { --cat-color: #d97706; }
.card[data-genre="biografie"] { --cat-color: #f59e0b; }
.card[data-genre="lyrik"] { --cat-color: #d946ef; }

/* 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="supernatural"] { --cat-color: #6366f1; }
.card[data-genre="psycho"] { --cat-color: #ec4899; }
.card[data-genre="witches"] { --cat-color: #84cc16; }

/* 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 (Serien/Filme/Spiele/Bücher) ===== */
.categories-section > .grid > .card:nth-child(1) { --cat-color: #3b82f6; }
.categories-section > .grid > .card:nth-child(2) { --cat-color: #ef4444; }
.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; }
}
