/* style.css - Jellyfin Offline Mediathek */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #0a0c10 0%, #1a1d24 100%);
    color: #e0e0e0;
    padding: 20px;
    overflow-x: hidden;
}
body.modal-open { overflow: hidden; }
.container { max-width: 1600px; margin: 0 auto; overflow-x: visible; }
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10,12,16,0.85);
    backdrop-filter: blur(12px);
    margin: -20px -20px 20px -20px;
    padding: 20px 20px 0 20px;
}
h1 {
    font-size: 2rem;
    background: linear-gradient(135deg, #fff, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
}
.filter-bar {
    background: rgba(30,35,45,0.5);
    border-radius: 20px;
    padding: 15px 20px;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}
.filter-row, .extended-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}
.search-field, .compact-select, .filter-toggle, #resetFiltersBtn {
    background: #2a2f3a;
    border: 1px solid #404754;
    color: white;
    padding: 8px 16px;
    border-radius: 40px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.search-field {
    width: 260px;
    padding-left: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='rgba(255,255,255,0.7)' stroke-width='1.8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M21 21l-4.35-4.35M19 11a8 8 0 1 1-16 0 8 8 0 0 1 16 0z' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 12px center;
    background-size: 18px;
}
.search-field:focus, .compact-select:focus, .filter-toggle:focus, #resetFiltersBtn:focus {
    border-color: #8b5cf6;
    outline: none;
    box-shadow: 0 0 0 2px rgba(139,92,246,0.3);
}
.filter-toggle {
    background: #8b5cf6;
    border-color: #8b5cf6;
}
.filter-toggle:hover { background: #7c3aed; }
#resetFiltersBtn {
    background: rgba(139,92,246,0.2);
    border-color: #8b5cf6;
}
#resetFiltersBtn:hover { background: rgba(139,92,246,0.4); }
#filterToggleBtn { display: none; }
.extended-filters { display: flex; gap: 12px; align-items: center; }
#libraryFilter[hidden] { display: none; }
.stats {
    font-size: 0.9rem;
    color: #aaa;
    background: rgba(0,0,0,0.3);
    padding: 6px 14px;
    border-radius: 40px;
    white-space: nowrap;
}
.alphabet-nav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    gap: 12px;
    padding: 3px 0;
    margin-top: 5px;
    border-top: 1px solid rgba(255,255,255,0.1);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.alphabet-nav a {
    color: #ccc;
    text-decoration: none;
    font-size: 0.8rem;
    min-width: 36px;
    text-align: center;
    padding: 4px 0;
    border-radius: 12px;
    transition: all 0.2s;
    flex-shrink: 0;
}
.alphabet-nav a:hover { background: #8b5cf6; color: white; }
.content-area { width: 100%; overflow-x: hidden; }
.new-releases {
    background: rgba(0,0,0,0.3);
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 30px;
}
.new-releases-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}
.new-releases-header h2 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}
.new-releases-header h2:before { content: "✨"; font-size: 1.8rem; }
.toggle-icon { font-size: 1.5rem; transition: transform 0.2s; }
.new-releases-content {
    overflow: hidden;
    transition: max-height 0.3s ease;
    max-height: 0;
}
.new-releases-content.open { max-height: 420px; margin-top: 20px; }
.carousel-container {
    display: flex;
    align-items: stretch;
    gap: 12px;
    min-height: 260px;
    padding: 10px 0;
    overflow: visible;
}
.carousel {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 16px;
    flex: 1;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 6px 0;
    touch-action: pan-y;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel .media-card { flex: 0 0 125px; transition: transform 0.2s; }
.carousel .media-card:hover { transform: scale(1.02); }
.carousel .poster { aspect-ratio: 2 / 3; }
.carousel-btn {
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    width: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}
.carousel-btn:hover { background: rgba(139,92,246,0.8); }
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 200px));
    gap: 20px;
    justify-content: center;
}
.media-card {
    position: relative;
    background: rgba(30,35,45,0.7);
    border-radius: 14px;
    overflow: hidden;
    backdrop-filter: blur(8px);
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
    border: 1px solid rgba(255,255,255,0.05);
}
.media-card:hover { transform: translateY(-5px); border-color: #8b5cf6; }
.poster {
    position: relative;
    aspect-ratio: 2 / 3;
    background: #1a1e26;
    display: flex;
    align-items: center;
    justify-content: center;
}
.poster img { width: 100%; height: 100%; object-fit: cover; }
.no-poster { color: #666; font-size: 0.8rem; text-align: center; }
.type-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 2;
}
.type-badge.movie { background: #3b82f6; color: white; }
.type-badge.series { background: #8b5cf6; color: white; }
.media-info { padding: 12px; }
.media-title {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.media-year { font-size: 0.75rem; color: #8b5cf6; margin: 4px 0; }
.media-genres {
    font-size: 0.7rem;
    color: #aaa;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.media-genres span {
    background: rgba(139,92,246,0.2);
    padding: 2px 8px;
    border-radius: 20px;
}
.media-rating {
    display: inline-block;
    background: rgba(0,0,0,0.5);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.7rem;
    margin-top: 6px;
}
.search-highlight {
    background: #8b5cf6;
    color: white;
    border-radius: 4px;
    padding: 0 2px;
}
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background-color: rgba(0,0,0,0.9);
    backdrop-filter: blur(8px);
}
.modal-content {
    background: linear-gradient(135deg, #1e1e2e, #2a2f3a);
    margin: 5% auto;
    padding: 20px;
    border-radius: 24px;
    width: 90%;
    max-width: 800px;
    color: #eee;
    box-shadow: 0 20px 40px rgba(0,0,0,0.5);
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}
.modal-poster {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.modal-poster img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.modal-poster .external-links, .modal-poster .season-summary-clickable {
    text-align: center;
}
.season-summary-clickable {
    margin-top: 8px;
    cursor: pointer;
    background: rgba(139,92,246,0.2);
    border-radius: 40px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: bold;
    transition: background 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
}
.season-summary-clickable:hover { background: rgba(139,92,246,0.5); }
.summary-line-1,
.summary-line-2 {
    display: block;
    width: 100%;
    text-align: center;
}
.toggle-icon-summary {
    margin-top: 4px;
    display: block;
}
.season-details {
    margin-top: 8px;
    font-size: 0.75rem;
    text-align: center;
}
.season-details .season-badge {
    display: inline-block;
    background: rgba(139,92,246,0.2);
    padding: 2px 8px;
    border-radius: 16px;
    margin: 2px;
}
.season-details .specials-badge { background: rgba(59,130,246,0.3); }
.modal-info { flex: 1; min-width: 250px; }
.modal-info h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.modal-badge {
    font-size: 0.8rem;
    font-weight: normal;
    padding: 4px 12px;
    border-radius: 30px;
    background: #3b82f6;
    color: white;
    display: inline-block;
}
.modal-badge.series { background: #8b5cf6; }
.modal-info .meta { color: #8b5cf6; margin-bottom: 12px; font-size: 0.9rem; }
.modal-info .genres {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}
.modal-info .genres span {
    background: rgba(139,92,246,0.3);
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.8rem;
}
.modal-info .rating { font-size: 1rem; margin: 8px 0; }
.modal-info .overview {
    margin-top: 16px;
    line-height: 1.5;
    color: #ccc;
    text-align: justify;
    hyphens: auto;
}
.modal-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
}
.modal-detail-item strong { color: #8b5cf6; margin-right: 8px; }
.status-continuing { color: #4ade80; font-weight: bold; }
.status-ended { color: #f87171; font-weight: bold; }
.status-unknown { color: #9ca3af; font-weight: bold; }
.external-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 8px;
}
.external-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0,0,0,0.5);
    padding: 4px 10px;
    border-radius: 40px;
    text-decoration: none;
    color: #e0e0e0;
    font-size: 0.75rem;
    transition: background 0.2s;
}
.external-link:hover { background: #8b5cf6; color: white; }
.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    transition: 0.2s;
}
.close:hover { color: white; }
.tech-details-toggle {
    background: rgba(139,92,246,0.2);
    border: 1px solid rgba(139,92,246,0.5);
    border-radius: 40px;
    padding: 8px 16px;
    margin: 16px 0 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: background 0.2s;
}
.tech-details-toggle:hover { background: rgba(139,92,246,0.4); }
.tech-details-panel {
    background: rgba(0,0,0,0.3);
    border-radius: 16px;
    padding: 12px;
    margin-top: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
    display: none;
}
.tech-details-panel.show { display: block; }
.section-separator {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin: 16px 0 12px 0;
}
.version-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}
.version-card {
    flex: 1 1 240px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    padding: 10px;
}
.version-card:last-child { margin-bottom: 0; }
.version-resolution { font-weight: bold; color: #8b5cf6; }
.version-languages { margin-top: 4px; color: #ccc; font-size: 0.8rem; }
.version-subtitles { margin-top: 2px; color: #aaa; font-size: 0.8rem; }
.fsk-badge {
    background: rgba(220,38,38,0.8);
    color: white;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 0.75rem;
    display: inline-block;
    margin-right: 8px;
}
.random-btn {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border: none;
    color: white;
    font-size: 1rem;
    padding: 8px 16px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.1s ease, background 0.2s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 6px;
}
.random-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    transform: scale(1.02);
}
.random-btn:active {
    transform: scale(0.98);
}
@media (max-width: 640px) {
    body { padding: 12px; }
    .sticky-header { margin: -12px -12px 12px -12px; padding: 12px 12px 0 12px; }
    h1 { font-size: 1.5rem; margin-bottom: 12px; }
    .filter-bar { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px; margin-bottom: 12px; }
    .filter-row { flex-wrap: wrap; justify-content: space-between; }
    .search-field { flex: 2; min-width: 120px; width: auto; }
    .compact-select { flex: 1; min-width: 80px; }
    #filterToggleBtn { display: flex; flex: 0 0 auto; background: #8b5cf6; padding: 8px 12px; }
    .extended-filters { display: none; flex-direction: column; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.1); }
    .extended-filters.show { display: flex; }
    .extended-filters .compact-select, .extended-filters #resetFiltersBtn { width: 100%; }
    .stats { text-align: center; font-size: 0.8rem; padding: 4px 10px; margin-top: 4px; white-space: normal; }
    .alphabet-nav { gap: 6px 10px; padding: 6px 0 12px; }
    .alphabet-nav a { font-size: 0.8rem; min-width: 30px; }
    .media-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 160px)); gap: 12px; }
    .modal-content { flex-direction: column; align-items: center; text-align: center; margin: 10% auto; width: 95%; }
    .modal-poster { flex: 0 0 auto; width: 160px; }
    .modal-info h2 { justify-content: center; font-size: 1.4rem; }
    .carousel .media-card { flex: 0 0 110px; }
    .carousel-btn { width: 32px; font-size: 1.2rem; }
    .new-releases-content.open { max-height: 380px; }
    .random-btn { padding: 6px 12px; font-size: 0.85rem; }
}
@media (min-width: 641px) {
    .filter-bar { flex-wrap: wrap !important; gap: 16px; }
    .filter-row, .extended-filters { flex: 2 1 auto; }
    .compact-select, .search-field { min-width: 140px; }
    .search-field { min-width: 240px; }
    .stats { flex: 0 0 auto; }
}
