/* HALLOPlay WebPlayer - Component Styles */

/* ==================== CAROUSEL ==================== */
.carousel-wrapper {
    position: relative;
    overflow: hidden;
}

.carousel {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 16px;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

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

.carousel-item {
    flex-shrink: 0;
}

/* ==================== MOVIE CARD ==================== */
.movie-card {
    flex-shrink: 0;
    width: 160px;
    cursor: pointer;
    transition: transform var(--transition-fast);
    position: relative;
}

.movie-card:hover,
.movie-card.focused {
    transform: scale(1.05);
    z-index: 10;
}

.movie-card-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-card);
}

.movie-card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity var(--transition-normal);
}

.movie-card-poster img.loading {
    opacity: 0;
}

.movie-card-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    color: var(--text-muted);
    z-index: 0;
}

.movie-card-poster img {
    position: relative;
    z-index: 1;
}

.movie-card-placeholder svg {
    width: 48px;
    height: 48px;
    opacity: 0.5;
}

/* Skeleton loading */
.skeleton-card {
    flex-shrink: 0;
    width: 160px;
}

.skeleton-card .movie-card-poster {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-tertiary) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.movie-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(transparent 60%, rgba(0, 0, 0, 0.9) 100%);
    opacity: 0;
    transition: opacity var(--transition-fast);
    display: flex;
    align-items: flex-end;
    padding: 12px;
}

.movie-card:hover .movie-card-overlay,
.movie-card.focused .movie-card-overlay {
    opacity: 1;
}

.movie-card-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
}

.movie-card:hover .movie-card-play,
.movie-card.focused .movie-card-play {
    transform: translate(-50%, -50%) scale(1);
}

.movie-card-play svg {
    width: 24px;
    height: 24px;
    margin-left: 3px;
}

.movie-card-info {
    margin-top: 10px;
}

.movie-card-title {
    font-size: var(--font-size-sm);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-card-year {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: 2px;
}

/* Progress bar for continue watching */
.movie-card-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
}

.movie-card-progress-fill {
    height: 100%;
    background: var(--accent-color);
    transition: width var(--transition-normal);
}

/* ==================== CHANNEL CARD ==================== */
.channel-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.channel-card:hover,
.channel-card.focused {
    background: var(--bg-card-hover);
    transform: scale(1.02);
}

.channel-card.active {
    background: var(--accent-color);
}

.channel-card-logo {
    width: 60px;
    height: 40px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
}

.channel-card-info {
    flex: 1;
    min-width: 0;
}

.channel-card-name {
    font-size: var(--font-size-md);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-card-program {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 4px;
}

.channel-card-live {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-size-xs);
    color: var(--accent-color);
    font-weight: 600;
}

.channel-card-live::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ==================== GENRE TABS ==================== */
.genre-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 0;
    margin-bottom: 20px;
}

.genre-tab {
    padding: 10px 20px;
    background: var(--bg-card);
    border-radius: 20px;
    font-size: var(--font-size-sm);
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.genre-tab:hover,
.genre-tab.focused {
    background: var(--bg-card-hover);
}

.genre-tab.active {
    background: var(--text-primary);
    color: var(--bg-primary);
}

/* ==================== SEARCH BAR ==================== */
.search-bar {
    position: relative;
    max-width: 600px;
    margin-bottom: 30px;
}

.search-bar-input {
    width: 100%;
    padding: 16px 20px 16px 50px;
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: var(--font-size-md);
    font-family: inherit;
    outline: none;
    transition: all var(--transition-fast);
}

.search-bar-input::placeholder {
    color: var(--text-muted);
}

.search-bar-input:focus {
    border-color: var(--text-primary);
}

.search-bar-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-bar-clear {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    padding: 4px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.search-bar-input:not(:placeholder-shown) + .search-bar-icon + .search-bar-clear {
    opacity: 1;
}

/* ==================== MODAL ==================== */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 30px;
    max-width: 90%;
    max-height: 90%;
    overflow: auto;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-title {
    font-size: var(--font-size-xl);
    font-weight: 700;
}

.modal-close {
    padding: 8px;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Movie Detail Modal */
.movie-detail {
    display: flex;
    gap: 30px;
    max-width: 900px;
}

.movie-detail-poster {
    flex-shrink: 0;
    width: 250px;
    border-radius: var(--radius-md);
}

.movie-detail-info {
    flex: 1;
}

.movie-detail-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: 16px;
}

.movie-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.movie-detail-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--success-color);
}

.movie-detail-description {
    font-size: var(--font-size-md);
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
}

.movie-detail-cast {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: 24px;
}

.movie-detail-actions {
    display: flex;
    gap: 12px;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.empty-state-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: 10px;
}

.empty-state-text {
    font-size: var(--font-size-md);
    color: var(--text-secondary);
    max-width: 400px;
}

/* ==================== EPG (Electronic Program Guide) ==================== */
.epg {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.epg-header {
    padding: 16px;
    background: var(--bg-tertiary);
    font-weight: 600;
}

.epg-list {
    max-height: 300px;
    overflow-y: auto;
}

.epg-item {
    display: flex;
    gap: 16px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--bg-tertiary);
}

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

.epg-item.current {
    background: rgba(229, 9, 20, 0.2);
}

.epg-time {
    flex-shrink: 0;
    width: 60px;
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.epg-program-title {
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.epg-program-description {
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ==================== SKELETON LOADING ==================== */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-card) 25%,
        var(--bg-tertiary) 50%,
        var(--bg-card) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card {
    width: 160px;
    aspect-ratio: 2/3;
}

.skeleton-text {
    height: 16px;
    border-radius: var(--radius-sm);
}

.skeleton-text.short {
    width: 60%;
}

/* ==================== SERIES EPISODES ==================== */
.season-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.season-btn {
    padding: 10px 20px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.season-btn.active {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.episode-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.episode-card {
    display: flex;
    gap: 16px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.episode-card:hover,
.episode-card.focused {
    background: var(--bg-card-hover);
}

.episode-thumbnail {
    flex-shrink: 0;
    width: 160px;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
}

.episode-info {
    flex: 1;
    min-width: 0;
}

.episode-number {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin-bottom: 4px;
}

.episode-title {
    font-size: var(--font-size-md);
    font-weight: 600;
    margin-bottom: 8px;
}

.episode-description {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.episode-duration {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: 8px;
}

/* ==================== QR CODE LOGIN ==================== */
.qr-container {
    text-align: center;
    padding: 20px;
}

.qr-code {
    width: 200px;
    height: 200px;
    margin: 20px auto;
    background: white;
    padding: 10px;
    border-radius: var(--radius-md);
}

.qr-instructions {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    max-width: 300px;
    margin: 0 auto;
}

/* ==================== SESSION MANAGEMENT ==================== */
.session-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.session-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
}

.session-item.current {
    border: 2px solid var(--accent-color);
}

.session-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.session-icon {
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.session-device {
    font-weight: 500;
}

.session-time {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.session-remove {
    padding: 8px 16px;
    background: rgba(229, 9, 20, 0.2);
    color: var(--accent-color);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    transition: background var(--transition-fast);
}

.session-remove:hover {
    background: var(--accent-color);
    color: var(--text-primary);
}

/* ==================== RESPONSIVE COMPONENTS ==================== */
@media (max-width: 768px) {
    .movie-card {
        width: 130px;
    }

    .movie-detail {
        flex-direction: column;
    }

    .movie-detail-poster {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }

    .episode-card {
        flex-direction: column;
    }

    .episode-thumbnail {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .movie-card {
        width: 110px;
    }

    .channel-card {
        padding: 12px;
    }

    .channel-card-logo {
        width: 40px;
        height: 30px;
    }
}
