/* VATCTV Modal Styles */

.vatctv-modal {
    position: fixed;
    z-index: 9999;
    display: none;
    font-family: inherit;
}

.vatctv-modal.show {
    display: block;
}

.vatctv-modal-content {
    background: var(--color-surface-elevated, #ffffff);
    border: 2px solid var(--color-border, #e0e0e0);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-width: 400px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
}

/* Dark mode support */
[data-theme="dark"] .vatctv-modal-content {
    background: var(--color-surface-elevated, #1a1a1a);
    border-color: var(--color-border, #333333);
}

.vatctv-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--color-surface, #f5f5f5);
    border-bottom: 1px solid var(--color-border, #e0e0e0);
    cursor: move;
    user-select: none;
}

[data-theme="dark"] .vatctv-modal-header {
    background: var(--color-surface, #2a2a2a);
    border-bottom-color: var(--color-border, #333333);
}

.vatctv-modal-title-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vatctv-header-logo {
    height: 30px;
    width: auto;
    object-fit: contain;
}

.vatctv-modal-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-text, #000000);
}

[data-theme="dark"] .vatctv-modal-title {
    color: var(--color-text, #ffffff);
}

.vatctv-live-indicator {
    background: #ef4444;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.vatctv-modal-controls {
    display: flex;
    gap: 8px;
}

.vatctv-control-btn {
    background: transparent;
    border: 1px solid var(--color-border, #e0e0e0);
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    color: var(--color-text, #000000);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-theme="dark"] .vatctv-control-btn {
    border-color: var(--color-border, #333333);
    color: var(--color-text, #ffffff);
}

.vatctv-control-btn:hover {
    background: var(--color-primary, #3b82f6);
    color: white;
    border-color: var(--color-primary, #3b82f6);
}

.vatctv-modal-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* Nav pill — shown in the nav bar when the modal is collapsed */
.vatctv-nav-pill {
    display: none; /* JS sets display:flex when visible */
    align-items: center;
    gap: 6px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 5px 12px 5px 8px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    animation: vatctv-pill-appear 0.3s ease;
}

.vatctv-nav-pill:hover {
    background: #dc2626;
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.5);
}

.vatctv-nav-pill-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

.vatctv-nav-pill-logo {
    height: 16px;
    width: auto;
    filter: brightness(0) invert(1);
    object-fit: contain;
    flex-shrink: 0;
}

.vatctv-nav-pill-label {
    font-size: 0.7rem;
}

@keyframes vatctv-pill-appear {
    from { opacity: 0; transform: scale(0.7); }
    to   { opacity: 1; transform: scale(1); }
}

/* Video container */
.vatctv-video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000000;
    overflow: hidden;
}

.vatctv-video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
}

.vatctv-placeholder-text {
    color: white;
    font-size: 3rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.vatctv-iframe-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.vatctv-iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Channels bar */
.vatctv-channels-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    background: var(--color-surface, #f5f5f5);
    border-top: 1px solid var(--color-border, #e0e0e0);
}

[data-theme="dark"] .vatctv-channels-bar {
    background: var(--color-surface, #2a2a2a);
    border-top-color: var(--color-border, #333333);
}

.vatctv-channels-list {
    display: flex;
    gap: 8px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: thin;
}

.vatctv-channels-list::-webkit-scrollbar {
    height: 4px;
}

.vatctv-channels-list::-webkit-scrollbar-track {
    background: transparent;
}

.vatctv-channels-list::-webkit-scrollbar-thumb {
    background: var(--color-border, #ccc);
    border-radius: 2px;
}

.vatctv-channel-btn {
    flex-shrink: 0;
    width: 45px;
    height: 45px;
    border: 2px solid var(--color-border, #e0e0e0);
    border-radius: 6px;
    background: var(--color-surface-elevated, #ffffff);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    position: relative;
    overflow: hidden;
    padding: 0;
}

[data-theme="dark"] .vatctv-channel-btn {
    border-color: var(--color-border, #333333);
    background: var(--color-surface-elevated, #1a1a1a);
}

.vatctv-channel-btn:hover {
    border-color: var(--color-primary, #3b82f6);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.vatctv-channel-btn.active {
    border-color: #ef4444;
    border-width: 3px;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3);
}

.vatctv-channel-btn.disabled {
    opacity: 0.5;
    cursor: pointer;
    filter: grayscale(100%);
}

.vatctv-channel-btn.disabled:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border-color: var(--color-border, #e0e0e0);
}

.vatctv-offline-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 10;
    white-space: nowrap;
}

.vatctv-channel-btn.disabled:hover .vatctv-offline-label {
    opacity: 1;
}

.vatctv-channel-logo {
    width: 100%;
    height: 100%;
    object-fit: fill;
    border-radius: 4px;
    display: block;
    margin: 0;
    padding: 0;
}

.vatctv-channel-initials {
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--color-text, #000000);
}

[data-theme="dark"] .vatctv-channel-initials {
    color: var(--color-text, #ffffff);
}

/* Responsive design */
@media (max-width: 768px) {
    .vatctv-modal-content {
        min-width: 90vw;
        max-width: 90vw;
    }
    
    .vatctv-channel-btn {
        width: 40px;
        height: 40px;
    }
    
    .vatctv-header-logo {
        height: 25px;
    }
}

/* Collapse-to-nav animation */
.vatctv-modal.collapsing-to-nav .vatctv-modal-content {
    animation: vatctv-shrink-to-nav 0.32s ease forwards;
    transform-origin: top right;
}

@keyframes vatctv-shrink-to-nav {
    from { opacity: 1; transform: scale(1) translateY(0); }
    to   { opacity: 0; transform: scale(0.05) translateY(-200px); }
}

/* Expand-from-nav animation */
.vatctv-modal.expanding-from-nav .vatctv-modal-content {
    animation: vatctv-grow-from-nav 0.32s ease forwards;
    transform-origin: top right;
}

@keyframes vatctv-grow-from-nav {
    from { opacity: 0; transform: scale(0.05) translateY(-200px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Paused state */
.vatctv-modal.paused .vatctv-iframe-wrapper iframe {
    pointer-events: none;
    opacity: 0.7;
}

