/**
 * Transmissão Ao Vivo - Frontend Styles
 * Plugin para exibição de transmissões ao vivo
 * Version: 1.0.0
 * 
 * @package TransmissaoAoVivo
 */

/* ===================================
   CSS Custom Properties
   =================================== */
:root {
    --tav-primary-color: #FF0000;
    --tav-primary-dark: #CC0000;
    --tav-background: #000000;
    --tav-text-color: #FFFFFF;
    --tav-text-secondary: #AAAAAA;
    --tav-border-radius: 8px;
    --tav-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --tav-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.4);
    --tav-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================
   Player Container
   =================================== */
.tav-player-container {
    position: relative;
    width: 100%;
    margin: 0 auto 30px;
    background: var(--tav-background);
    border-radius: var(--tav-border-radius);
    overflow: hidden;
    box-shadow: var(--tav-shadow);
    transition: var(--tav-transition);
}

.tav-player-container:hover {
    box-shadow: var(--tav-shadow-hover);
    transform: translateY(-2px);
}

/* ===================================
   Live Badge
   =================================== */
.tav-live-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--tav-primary-color);
    color: var(--tav-text-color);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(255, 0, 0, 0.5);
    animation: tav-pulse 2s infinite;
}

.tav-live-dot {
    width: 8px;
    height: 8px;
    background: var(--tav-text-color);
    border-radius: 50%;
    animation: tav-blink 1s infinite;
}

@keyframes tav-pulse {

    0%,
    100% {
        box-shadow: 0 2px 10px rgba(255, 0, 0, 0.5);
    }

    50% {
        box-shadow: 0 2px 20px rgba(255, 0, 0, 0.8);
    }
}

@keyframes tav-blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* ===================================
   Upcoming Badge (Scheduled)
   =================================== */
.tav-upcoming-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #2563eb;
    color: var(--tav-text-color);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.5);
}

.tav-upcoming-icon {
    font-size: 14px;
}

/* Badge positioned on the right */
.tav-badge-right {
    left: auto;
    right: 15px;
}

/* Simplified player without bottom bar */
.tav-player-simple {
    border-radius: var(--tav-border-radius);
    overflow: hidden;
}

.tav-player-simple .tav-player-wrapper {
    border-radius: var(--tav-border-radius);
}

/* ===================================
   Player Wrapper (16:9 Aspect Ratio)
   =================================== */
.tav-player-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    background: #111;
    overflow: hidden;
}

.tav-player-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ===================================
   Video Info
   =================================== */
.tav-video-info {
    padding: 15px 20px 10px;
    background: linear-gradient(to bottom, #1a1a1a, #000);
}

.tav-video-title {
    margin: 0;
    padding: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--tav-text-color);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tav-video-description {
    margin: 8px 0 0;
    padding: 0;
    font-size: 14px;
    color: var(--tav-text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===================================
   Action Bar
   =================================== */
.tav-action-bar {
    padding: 12px 20px 15px;
    background: #000;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
}

.tav-youtube-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--tav-primary-color);
    color: var(--tav-text-color);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 4px;
    transition: var(--tav-transition);
    border: none;
    cursor: pointer;
}

.tav-youtube-button:hover {
    background: var(--tav-primary-dark);
    color: var(--tav-text-color);
    transform: translateY(-1px);
    text-decoration: none;
}

.tav-youtube-button:focus {
    outline: 2px solid var(--tav-primary-color);
    outline-offset: 2px;
}

.tav-youtube-button svg {
    flex-shrink: 0;
}

/* ===================================
   No Live / No Video Messages
   =================================== */
.tav-no-live,
.tav-no-video {
    padding: 40px 30px;
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    border-radius: var(--tav-border-radius);
    text-align: center;
}

.tav-no-live p,
.tav-no-video p {
    margin: 0;
    font-size: 16px;
    color: var(--tav-text-secondary);
}

/* ===================================
   Error Message (Admin Only)
   =================================== */
.tav-error {
    padding: 15px 20px;
    background: #2d1f1f;
    border: 1px solid #5c3d3d;
    border-radius: var(--tav-border-radius);
    color: #ff6b6b;
    font-size: 14px;
    margin-bottom: 20px;
}

/* ===================================
   Loading State
   =================================== */
.tav-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 30px;
    background: var(--tav-background);
    border-radius: var(--tav-border-radius);
}

.tav-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #333;
    border-top-color: var(--tav-primary-color);
    border-radius: 50%;
    animation: tav-spin 1s linear infinite;
}

@keyframes tav-spin {
    to {
        transform: rotate(360deg);
    }
}

.tav-loading-text {
    margin-top: 15px;
    font-size: 14px;
    color: var(--tav-text-secondary);
}

/* ===================================
   Thumbnail Fallback
   =================================== */
.tav-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background-color: #111;
    background-size: cover;
    background-position: center;
    cursor: pointer;
}

.tav-thumbnail::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    transition: var(--tav-transition);
}

.tav-thumbnail:hover::before {
    background: rgba(0, 0, 0, 0.1);
}

.tav-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    background: var(--tav-primary-color);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--tav-transition);
}

.tav-thumbnail:hover .tav-play-button {
    background: var(--tav-primary-dark);
    transform: translate(-50%, -50%) scale(1.1);
}

.tav-play-button svg {
    width: 24px;
    height: 24px;
    fill: var(--tav-text-color);
    margin-left: 3px;
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 768px) {
    .tav-player-container {
        margin: 0 auto 20px;
        border-radius: 6px;
    }

    .tav-live-badge {
        top: 10px;
        left: 10px;
        padding: 6px 10px;
        font-size: 10px;
    }

    .tav-live-dot {
        width: 6px;
        height: 6px;
    }

    .tav-video-info {
        padding: 12px 15px 8px;
    }

    .tav-video-title {
        font-size: 14px;
    }

    .tav-action-bar {
        padding: 10px 15px 12px;
        justify-content: center;
    }

    .tav-youtube-button {
        padding: 10px 16px;
        font-size: 12px;
        width: 100%;
        justify-content: center;
    }

    .tav-no-live,
    .tav-no-video {
        padding: 30px 20px;
    }

    .tav-no-live p,
    .tav-no-video p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .tav-live-badge {
        top: 8px;
        left: 8px;
        padding: 5px 8px;
        font-size: 9px;
        gap: 5px;
    }

    .tav-video-title {
        font-size: 13px;
        -webkit-line-clamp: 1;
    }
}

/* ===================================
   Print Styles
   =================================== */
@media print {
    .tav-player-container {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .tav-live-badge,
    .tav-action-bar {
        display: none;
    }

    .tav-player-wrapper {
        display: none;
    }

    .tav-video-info {
        background: #fff;
        padding: 10px;
    }

    .tav-video-title {
        color: #000;
    }
}

/* ===================================
   Accessibility
   =================================== */
@media (prefers-reduced-motion: reduce) {

    .tav-player-container,
    .tav-youtube-button,
    .tav-play-button,
    .tav-thumbnail::before {
        transition: none;
    }

    .tav-live-badge {
        animation: none;
    }

    .tav-live-dot {
        animation: none;
    }

    .tav-loading-spinner {
        animation: none;
    }
}

/* Skip link for screen readers */
.tav-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.tav-sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 10px 20px;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--tav-primary-color);
    color: var(--tav-text-color);
}