/* Age Rating Badges */
.age-rating-badge {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    min-width: 1.5rem;
    color: white;
}

.age-rating-L {
    background-color: #28a745;
}

.age-rating-10 {
    background-color: #17a2b8;
}

.age-rating-12 {
    background-color: #ffc107;
    color: #000;
}

.age-rating-14 {
    background-color: #fd7e14;
}

.age-rating-16 {
    background-color: #dc3545;
}

.age-rating-18 {
    background-color: #000000;
}

/* Search Modal */
.search-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 200;
    display: none;
    align-items: flex-start;
    padding-top: 100px;
}

.search-modal.active {
    display: flex;
}

.search-modal-content {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 2rem;
}

.search-input-large {
    width: 100%;
    padding: 1.5rem 4rem 1.5rem 2rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1.5rem;
    outline: none;
    transition: border-color 0.3s;
}

.search-input-large:focus {
    border-color: var(--primary);
}

.search-close {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    font-size: 2rem;
    line-height: 1;
}

.search-close:hover {
    color: var(--text-primary);
}

.search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
}

.search-loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.search-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

/* Watchlist Button on Cards */
.watchlist-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 10;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    color: white;
}

.watchlist-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.1);
}

.watchlist-btn.active {
    background: var(--primary);
    border-color: var(--primary);
}

.watchlist-btn svg {
    width: 20px;
    height: 20px;
}

/* Watchlist Button in Detail Pages - Small and Discrete */
.movie-meta .watchlist-btn,
.series-meta .watchlist-btn,
.anime-meta .watchlist-btn {
    position: static;
    width: auto;
    height: auto;
    padding: 0.25rem 0.6rem;
    border-radius: 0.35rem;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-left: 0.5rem;
}

.movie-meta .watchlist-btn .icon,
.series-meta .watchlist-btn .icon,
.anime-meta .watchlist-btn .icon {
    font-size: 1rem;
    line-height: 1;
}

.movie-meta .watchlist-btn:hover,
.series-meta .watchlist-btn:hover,
.anime-meta .watchlist-btn:hover {
    transform: none;
    background: var(--primary);
    border-color: var(--primary);
}

/* Watchlist Modal */
.watchlist-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.watchlist-modal.active {
    display: flex;
}

.watchlist-modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 400px;
    width: 100%;
    position: relative;
}

.watchlist-modal h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: white !important;
}

.watchlist-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.watchlist-option {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s;
    color: white !important;
}

.watchlist-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    padding: 0.5rem;
}

.modal-close-btn:hover {
    color: var(--text-primary);
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--bg-card);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 300;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid #28a745;
}

.toast.error {
    border-left: 4px solid #dc3545;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .search-modal {
        padding-top: 80px;
    }

    .search-input-large {
        font-size: 1.2rem;
        padding: 1rem 3rem 1rem 1.5rem;
    }

    .watchlist-modal-content {
        max-width: 95%;
        padding: 1.5rem;
    }

    .watchlist-modal h3 {
        font-size: 1.3rem;
    }

    .watchlist-option {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .search-input-large {
        font-size: 1rem;
        padding: 0.875rem 2.5rem 0.875rem 1rem;
    }

    .search-results {
        gap: 0.75rem;
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}
/* FORCE OVERRIDE FOR BADGES AND WATCHLIST - APPLIED BY ANTIGRAVITY */
.card-badges {
    top: auto !important;
    bottom: 0.5rem !important;
    left: 0.5rem !important;
    flex-direction: row !important;
    gap: 0.25rem !important;
}

.badge {
    font-size: 0.6rem !important;
    padding: 0.15rem 0.4rem !important;
}

.watchlist-btn {
    position: absolute !important;
    bottom: 0.5rem !important;
    /* Reset top from extras */
    top: auto !important; 
    right: 0.5rem !important;
    z-index: 20 !important;
    opacity: 0 !important;
    transition: opacity 0.2s !important;
    background: rgba(0,0,0,0.7) !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
    border-radius: 50% !important;
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
}

.content-card:hover .watchlist-btn {
    opacity: 1 !important;
}

.watchlist-btn svg {
    width: 14px !important;
    height: 14px !important;
}

/* Pagination Custom Styles - Global */
.pagination-container nav {
    display: flex;
    justify-content: center;
    width: 100%;
}

.pagination-container .pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
}

.pagination-container a,
.pagination-container span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s;
    text-decoration: none;
    font-weight: 600;
    min-width: 40px;
    height: 40px;
}

.pagination-container a:hover,
.pagination-container span:hover:not([aria-current="page"]):not([aria-disabled="true"]) {
    background: rgba(229, 9, 20, 0.2);
    border-color: var(--primary);
    color: var(--primary);
}

.pagination-container .active span,
.pagination-container span[aria-current="page"] {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.pagination-container span[aria-disabled="true"],
.pagination-container .disabled span {
    background: transparent;
    border-color: transparent;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-container svg {
    width: 1.25rem;
    height: 1.25rem;
}

/* TMDB Search Modal Styles */
.tmdb-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; display: none;
}
.tmdb-modal-content {
    background: #1a1a1a;
    width: 90%; max-width: 800px;
    padding: 2rem; border-radius: 1rem;
    max-height: 80vh; overflow-y: auto;
}
.tmdb-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem; margin-top: 1rem;
}
.tmdb-card {
    background: #2a2a2a; border-radius: 0.5rem; overflow: hidden;
    cursor: pointer; transition: 0.2s;
}
.tmdb-card:hover { transform: translateY(-3px); background: #333; }
.tmdb-card img { width: 100%; height: 200px; object-fit: cover; }
.tmdb-card-body { padding: 0.5rem; font-size: 0.85rem; }

/* Content Detail Page (TMDB Style) */
.content-detail-container {
    padding-top: 0;
}

.content-backdrop-wrap {
    position: relative;
    height: 400px;
    background: #050b13;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.content-backdrop-img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    filter: brightness(0.4);
}

.content-backdrop-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, #0f172a 0%, rgba(15, 23, 42, 0.4) 100%);
}

.content-info-flex {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 2rem;
    display: flex;
    gap: 2rem;
    align-items: flex-end;
    width: 100%;
}

.content-detail-poster {
    width: 200px;
    border-radius: 1rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 10;
}

.content-detail-text {
    color: #fff;
    flex: 1;
}

.content-meta-pills {
    display: flex;
    gap: 0.5rem;
    margin: 0.5rem 0;
    flex-wrap: wrap;
}

.meta-pill {
    background: rgba(255,255,255,0.1);
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    border: 1px solid rgba(255,255,255,0.1);
}

.cast-grid-front {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.cast-item-front {
    background: rgba(255,255,255,0.03);
    border-radius: 0.75rem;
    overflow: hidden;
    text-align: center;
    padding-bottom: 0.5rem;
}

.cast-item-front img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

@media (max-width: 768px) {
    .content-info-flex {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .content-backdrop-wrap { height: 300px; }
}

/* Improved Hero and Buttons */
.hero-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-premium {
    padding: 0.75rem 2rem;
    border-radius: 999px;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.btn-premium-primary {
    background: #e50914;
    color: white;
    border: none;
}
.btn-premium-primary:hover {
    background: #ff0a16;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.4);
}

.btn-premium-outline {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
}
.btn-premium-outline:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: white;
    transform: scale(1.05);
}

/* Season/Episode List Styling */
.season-section {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    margin-bottom: 1rem;
    overflow: hidden;
}

.season-header {
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}
.season-header:hover { background: rgba(255, 255, 255, 0.08); }

.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.episode-card-new {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0.5rem;
    overflow: hidden;
    text-decoration: none;
    color: white;
    transition: background 0.2s, transform 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.episode-card-new:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}
.episode-card-new .img-wrap {
    height: 120px;
    background: #1e293b;
    position: relative;
}
.episode-card-new img { width: 100%; height: 100%; object-fit: cover; }
.episode-card-content { padding: 0.75rem; }
.episode-card-title { font-weight: 500; font-size: 0.9rem; }

/* Collapsible Synopsis */
.synopsis-text {
    position: relative;
    max-height: 4.8em; /* 3 lines approx */
    overflow: hidden;
    transition: max-height 0.3s ease;
    line-height: 1.6;
}
.synopsis-text.collapsed {
    max-height: 4.8em;
}
.synopsis-text:not(.collapsed) {
    max-height: 2000px;
}
.read-more-btn {
    color: #e50914;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-block;
    margin-top: 0.5rem;
}

/* Premium Comments Section */
.comments-section-v2 {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1.5rem;
    padding: 2rem;
    margin-top: 3rem;
}
.comment-form-v2 {
    display: flex;
    gap: 1rem;
    margin-bottom: 2.5rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem;
    border-radius: 1rem;
    align-items: flex-start;
}
.comment-form-v2 textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 0.5rem;
    resize: none;
    outline: none;
}
.comment-form-v2 button {
    background: #e50914;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-weight: 600;
    transition: 0.3s;
}
.comment-form-v2 button:hover { transform: scale(1.05); background: #ff0a16; }

.comment-item-v2 {
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.comment-item-v2:last-child { border-bottom: none; }
.comment-user-v2 {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.comment-user-v2 strong { color: rgba(255, 255, 255, 0.9); font-size: 0.95rem; }
.comment-user-v2 span { color: rgba(255, 255, 255, 0.4); font-size: 0.8rem; }
.comment-content-v2 { color: rgba(255, 255, 255, 0.7); font-size: 1rem; line-height: 1.5; }

/* New Comments UI v3 */
.comments-container-v3 {
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    padding: 24px;
    margin-top: 40px;
}

.comment-header-v3 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.comment-avatar-v3 {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #1a1a1a;
}

.comment-form-v3 {
    background: #111;
    border: 1px solid #222;
    border-radius: 10px;
    padding: 16px;
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}

.comment-form-v3 textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: #eee;
    resize: none;
    outline: none;
    font-size: 0.95rem;
}

.comment-form-v3 button {
    background: #e50914;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    align-self: flex-end;
}

.comment-item-v3 {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid #1a1a1a;
}

.comment-item-v3:last-child {
    border-bottom: none;
}

.comment-info-v3 {
    flex: 1;
}

.comment-author-row-v3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.comment-author-name-v3 {
    font-weight: 600;
    color: #fff;
}

.comment-date-v3 {
    color: #666;
    font-size: 0.8rem;
}

.comment-badge-v3 {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 700;
}

.badge-admin { background: #ff0055; color: white; }
.badge-mod { background: #9d00ff; color: white; }

.comment-text-v3 {
    color: #ccc;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Fix backdrop opacity */
.content-backdrop-overlay {
    background: linear-gradient(0deg, #0f172a 0%, rgba(15, 23, 42, 0.7) 100%) !important;
}
