/* Mediathek Theme - Minimal Dark Design */
* {box-sizing: border-box}
:root {
    --bg: #0f1115;
    --card: #1b2030;
    --text: #e7e7ea;
    --muted: #9aa3b2;
    --border: #2b3244;
    --brand: #1b48ab;
}
html, body {height: 100%; margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Helvetica, Arial, sans-serif}
a {color: inherit; text-decoration: none}
.container {max-width: 1200px; margin: 0 auto; padding: 20px}
.grid {display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr))}
.card {background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: border-color 0.2s}
.card:hover {border-color: var(--brand)}
.card .thumb {aspect-ratio: 16/9; background: #0b0e17; display: block}
.card .thumb img {width: 100%; height: 100%; object-fit: cover; display: block}
.card .meta {padding: 12px}
.hrow {display: grid; grid-auto-flow: column; grid-auto-columns: clamp(220px, 24vw, 300px); gap: 14px; overflow: auto; scroll-snap-type: x mandatory}
.hrow > * {scroll-snap-align: start}
.header {display: flex; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 16px}
.btn {display: inline-flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: #182032; color: #fff; cursor: pointer; transition: all 0.2s}
.btn:hover {background: #202840; border-color: var(--brand)}
.btn.primary {background: var(--brand); border-color: transparent}
.btn.primary:hover {background: #2554c7}
.btn.active {background: var(--brand); border-color: var(--brand)}
.section {margin-top: 32px}
.subtitle {color: var(--muted); font-size: 14px}
footer {border-top: 1px solid var(--border); margin-top: 36px; padding: 16px; color: var(--muted); font-size: 14px}
.hero {border: 1px solid var(--border); border-radius: 24px; overflow: hidden; background: linear-gradient(135deg, #0f1115, #141a26); margin-bottom: 24px}
.hero-inner {display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 18px; align-items: center; padding: 28px}
.hero h1 {font-size: clamp(28px, 4vw, 44px); margin: 0 0 12px 0}
.hero p {margin: 0 0 20px 0; color: var(--muted)}
.hero .media {aspect-ratio: 16/9; background: #0b0e17; border-radius: 14px; overflow: hidden}
.hero .media img {width: 100%; height: 100%; object-fit: cover; display: block}

/* Hero Slider */
.hero-slider {
    position: relative;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    pointer-events: none;
}

.hero-slide.active {
    opacity: 1;
    position: relative;
    pointer-events: auto;
}

.hero-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.hero-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.hero-dot:hover {
    background: rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.hero-dot.active {
    background: var(--brand);
    border-color: var(--brand);
    box-shadow: 0 0 8px rgba(27, 72, 171, 0.6);
}
.video-wrapper {position: relative; aspect-ratio: 16/9; background: #000; border-radius: 14px; overflow: hidden; margin-bottom: 20px}
.video-wrapper iframe {position: absolute; top: 0; left: 0; width: 100%; height: 100%}
.video-meta h1 {margin: 0 0 12px 0}
.series-link {margin: 12px 0}
.series-link a {color: var(--brand)}
.language-versions {margin-top: 20px}
.lang-buttons {display: flex; gap: 8px; margin-top: 8px}
.tags {display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px}
.tag {padding: 4px 10px; background: var(--border); border-radius: 6px; font-size: 13px}
.series-header {margin-bottom: 24px}
.series-cover {aspect-ratio: 16/9; border-radius: 14px; overflow: hidden; margin-bottom: 16px; max-width: 600px}
.series-cover img {width: 100%; height: 100%; object-fit: cover}
.series-info h1 {margin: 0 0 12px 0}
.error-page {text-align: center; padding: 60px 20px}
.error-page h1 {font-size: 72px; margin: 0; color: var(--muted)}
.error-page h2 {margin: 12px 0}
.error-actions {display: flex; gap: 12px; justify-content: center; margin-top: 24px}
.error-message {background: var(--card); padding: 20px; border-radius: 14px; border: 1px solid var(--border); text-align: center}
/* Locale badges container - for multiple language badges */
.locale-badges-container {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px;
    z-index: 15;
    align-items: center;
    pointer-events: none;
}

/* Locale badge - improved styling */
.locale-badge {
    position: relative;
    background: linear-gradient(135deg, #1b48ab 0%, #2554c7 100%);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(27, 72, 171, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: inline-flex !important;
    flex-shrink: 0;
    white-space: nowrap;
    pointer-events: auto;
    min-width: 28px;
    justify-content: center;
    align-items: center;
}

/* NEW badge - attractive design */
.new-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #ff4757 0%, #ff6348 100%);
    color: #fff;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 13;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 2px 8px rgba(255, 71, 87, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 2px 12px rgba(255, 71, 87, 0.8), 0 1px 3px rgba(0, 0, 0, 0.3);
    }
}

.thumb {position: relative}

/* Episode info */
.episode-info {
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.episode-date {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 14px;
    margin: 0;
}

.episode-date svg {opacity: 0.7}

/* Share section */
.share-section {
    margin: 16px 0;
    display: flex;
    align-items: center;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s;
}

.share-btn:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.share-btn svg {width: 16px; height: 16px}

/* Episodes grid (for all-episodes page) */
.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.page-header {margin-bottom: 32px}
.page-header h1 {margin: 0 0 8px 0}
.page-header .subtitle {color: var(--muted); font-size: 16px; margin: 0}

/* Episode Navigation (Previous/Next) */
.episode-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    max-width: 45%;
}

.nav-btn:hover {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(27, 72, 171, 0.3);
}

.nav-btn svg {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.prev-btn:hover svg {
    transform: translateX(-3px);
}

.next-btn:hover svg {
    transform: translateX(3px);
}

.nav-btn span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Debug mode - uncomment to see badge containers */
/*
.locale-badges-container {
    background: rgba(255, 0, 0, 0.3) !important;
    border: 2px solid red !important;
}
.locale-badge {
    background: rgba(0, 255, 0, 0.8) !important;
}
*/

/* News/RSS Module Styles */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.section-header h2 {
    margin: 0;
    font-size: 28px;
    font-weight: 700;
}

.section-header a {
    color: var(--brand);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    padding: 6px 12px;
    border-radius: 6px;
    background: rgba(27, 72, 171, 0.1);
}

.section-header a:hover {
    background: var(--brand);
    color: #fff;
    transform: translateX(4px);
}

.news-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.news-card:hover {
    border-color: var(--brand);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(27, 72, 171, 0.15);
}

.news-card.featured {
    background: linear-gradient(135deg, rgba(27, 72, 171, 0.1) 0%, rgba(37, 84, 199, 0.05) 100%);
    border-color: rgba(27, 72, 171, 0.3);
    position: relative;
    overflow: hidden;
}

.news-card.featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #ffd700 0%, #ffed4e 100%);
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--muted);
}

.news-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(154, 163, 178, 0.1);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
}

.news-tag.yellow {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 237, 78, 0.1) 100%);
    border-color: rgba(255, 215, 0, 0.3);
    color: #ffd700;
}

.news-card h3 {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
}

.news-card.featured h3 {
    font-size: 24px;
}

.news-card h3 a {
    color: var(--text);
    transition: color 0.2s;
}

.news-card h3 a:hover {
    color: var(--brand);
}

.news-card p {
    margin: 0 0 12px 0;
    color: var(--muted);
    line-height: 1.6;
}

.news-card .read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--brand);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.news-card .read-more:hover {
    gap: 10px;
    color: #2554c7;
}

#aktualnosci {
    margin: 32px 0;
}

@media (max-width: 768px) {
    .hero-inner {grid-template-columns: 1fr; text-align: center}
    .hero .media {display: block}
    .hero-dots {bottom: 8px}
    .hero-dot {width: 8px; height: 8px}
    .grid {grid-template-columns: repeat(auto-fill, minmax(180px, 1fr))}
    .episodes-grid {grid-template-columns: repeat(auto-fill, minmax(200px, 1fr))}
    .locale-badge {font-size: 9px; padding: 4px 7px}
    .new-badge {font-size: 9px; padding: 4px 7px}
    .share-section {flex-direction: column; align-items: flex-start; gap: 8px}
    .episode-navigation {flex-direction: column; gap: 12px}
    .nav-btn {max-width: 100%; width: 100%; justify-content: center}

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .section-header h2 {
        font-size: 24px;
    }

    .news-card.featured h3 {
        font-size: 20px;
    }

    .news-card h3 {
        font-size: 18px;
    }
}
