/**
 * IMEFI TV Manager - Main Stylesheet
 *
 * @package IMEFI_TV_Manager
 * @version 1.0.1
 */

/* ========================================
   General Container Styles
   ======================================== */

.imefi-tv-container {
    width: 100%;
    overflow-x: hidden;
}

.imefi-tv-content {
    background: #f8f9fa;
    min-height: 400px;
}

/* ========================================
   Hero Section
   ======================================== */

.imefi-tv-hero {
    position: relative;
    background: linear-gradient(135deg, #B92F39 0%, #8B0000 100%);
    color: white;
    overflow: hidden;
}

.imefi-tv-hero h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.imefi-tv-hero p {
    font-size: 1.1rem;
    line-height: 1.6;
    opacity: 0.95;
}

/* ========================================
   Programs Menu
   ======================================== */

.imefi-tv-menu-container {
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.menu-television {
    padding: 0.5rem 0;
}

.menu-television .program-col {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    transition: all 0.3s ease;
}

.program-item {
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    width: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
    position: relative;
}

.program-item:hover {
    filter: brightness(0.9) contrast(1.1);
    transform: translateY(-2px);
}

.program-item:focus {
    outline: 2px solid #B92F39;
    outline-offset: 2px;
}

.program-item.active {
    filter: grayscale(0%) brightness(1);
    opacity: 1;
    transform: scale(1);
}

.program-col-active {
    background-color: #e8e8e8;
    border-radius: 4px;
}

/* ========================================
   Video Grid
   ======================================== */

.imefi-tv-video-grid {
    padding: 2rem 0;
}

.imefi-video-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    transition: all 0.3s ease;
    height: 100%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.imefi-video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border-color: #B92F39;
}

.imefi-video-thumbnail {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
    overflow: hidden;
}

.imefi-video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.imefi-video-card:hover .imefi-video-thumbnail img {
    transform: scale(1.1);
}

.imefi-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.imefi-video-card:hover .imefi-play-overlay {
    opacity: 1;
}

.imefi-play-icon {
    font-size: 2.5rem;
    color: white;
    background: rgba(185, 47, 57, 0.95);
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.imefi-video-card:hover .imefi-play-icon {
    transform: scale(1.15);
    background: rgba(185, 47, 57, 1);
}

.imefi-video-info {
    padding: 1rem;
    background: white;
}

.imefi-video-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
}

.imefi-video-description {
    font-size: 0.85rem;
    color: #666;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   Loading States
   ======================================== */

.imefi-loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
}

.imefi-loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #B92F39;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: imefi-spin 1s linear infinite;
}

@keyframes imefi-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.imefi-loading-text {
    margin-top: 1rem;
    color: #666;
    font-size: 1rem;
}

/* ========================================
   VenoBox Custom Styles
   ======================================== */

.vbox-overlay {
    background: rgba(0,0,0,0.9);
}

.vbox-content {
    background: transparent;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 979px) {
    .imefi-tv-hero h2 {
        font-size: 1.5rem;
    }

    .imefi-tv-hero p {
        font-size: 1rem;
    }

    .imefi-tv-menu-container {
        position: relative;
        padding: 0.5rem 0;
    }

    .menu-television .program-col {
        padding: 0 5px;
    }

    .program-item {
        min-height: 50px;
    }

    .program-item:hover {
        transform: none;
    }

    .program-item.active {
        transform: none;
    }

    .imefi-tv-video-grid {
        padding: 1rem 0;
    }

    .imefi-video-info {
        padding: 0.75rem;
    }

    .imefi-video-title {
        font-size: 0.85rem;
        height: 2.4em;
    }

    .imefi-video-description {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .imefi-tv-hero h2 {
        font-size: 1.3rem;
    }

    .imefi-tv-hero p {
        font-size: 0.9rem;
    }

    .program-item {
        min-height: 40px;
    }

    .imefi-video-card {
        margin-bottom: 0.5rem;
    }

    .imefi-play-icon {
        font-size: 2rem;
        width: 50px;
        height: 50px;
    }
}

/* ========================================
   Accessibility Enhancements
   ======================================== */

.program-item:focus-visible {
    outline: 3px solid #B92F39;
    outline-offset: 3px;
    border-radius: 4px;
}

.imefi-video-card a:focus-visible {
    outline: 3px solid #B92F39;
    outline-offset: 2px;
    border-radius: 8px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .imefi-video-card {
        border-width: 2px;
    }

    .program-item:focus {
        outline-width: 3px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .program-item,
    .imefi-video-card,
    .imefi-video-thumbnail img,
    .imefi-play-overlay,
    .imefi-play-icon,
    .imefi-loading-spinner {
        transition: none;
        animation: none;
    }

    .imefi-loading-spinner {
        animation: imefi-spin 2s linear infinite;
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .imefi-tv-menu-container,
    .imefi-play-overlay,
    .imefi-loading-container {
        display: none !important;
    }

    .imefi-video-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* ========================================
   Utility Classes
   ======================================== */

.imefi-text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.imefi-line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.imefi-line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}