/* Live TV Plugin Frontend - Professional Dark Theme */

/* ===== BASE STYLES ===== */
.live-tv-container {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1a1a, #2c2c2c);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: fadeInUp 0.8s ease-out;
}

/* ===== ACCESSIBILITY FEATURES ===== */
.skip-link {
    position: absolute;
    left: -9999px;
    z-index: 999999;
    padding: 8px 16px;
    background: #000;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    border-radius: 0 0 4px 4px;
}

.skip-link:focus {
    left: 6px;
    top: 7px;
}

.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;
}

/* Focus Management */
.live-tv-container *:focus {
    outline: 3px solid #00a0d2;
    outline-offset: 2px;
}

.live-tv-container *:focus:not(:focus-visible) {
    outline: none;
}

/* ===== VIDEO PLAYER SECTION ===== */
.live-tv-player-wrapper {
    position: relative;
    background: linear-gradient(135deg, #000, #1a1a1a);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    border: 1px solid #333;
    animation: slideInDown 0.8s ease-out;
}

.live-tv-player-aspect-ratio {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.live-tv-player-wrapper .video-js {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border-radius: 12px;
}

.live-tv-player-wrapper:hover {
    box-shadow: 0 12px 40px rgba(0, 160, 210, 0.2);
    transform: translateY(-2px);
    transition: all 0.4s ease;
}

/* ===== LOADING & ERROR OVERLAYS ===== */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(26, 26, 26, 0.9));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999;
    color: white;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease-out;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 160, 210, 0.2);
    border-radius: 50%;
    border-top-color: #00a0d2;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-overlay p {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #e0e0e0;
    animation: pulse 1.5s ease-in-out infinite;
}

.error-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95), rgba(26, 26, 26, 0.95));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    backdrop-filter: blur(15px);
    animation: fadeIn 0.4s ease-out;
}

.error-message {
    background: linear-gradient(135deg, #2c2c2c, #1e1e1e);
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    max-width: 450px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid #3c434a;
    animation: slideInUp 0.5s ease-out;
}

.error-message h4 {
    color: #dc3232;
    margin: 0 0 20px 0;
    font-size: 24px;
    font-weight: 700;
}

.error-message p {
    color: #a0a5aa;
    margin: 0 0 25px 0;
    line-height: 1.6;
    font-size: 16px;
}

.error-message button {
    background: linear-gradient(135deg, #00a0d2, #0073aa);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 160, 210, 0.3);
}

.error-message button:hover {
    background: linear-gradient(135deg, #0073aa, #005177);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 160, 210, 0.4);
}

/* ===== CURRENT CHANNEL INFO ===== */
.current-channel-info {
    position: absolute;
    top: 25px;
    left: 25px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9), rgba(26, 26, 26, 0.9));
    color: white;
    padding: 20px 25px;
    border-radius: 10px;
    z-index: 1000;
    max-width: 320px;
    border: 1px solid rgba(0, 160, 210, 0.3);
    backdrop-filter: blur(10px);
    animation: slideInLeft 0.5s ease-out;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.current-channel-info:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00a0d2, #0073aa);
    border-radius: 10px 10px 0 0;
}

.current-channel-info h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 700;
    color: #00a0d2;
}

.current-channel-info p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
    line-height: 1.5;
    color: #e0e0e0;
}

.live-tv-current-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 15px 20px;
    background: linear-gradient(135deg, #2c2c2c, #1e1e1e);
    border: 1px solid #3c434a;
    border-radius: 12px;
    animation: slideInUp 0.6s ease-out;
}

.live-tv-current-info h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #00a0d2;
}

/* ===== CHANNELS SECTION ===== */
.live-tv-channels {
    margin-top: 40px;
    animation: fadeInUp 1s ease-out;
}

.live-tv-channels h3 {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 25px 0;
    color: #e0e0e0;
    border-bottom: 3px solid #00a0d2;
    padding-bottom: 15px;
    position: relative;
    animation: slideInRight 0.8s ease-out;
}

/* ===== CHANNEL SEARCH ===== */
.channel-search {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    align-items: center;
    animation: slideInUp 0.6s ease-out 0.2s both;
}

.channel-search input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #3c434a;
    border-radius: 10px;
    font-size: 16px;
    background: #2c2c2c;
    color: #e0e0e0;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.channel-search input:focus {
    outline: none;
    border-color: #00a0d2;
    background: #333;
    box-shadow: 0 0 0 3px rgba(0, 160, 210, 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.channel-search input::placeholder {
    color: #a0a5aa;
}

.channel-search button {
    padding: 15px 25px;
    background: linear-gradient(135deg, #6c757d, #555d66);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.channel-search button:hover {
    background: linear-gradient(135deg, #555d66, #3c434a);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* ===== CHANNELS GRID ===== */
.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

/* ===== CHANNEL ITEMS ===== */
.channel-item {
    background: linear-gradient(135deg, #2c2c2c, #1e1e1e);
    border: 2px solid #3c434a;
    border-radius: 15px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.6s ease-out;
}

.channel-item:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #00a0d2, #46b450);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.channel-item:hover {
    border-color: #00a0d2;
    background: linear-gradient(135deg, #333, #2c2c2c);
    box-shadow: 0 8px 40px rgba(0, 160, 210, 0.2);
    transform: translateY(-5px) scale(1.02);
}

.channel-item:hover:before {
    transform: scaleX(1);
}

.channel-item.active {
    border-color: #00a0d2;
    background: linear-gradient(135deg, #1a365d, #2c2c2c);
    box-shadow: 0 8px 40px rgba(0, 160, 210, 0.3);
    transform: translateY(-3px);
}

.channel-item.active:before {
    transform: scaleX(1);
    background: linear-gradient(90deg, #46b450, #00a0d2);
}

.channel-item.active:after {
    content: "● LIVE";
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #46b450, #00a0d2);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: pulse 2s infinite;
    box-shadow: 0 2px 8px rgba(70, 180, 80, 0.4);
}

/* Channel Logo */
.channel-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 70px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #3c434a, #2c2c2c);
    border-radius: 10px;
    border: 1px solid #555d66;
    transition: all 0.3s ease;
}

.channel-item:hover .channel-logo-container {
    background: linear-gradient(135deg, #555d66, #3c434a);
    transform: scale(1.05);
}

.channel-logo {
    max-width: 90px;
    max-height: 60px;
    object-fit: contain;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.channel-item:hover .channel-logo {
    transform: scale(1.1);
}

.channel-logo-placeholder {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #555d66, #6c757d);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e0e0e0;
    font-size: 28px;
    transition: all 0.3s ease;
}

.channel-item:hover .channel-logo-placeholder {
    background: linear-gradient(135deg, #6c757d, #00a0d2);
    transform: rotate(360deg);
}

/* Channel Info */
.channel-info {
    text-align: center;
    margin-bottom: 20px;
}

.channel-name {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #e0e0e0;
    line-height: 1.3;
    transition: all 0.3s ease;
}

.channel-item:hover .channel-name {
    color: #00a0d2;
    transform: translateY(-2px);
}

.channel-category {
    font-size: 12px;
    font-weight: 600;
    color: #00a0d2;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(0, 160, 210, 0.1);
    padding: 4px 8px;
    border-radius: 12px;
    display: inline-block;
    transition: all 0.3s ease;
}

.channel-item:hover .channel-category {
    background: rgba(0, 160, 210, 0.2);
    transform: scale(1.05);
}

.channel-description {
    font-size: 14px;
    color: #a0a5aa;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.channel-item:hover .channel-description {
    color: #e0e0e0;
}

/* Channel Play Button */
.channel-play-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #00a0d2, #0073aa);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 160, 210, 0.3);
}

.channel-play-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.channel-play-btn:hover {
    background: linear-gradient(135deg, #0073aa, #005177);
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 160, 210, 0.4);
}

.channel-play-btn:hover:before {
    left: 100%;
}

.channel-play-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 160, 210, 0.3);
}

.channel-item.active .channel-play-btn {
    background: linear-gradient(135deg, #46b450, #00a32a);
    box-shadow: 0 4px 15px rgba(70, 180, 80, 0.3);
}

.channel-item.active .channel-play-btn:hover {
    background: linear-gradient(135deg, #00a32a, #007017);
    box-shadow: 0 6px 25px rgba(70, 180, 80, 0.4);
}

/* ===== VIDEO.JS CUSTOMIZATIONS ===== */
.video-js .vjs-big-play-button {
    background-color: rgba(0, 160, 210, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    width: 80px;
    height: 80px;
    line-height: 76px;
    margin-top: -40px;
    margin-left: -40px;
    font-size: 28px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.video-js .vjs-big-play-button:hover,
.video-js .vjs-big-play-button:focus {
    background-color: rgba(0, 160, 210, 1);
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 160, 210, 0.4);
}

.video-js .vjs-control-bar {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    backdrop-filter: blur(8px);
    height: 50px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.video-js .vjs-progress-control .vjs-progress-holder {
    height: 6px;
}

.video-js .vjs-progress-control .vjs-play-progress {
    background-color: #00a0d2;
}

.video-js .vjs-progress-control .vjs-load-progress {
    background-color: rgba(255, 255, 255, 0.3);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(0.95);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== RESPONSIVE DESIGN ===== */
/* Tablet */
@media (max-width: 1024px) {
    .live-tv-player-wrapper {
        margin-bottom: 20px;
        border-radius: 8px;
    }
    
    .channels-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
}

/* Mobile Landscape & Tablet Portrait */
@media (max-width: 768px) {
    .live-tv-container {
        padding: 15px;
    }
    
    .channels-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .channel-item {
        padding: 20px;
    }
    
    .current-channel-info {
        top: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
        padding: 12px 15px;
    }
    
    .current-channel-info h3 {
        font-size: 16px;
    }
    
    .current-channel-info p {
        font-size: 13px;
    }
    
    .channel-search {
        flex-direction: column;
        align-items: stretch;
    }
    
    .video-js .vjs-control-bar {
        height: 55px;
    }
    
    .video-js .vjs-big-play-button {
        width: 70px;
        height: 70px;
        line-height: 66px;
        margin-top: -35px;
        margin-left: -35px;
        font-size: 24px;
    }
}

/* Mobile Portrait */
@media (max-width: 480px) {
    .live-tv-container {
        padding: 10px;
    }
    
    .live-tv-channels h3 {
        font-size: 22px;
    }
    
    .channel-name {
        font-size: 18px;
    }
    
    .channel-logo-container {
        height: 60px;
    }
    
    .channel-logo-placeholder {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .video-js .vjs-big-play-button {
        width: 60px;
        height: 60px;
        line-height: 56px;
        margin-top: -30px;
        margin-left: -30px;
        font-size: 20px;
    }
    
    .video-js .vjs-control-bar {
        height: 50px;
        padding: 0 8px;
    }
}

/* Mobile Device Optimizations */
.video-js.vjs-mobile-device {
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

.video-js.vjs-mobile-device .vjs-control-bar {
    height: 55px;
    padding: 0 10px;
}

.video-js.vjs-mobile-device .vjs-button {
    min-width: 44px;
    min-height: 44px;
    font-size: 16px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .channel-item {
        border: 2px solid;
        background: Window;
        color: WindowText;
    }
    
    .channel-item:hover,
    .channel-item:focus {
        background: Highlight;
        color: HighlightText;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .live-tv-container *,
    .live-tv-container *::before,
    .live-tv-container *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Touch Devices */
@media (hover: none) and (pointer: coarse) {
    .video-js .vjs-control-bar {
        opacity: 1;
        transform: translateY(0);
    }
    
    .video-js .vjs-button {
        margin: 0 2px;
        min-width: 44px;
        min-height: 44px;
    }
}