/**
 * TV App Builder - Embed Player Styles
 * Version 1.0.0
 */

/* Container */
.tvab-embed-container {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.5;
    color: #0f172a;
    max-width: 100%;
    padding: 24px 0;
}

.tvab-embed-container[data-theme="dark"] {
    color: #f1f5f9;
}

.tvab-embed-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Loading State */
.tvab-loading {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.tvab-loading[data-theme="dark"] {
    color: #94a3b8;
}

.tvab-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto 16px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--brand-color, #7c3aed);
    border-radius: 50%;
    animation: tvab-spin 0.8s linear infinite;
}

@keyframes tvab-spin {
    to { transform: rotate(360deg); }
}

/* Empty & Error States */
.tvab-empty-state,
.tvab-error-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.tvab-embed-container[data-theme="dark"] .tvab-empty-state,
.tvab-embed-container[data-theme="dark"] .tvab-error-state {
    color: #94a3b8;
}

.tvab-empty-state i,
.tvab-error-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.tvab-error-state i {
    color: #ef4444;
}

/* Search Bar */
.tvab-search-container {
    margin-bottom: 24px;
}

.tvab-search-wrapper {
    position: relative;
    max-width: 500px;
}

.tvab-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 14px;
    pointer-events: none;
    z-index: 1;
}

.tvab-search-input {
    width: 100%;
    padding: 14px 48px 14px 16px;
    font-size: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    color: #0f172a;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    font-family: inherit;
    text-indent: 20px;
}

.tvab-search-input::placeholder {
    color: #94a3b8;
}

.tvab-search-input:focus {
    border-color: var(--brand-color, #7c3aed);
    background: white;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

.tvab-embed-container[data-theme="dark"] .tvab-search-input {
    background: #334155;
    border-color: #475569;
    color: #f1f5f9;
}

.tvab-embed-container[data-theme="dark"] .tvab-search-input:focus {
    background: #1e293b;
    border-color: var(--brand-color, #7c3aed);
}

.tvab-embed-container[data-theme="dark"] .tvab-search-icon {
    color: #64748b;
}

.tvab-search-clear {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    background: #e2e8f0;
    border: none;
    border-radius: 8px;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.tvab-search-clear i {
    line-height: 1;
    display: block;
}

.tvab-search-clear:hover {
    background: #cbd5e1;
    color: #0f172a;
}

.tvab-embed-container[data-theme="dark"] .tvab-search-clear {
    background: #475569;
    color: #94a3b8;
}

.tvab-embed-container[data-theme="dark"] .tvab-search-clear:hover {
    background: #64748b;
    color: #f1f5f9;
}

/* Search Results */
.tvab-search-results {
    min-height: 200px;
}

.tvab-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
}

.tvab-embed-container[data-theme="dark"] .tvab-no-results {
    color: #94a3b8;
}

.tvab-no-results i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.tvab-no-results p {
    font-size: 16px;
}

.tvab-card-category {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}

.tvab-embed-container[data-theme="dark"] .tvab-card-category {
    color: #94a3b8;
}

/* Category Section */
.tvab-category-section {
    margin-bottom: 32px;
}

.tvab-category-section:last-child {
    margin-bottom: 0;
}

.tvab-category-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tvab-category-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--brand-color, #7c3aed);
    border-radius: 2px;
}

/* Grid Layout */
.tvab-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.tvab-content-card {
    background: #f8fafc;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.tvab-embed-container[data-theme="dark"] .tvab-content-card {
    background: #334155;
}

.tvab-content-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.tvab-card-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.tvab-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.tvab-content-card:hover .tvab-card-thumbnail img {
    transform: scale(1.05);
}

.tvab-card-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.tvab-card-info {
    padding: 14px;
}

.tvab-card-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* List Layout */
.tvab-content-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tvab-content-item {
    display: flex;
    gap: 16px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.tvab-embed-container[data-theme="dark"] .tvab-content-item {
    background: #334155;
}

.tvab-content-item:hover {
    background: #f1f5f9;
}

.tvab-embed-container[data-theme="dark"] .tvab-content-item:hover {
    background: #475569;
}

.tvab-item-thumbnail {
    width: 160px;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.tvab-item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tvab-item-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.tvab-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.tvab-item-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.tvab-item-meta {
    font-size: 13px;
    color: #64748b;
}

.tvab-embed-container[data-theme="dark"] .tvab-item-meta {
    color: #94a3b8;
}

/* Carousel Layout */
.tvab-carousel-wrapper {
    position: relative;
    padding: 0 48px;
}

.tvab-content-carousel {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 8px 0;
}

.tvab-content-carousel::-webkit-scrollbar {
    display: none;
}

.tvab-carousel-item {
    flex: 0 0 300px;
    scroll-snap-align: start;
    background: #f8fafc;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tvab-embed-container[data-theme="dark"] .tvab-carousel-item {
    background: #334155;
}

.tvab-carousel-item:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.tvab-carousel-thumbnail {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.tvab-carousel-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tvab-carousel-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.tvab-carousel-info {
    padding: 14px;
}

.tvab-carousel-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tvab-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: all 0.2s;
    z-index: 10;
}

.tvab-carousel-btn i {
    line-height: 1;
    display: block;
}

.tvab-embed-container[data-theme="dark"] .tvab-carousel-btn {
    background: #1e293b;
    border-color: #475569;
    color: #94a3b8;
}

.tvab-carousel-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

.tvab-embed-container[data-theme="dark"] .tvab-carousel-btn:hover {
    background: #334155;
    border-color: #64748b;
    color: #f1f5f9;
}

.tvab-carousel-prev {
    left: 0;
}

.tvab-carousel-next {
    right: 0;
}

/* Play Overlay */
.tvab-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: var(--brand-color, #7c3aed);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
}

.tvab-content-card:hover .tvab-play-overlay,
.tvab-content-item:hover .tvab-play-overlay,
.tvab-carousel-item:hover .tvab-play-overlay {
    opacity: 1;
}

.tvab-play-overlay i {
    margin-left: 3px;
}

/* Modal */
.tvab-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}

.tvab-modal-open {
    display: flex;
}

.tvab-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
}

.tvab-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 1;
}

.tvab-modal-close {
    position: absolute;
    top: -48px;
    right: 0;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.tvab-modal-close:hover {
    opacity: 0.7;
}

.tvab-modal-body {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

.tvab-modal-video {
    display: block;
    max-width: 100%;
    max-height: 80vh;
}

.tvab-modal-audio {
    display: block;
    width: 400px;
    max-width: 100%;
    margin: 40px;
}

/* Responsive */
@media (max-width: 768px) {
    .tvab-content-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 12px;
    }

    .tvab-content-item {
        flex-direction: column;
        gap: 12px;
    }

    .tvab-item-thumbnail {
        width: 100%;
    }

    .tvab-carousel-wrapper {
        padding: 0 32px;
    }

    .tvab-carousel-item {
        flex: 0 0 260px;
    }

    .tvab-carousel-btn {
        width: 32px;
        height: 32px;
    }

    .tvab-play-overlay {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .tvab-embed-container {
        padding: 16px 0;
    }

    .tvab-category-section {
        margin-bottom: 24px;
    }

    .tvab-category-title {
        font-size: 16px;
    }

    .tvab-content-grid {
        grid-template-columns: 1fr;
    }

    .tvab-carousel-wrapper {
        padding: 0 24px;
    }

    .tvab-carousel-item {
        flex: 0 0 220px;
    }
}

/* ============================================
   HERO LAYOUT
   ============================================ */

.tvab-hero-banner {
    position: relative;
    width: 100%;
    aspect-ratio: 21/9;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 32px;
    cursor: pointer;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

.tvab-hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    transition: opacity 0.3s, transform 0.5s;
}

.tvab-hero-banner:hover .tvab-hero-image {
    opacity: 0.5;
    transform: scale(1.02);
}

.tvab-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 50%, transparent 100%);
}

.tvab-hero-badge {
    display: inline-block;
    padding: 6px 12px;
    color: white;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.tvab-hero-title {
    font-size: 32px;
    font-weight: 800;
    color: white;
    margin: 0 0 8px 0;
    line-height: 1.2;
}

.tvab-hero-description {
    font-size: 16px;
    color: rgba(255,255,255,0.8);
    max-width: 600px;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tvab-hero-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    transition: transform 0.3s, box-shadow 0.3s;
}

.tvab-hero-play-btn i {
    margin-left: 4px;
}

.tvab-hero-banner:hover .tvab-hero-play-btn {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}

.tvab-hero-duration {
    position: absolute;
    top: 20px;
    right: 20px;
    padding: 6px 12px;
    background: rgba(0,0,0,0.7);
    color: white;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

/* Responsive Hero */
@media (max-width: 768px) {
    .tvab-hero-banner {
        aspect-ratio: 16/9;
    }

    .tvab-hero-overlay {
        padding: 20px;
    }

    .tvab-hero-title {
        font-size: 20px;
    }

    .tvab-hero-description {
        font-size: 14px;
    }

    .tvab-hero-play-btn {
        width: 60px;
        height: 60px;
        font-size: 22px;
    }
}

/* ============================================
   CINEMATIC MODAL
   ============================================ */

.tvab-cinematic-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    background: rgba(0,0,0,0.95);
    backdrop-filter: blur(10px);
}

.tvab-cinematic-modal.tvab-modal-open {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: tvab-modal-fade-in 0.3s ease;
}

@keyframes tvab-modal-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tvab-cinematic-modal .tvab-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 10;
    aspect-ratio: 1 / 1;
    padding: 0;
}

.tvab-cinematic-modal .tvab-modal-close:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.1);
}

.tvab-cinematic-modal .tvab-modal-content {
    width: 90%;
    max-width: 1100px;
    animation: tvab-modal-slide-up 0.4s ease;
}

@keyframes tvab-modal-slide-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tvab-modal-video-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0,0,0,0.5);
}

.tvab-modal-iframe,
.tvab-modal-video {
    width: 100%;
    height: 100%;
    border: none;
}

.tvab-audio-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
    gap: 24px;
}

.tvab-audio-player i {
    font-size: 64px;
    color: rgba(255,255,255,0.3);
}

.tvab-modal-audio {
    width: 80%;
    max-width: 500px;
}

.tvab-no-video {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #64748b;
    gap: 16px;
}

.tvab-no-video i {
    font-size: 48px;
}

.tvab-modal-info {
    padding: 24px 0;
    color: white;
}

.tvab-modal-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #ffffff !important;
}

.tvab-modal-description {
    font-size: 15px;
    color: rgba(255,255,255,0.85);
    line-height: 1.6;
    max-width: 800px;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

.tvab-modal-description::-webkit-scrollbar {
    width: 4px;
}

.tvab-modal-description::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 2px;
}

.tvab-modal-description::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}

/* HTML Embed Wrapper (for custom embed codes) */
.tvab-embed-html-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.tvab-embed-html-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Category label in modal context */
.tvab-cinematic-modal .tvab-category-title,
.tvab-cinematic-modal .tvab-card-category {
    color: rgba(255,255,255,0.9);
}

/* Responsive Modal */
@media (max-width: 768px) {
    .tvab-cinematic-modal .tvab-modal-content {
        width: 95%;
    }

    .tvab-modal-title {
        font-size: 18px;
    }

    .tvab-modal-description {
        font-size: 14px;
    }

    .tvab-cinematic-modal .tvab-modal-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}

/* ============================================
   SERIES & EPISODE STYLES
   ============================================ */

/* Series Badge - Shows episode count on cards */
.tvab-series-badge,
.tvab-card-badge,
.tvab-item-badge,
.tvab-carousel-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 5;
}

.tvab-series-badge i,
.tvab-card-badge i,
.tvab-item-badge i,
.tvab-carousel-badge i {
    font-size: 10px;
}

.tvab-item-badge {
    font-size: 10px;
    padding: 3px 8px;
}

/* Episode List Container */
.tvab-episodes-container {
    max-height: 60vh;
    overflow-y: auto;
    padding-right: 8px;
}

.tvab-episodes-container::-webkit-scrollbar {
    width: 6px;
}

.tvab-episodes-container::-webkit-scrollbar-track {
    background: rgba(255,255,255,0.05);
    border-radius: 3px;
}

.tvab-episodes-container::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
}

.tvab-episodes-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.3);
}

/* Episode List */
.tvab-episodes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Individual Episode Item */
.tvab-episode-item {
    display: flex;
    gap: 16px;
    padding: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.tvab-episode-item:hover {
    background: rgba(255,255,255,0.1);
    transform: translateX(4px);
}

/* Episode Thumbnail */
.tvab-episode-thumbnail {
    position: relative;
    width: 180px;
    flex-shrink: 0;
    aspect-ratio: 16/9;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0,0,0,0.3);
}

.tvab-episode-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.tvab-episode-item:hover .tvab-episode-thumbnail img {
    transform: scale(1.05);
}

.tvab-episode-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
}

.tvab-episode-item:hover .tvab-episode-play {
    opacity: 1;
}

.tvab-episode-play i {
    margin-left: 2px;
}

.tvab-episode-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

/* Episode Info */
.tvab-episode-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.tvab-episode-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.tvab-episode-number {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.tvab-episode-title {
    font-size: 16px;
    font-weight: 600;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tvab-episode-desc {
    font-size: 13px;
    color: rgba(255,255,255,0.75);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Series Modal Header */
.tvab-series-header {
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.tvab-series-title {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin: 0 0 8px 0;
}

.tvab-series-meta {
    font-size: 14px;
    color: rgba(255,255,255,0.75);
    display: flex;
    align-items: center;
    gap: 8px;
}

.tvab-series-meta i {
    font-size: 12px;
}

/* Loading State for Episodes */
.tvab-episodes-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: rgba(255,255,255,0.75);
    gap: 16px;
}

.tvab-episodes-loading .tvab-spinner {
    border-color: rgba(255,255,255,0.1);
    border-top-color: white;
}

/* No Episodes State */
.tvab-no-episodes {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: rgba(255,255,255,0.75);
    text-align: center;
    gap: 12px;
}

.tvab-no-episodes i {
    font-size: 48px;
    opacity: 0.4;
}

/* Back Button in Episode Modal */
.tvab-back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10;
}

.tvab-back-btn:hover {
    background: rgba(255,255,255,0.2);
}

.tvab-back-btn i {
    font-size: 12px;
}

/* Responsive Episodes */
@media (max-width: 768px) {
    .tvab-episode-item {
        flex-direction: row;
        gap: 12px;
        padding: 10px;
    }

    .tvab-episode-thumbnail {
        width: 100px;
        min-width: 100px;
        flex-shrink: 0;
    }

    .tvab-episode-title {
        font-size: 14px;
        white-space: normal;
        -webkit-line-clamp: 2;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .tvab-episode-desc {
        display: none;
    }

    .tvab-episode-number {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .tvab-episode-duration {
        font-size: 9px;
        padding: 2px 4px;
    }

    .tvab-episode-play {
        width: 30px;
        height: 30px;
        font-size: 10px;
    }

    .tvab-series-title {
        font-size: 18px;
    }

    .tvab-back-btn {
        top: 10px;
        left: 10px;
        padding: 8px 12px;
        font-size: 13px;
    }

    .tvab-episodes-container {
        max-height: 50vh;
    }

    .tvab-modal-description {
        max-height: 80px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .tvab-episode-item {
        padding: 8px;
        gap: 10px;
    }

    .tvab-episode-thumbnail {
        width: 80px;
        min-width: 80px;
    }

    .tvab-episode-title {
        font-size: 13px;
    }

    .tvab-episode-number {
        font-size: 9px;
    }

    .tvab-modal-title {
        font-size: 16px;
    }

    .tvab-modal-description {
        max-height: 60px;
        font-size: 12px;
    }
}

/* ============================================
   SORT DROPDOWN STYLES
   ============================================ */

.tvab-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.tvab-sort-dropdown {
    flex-shrink: 0;
}

.tvab-sort-select {
    padding: 8px 32px 8px 12px;
    font-size: 13px;
    font-family: inherit;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M2 4l4 4 4-4'/%3E%3C/svg%3E") no-repeat right 10px center;
    background-size: 12px;
    color: #374151;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tvab-sort-select:hover {
    border-color: #cbd5e1;
}

.tvab-sort-select:focus {
    border-color: var(--brand-color, #7c3aed);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.tvab-embed-container[data-theme="dark"] .tvab-sort-select {
    background-color: #334155;
    border-color: #475569;
    color: #e2e8f0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
}

.tvab-embed-container[data-theme="dark"] .tvab-sort-select:hover {
    border-color: #64748b;
}

/* ============================================
   LOAD MORE BUTTON STYLES
   ============================================ */

.tvab-load-more-container {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.tvab-load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: var(--brand-color, #7c3aed);
    background: transparent;
    border: 2px solid var(--brand-color, #7c3aed);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.tvab-load-more-btn:hover:not(:disabled) {
    background: var(--brand-color, #7c3aed);
    color: white;
}

.tvab-load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tvab-embed-container[data-theme="dark"] .tvab-load-more-btn {
    color: var(--brand-color, #a78bfa);
    border-color: var(--brand-color, #a78bfa);
}

.tvab-embed-container[data-theme="dark"] .tvab-load-more-btn:hover:not(:disabled) {
    background: var(--brand-color, #a78bfa);
    color: white;
}


    background: var(--brand-color, #a78bfa);
    color: #0f172a;
}

.tvab-load-more-spinner {
    display: inline-flex;
    align-items: center;
}

/* ============================================
   LIVE FEED STYLES
   ============================================ */

.tvab-live-feed-section {
    margin-bottom: 32px;
}

.tvab-live-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    margin-right: 8px;
    animation: tvab-pulse 2s infinite;
}

@keyframes tvab-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.tvab-live-feed-card {
    display: flex;
    gap: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #fef2f2 0%, #fff 100%);
    border: 2px solid #fecaca;
    border-radius: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tvab-live-feed-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.15);
}

.tvab-embed-container[data-theme="dark"] .tvab-live-feed-card {
    background: linear-gradient(135deg, #1f1315 0%, #1e293b 100%);
    border-color: #7f1d1d;
}

.tvab-live-thumbnail {
    position: relative;
    width: 280px;
    flex-shrink: 0;
    aspect-ratio: 16/9;
    border-radius: 12px;
    overflow: hidden;
    background: #1e293b;
}

.tvab-live-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tvab-live-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #7f1d1d 0%, #1e293b 100%);
    color: rgba(255,255,255,0.5);
    font-size: 48px;
}

.tvab-live-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 6px;
    animation: tvab-pulse 2s infinite;
}

.tvab-live-badge i {
    font-size: 8px;
}

.tvab-live-badge-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 8px;
    color: white;
}

.tvab-live-badge-inline i {
    font-size: 8px;
}

.tvab-live-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.tvab-live-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: #0f172a;
}

.tvab-embed-container[data-theme="dark"] .tvab-live-title {
    color: #f1f5f9;
}

.tvab-live-description {
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tvab-embed-container[data-theme="dark"] .tvab-live-description {
    color: #94a3b8;
}

/* Responsive Live Feed */
@media (max-width: 768px) {
    .tvab-live-feed-card {
        flex-direction: column;
        gap: 16px;
    }

    .tvab-live-thumbnail {
        width: 100%;
    }

    .tvab-live-title {
        font-size: 18px;
    }

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

@media (max-width: 480px) {
    .tvab-live-title {
        font-size: 16px;
    }

    .tvab-sort-select {
        width: 100%;
    }

    .tvab-load-more-btn {
        width: 100%;
    }
}
