/* =============================================================
   FÚTBOL AGENDA & CANALES – Design based on futbollibreenvivotv.pe
   Clean Light Green Theme with Accordion Match Streams & Cards
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ---- ROOT VARIABLES ---- */
:root {
    --fa-primary:      #16a34a;
    --fa-primary-dark: #15803d;
    --fa-primary-deep: #065f46;
    --fa-primary-hover:#05b548;
    --fa-text-main:    #1f2937;
    --fa-text-title:   #2d3748;
    --fa-text-muted:   #4b5563;
    --fa-text-light:   #718096;
    --fa-border:       #e5e7eb;
    --fa-bg-card:      #ffffff;
    --fa-bg-hover:     #f9fbfc;
    --fa-bg-gray:      #f3f4f6;
    --fa-shadow:       0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --fa-radius:       0.5rem;
    --fa-radius-lg:    1rem;
}

/* Base wrapper resets */
.agenda-section,
.channels-section {
    box-sizing: border-box;
    font-family: 'Inter', arial, Arial, Helvetica, sans-serif;
    color: var(--fa-text-main);
    direction: ltr;
    text-align: left;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.agenda-section *,
.channels-section * {
    box-sizing: border-box;
    direction: ltr;
}

/* =============================================================
   1. AGENDA DE PARTIDOS (MATCH LISTING)
   ============================================================= */
#wraper {
    width: 100%;
    margin: 0 auto 1.5rem;
    font-size: 0.875rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: var(--fa-radius);
    overflow: hidden;
    background-color: var(--fa-bg-card);
    border: 1px solid var(--fa-border);
}

/* ---- AGENDA HEADER ---- */
.agenda-header {
    background: linear-gradient(to right, #16a34a, #15803d);
    color: #ffffff;
    text-align: center;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    padding: 0.75rem 1rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#title-agenda {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: #ffffff;
    letter-spacing: 0.01em;
}

/* ---- SEARCH TOOLBAR ---- */
.fa-search-wrap {
    padding: 10px 14px;
    background: #fdfdfd;
    border-bottom: 1px solid var(--fa-border);
}

.fa-search {
    width: 100%;
    padding: 8px 16px;
    background: #ffffff;
    border: 1px solid var(--fa-border);
    border-radius: 9999px;
    color: var(--fa-text-main);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.fa-search:focus {
    border-color: var(--fa-primary);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

/* ---- STATUS / SPINNER ---- */
.fa-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 16px;
    color: var(--fa-text-muted);
    font-size: 14px;
}

.fa-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--fa-primary);
    border-radius: 50%;
    animation: fa-spin 0.7s linear infinite;
}

@keyframes fa-spin { to { transform: rotate(360deg); } }

/* ---- EMPTY / ERROR ---- */
.fa-empty,
.fa-error {
    padding: 40px 16px;
    text-align: center;
    font-size: 14px;
    color: var(--fa-text-muted);
}

.fa-error { color: #dc2626; }

/* ---- MENU LIST ---- */
#menu {
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    list-style: none;
    width: 100%;
}

#menu > li {
    border-bottom: 1px solid var(--fa-border);
    list-style: none;
    transition: background-color 0.15s ease-in-out;
}

#menu > li:last-child {
    border-bottom: none;
}

/* Toggle row */
.toggle-submenu {
    padding: 0.65rem 1rem;
    cursor: pointer;
    display: block;
    user-select: none;
}

.toggle-submenu:hover {
    background-color: var(--fa-bg-hover);
}

.fa-event-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.fa-event-main {
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
}

/* Time */
.fa-event-time {
    width: 3.5rem;
    min-width: 3.5rem;
    text-align: center;
    font-weight: 700;
    font-size: 15px;
    color: var(--fa-text-main);
    font-family: inherit;
    flex-shrink: 0;
}

/* Country Flag */
.fa-event-flag {
    margin-left: 0.5rem;
    object-fit: contain;
    height: 1.5rem;
    width: 1.5rem;
    flex-shrink: 0;
    border-radius: 3px;
}

/* Match Title */
.fa-event-title {
    flex: 1;
    margin-left: 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--fa-text-title);
    font-size: 15px;
    line-height: 1.35;
    word-break: break-word;
}

/* Chevron indicator */
.fa-toggle-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 11px;
    margin-left: 8px;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.toggle-submenu.fa-open .fa-toggle-indicator {
    transform: rotate(180deg);
    color: var(--fa-primary);
}

/* Submenu container (Accordion) */
.fa-submenu {
    margin: 0.5rem 0 0 3.5rem;
    padding: 0.25rem 0 0.5rem 0;
    border-top: 1px solid #f1f5f9;
    list-style: none;
}

.submenu-item {
    display: block;
    text-decoration: none;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    color: #4a5568;
    transition: background-color 0.15s, color 0.15s;
}

.submenu-item:hover {
    background-color: #f0fdf4;
    color: var(--fa-primary);
    text-decoration: none;
}

.submenu-item-content {
    display: flex;
    align-items: center;
    list-style: none;
    font-size: 14.5px;
    font-weight: 600;
}

.fa-play-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background-color: #16a34a;
    border-radius: 50%;
    color: #ffffff;
    font-size: 8px;
    padding-left: 2px;
    margin-right: 0.6rem;
    flex-shrink: 0;
    transition: transform 0.15s;
}

.submenu-item:hover .fa-play-icon {
    transform: scale(1.15);
    background-color: var(--fa-primary-hover);
}

/* No signal notice */
.fa-no-channels {
    padding: 0.4rem 0.6rem;
    color: #718096;
    font-size: 13.5px;
    font-style: italic;
}

/* =============================================================
   2. CANALES DEPORTIVOS DISPONIBLES (CHANNELS SECTION)
   Exact match to futbollibreenvivotv.pe
   ============================================================= */
.channels-section {
    margin-top: 2.5rem;
    margin-bottom: 2rem;
}

.channels-title {
    text-align: center;
    font-size: 1.875rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--fa-primary-deep);
    letter-spacing: -0.01em;
    line-height: 1.25;
}

.channels-section .description {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.05rem;
    color: var(--fa-text-muted);
    line-height: 1.6;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* ---- CARDS GRID (4 Columns like target site) ---- */
.cards-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
}

/* ---- CARD ---- */
.card {
    background-color: #ffffff;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0,0,0,0.04);
    border-radius: var(--fa-radius-lg);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f0f2f5;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: scale(1.04);
    box-shadow: 0 16px 24px rgba(0, 0, 0, 0.12);
}

/* ---- CARD IMAGE ---- */
.card-image {
    height: 11.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f3f4f6;
    padding: 1rem;
}

.card-image img {
    height: 6.5rem;
    width: 6.5rem;
    object-fit: contain;
    transition: transform 0.25s ease;
}

.card:hover .card-image img {
    transform: scale(1.08);
}

.card-image-fallback {
    font-size: 52px;
    line-height: 1;
}

/* ---- CARD CONTENT ---- */
.card-content {
    padding: 1.5rem 1.25rem 1.75rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.card-content h3 {
    color: #1f2937;
    font-weight: 700;
    font-size: 1.25rem;
    margin: 0 0 0.5rem;
    line-height: 1.3;
}

.card-content p {
    color: #4b5563;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 1.5rem;
    flex: 1;
}

/* ---- BOTÓN VER CANAL ---- */
.btn-watch {
    background-color: #15803d;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.55rem 1.4rem;
    border-radius: 9999px;
    text-decoration: none !important;
    display: inline-block;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(21, 128, 61, 0.3);
}

.btn-watch:hover {
    background-color: #16a34a;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(21, 128, 61, 0.4);
    text-decoration: none !important;
}

/* =============================================================
   3. RESPONSIVE BREAKPOINTS (Matching target site)
   ============================================================= */
@media (max-width: 992px) {
    .cards-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (max-width: 800px) {
    .cards-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .channels-title {
        font-size: 1.5rem;
        margin-top: 1.75rem;
    }
}

@media (max-width: 640px) {
    .toggle-submenu {
        padding: 0.6rem 0.75rem;
    }

    .fa-event-time {
        font-size: 13.5px;
        width: 3.2rem;
        min-width: 3.2rem;
    }

    .fa-event-flag {
        height: 1.25rem;
        width: 1.25rem;
        margin-left: 0.35rem;
    }

    .fa-event-title {
        font-size: 13.5px;
        margin-left: 0.65rem;
    }

    .fa-submenu {
        margin-left: 2rem;
    }

    .submenu-item-content {
        font-size: 13.5px;
    }
}

@media (max-width: 480px) {
    .cards-container {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .card-image {
        height: 10rem;
    }

    .card-image img {
        height: 5.5rem;
        width: 5.5rem;
    }

    .card-content {
        padding: 1.25rem 1rem 1.5rem;
    }

    .card-content h3 {
        font-size: 1.15rem;
    }

    .channels-title {
        font-size: 1.35rem;
    }

    .channels-section .description {
        font-size: 0.95rem;
    }
}

/* =============================================================
   4. PROFESSIONAL PLAYER PAGE (Within WordPress Page / Theme)
   ============================================================= */
.fa-player-page-container {
    width: 100%;
    max-width: 1050px;
    margin: 1.5rem auto 3rem;
    padding: 0 1rem;
    box-sizing: border-box;
    font-family: 'Inter', arial, Arial, Helvetica, sans-serif;
    color: #1f2937;
    direction: ltr;
}

.fa-player-page-container * {
    box-sizing: border-box;
}

/* ---- TOP CHANNELS SELECTOR BAR ---- */
.fa-player-channels-bar {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.fa-channels-bar-label {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 0.9rem;
    color: #065f46;
    white-space: nowrap;
    flex-shrink: 0;
}

.fa-channels-bar-scroll {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    padding: 3px 0;
}

.fa-channels-bar-scroll::-webkit-scrollbar {
    height: 4px;
}
.fa-channels-bar-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

/* Channel Pill */
.fa-channel-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    color: #374151;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.fa-channel-pill:hover {
    background: #e5e7eb;
    color: #16a34a;
    text-decoration: none !important;
}

.fa-channel-pill.is-active {
    background: #15803d;
    color: #ffffff !important;
    border-color: #15803d;
    box-shadow: 0 2px 6px rgba(21, 128, 61, 0.35);
}

.fa-channel-pill.is-active:hover {
    background: #16a34a;
    color: #ffffff !important;
}

/* Pulsing live dot */
.fa-live-indicator {
    width: 7px;
    height: 7px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 6px #ef4444;
    animation: fa-pulse-dot 1.5s infinite;
    display: inline-block;
}

@keyframes fa-pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.3); }
}

/* ---- PLAYER HEADER ---- */
.fa-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 1rem;
}

.fa-player-title-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.fa-player-title {
    font-size: 1.45rem;
    font-weight: 800;
    color: #111827;
    margin: 0;
    line-height: 1.25;
}

.fa-badge-live {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 9999px;
    color: #dc2626;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.fa-badge-option {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 9999px;
    color: #059669;
    font-size: 0.8rem;
    font-weight: 700;
}

.fa-btn-agenda {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.2s;
}

.fa-btn-agenda:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
    text-decoration: none !important;
}

/* ---- 16:9 VIDEO PLAYER BOX ---- */
.fa-player-box {
    position: relative;
    width: 100%;
    background: #000000;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
    border: 1px solid #1f2937;
}

.fa-player-aspect {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 ratio */
}

.fa-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #000000;
}

/* No stream state */
.fa-no-stream {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #111827;
    color: #9ca3af;
    text-align: center;
    padding: 24px;
    gap: 10px;
}
.fa-no-stream-icon { font-size: 40px; }
.fa-no-stream strong { color: #f3f4f6; font-size: 1.1rem; }

/* ---- CONTROLS BAR ---- */
.fa-player-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.fa-btn-reload {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: #15803d;
    color: #ffffff !important;
    border: none;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(21, 128, 61, 0.3);
}

.fa-btn-reload:hover {
    background: #16a34a;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(21, 128, 61, 0.4);
}

.fa-btn-reload:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.fa-player-hint {
    font-size: 0.85rem;
    color: #6b7280;
}

/* ---- CHANNEL INFO CARD ---- */
.fa-player-info-card {
    margin-top: 1.5rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.fa-info-content {
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.65;
}

@media (max-width: 640px) {
    .fa-player-page-container {
        padding: 0 0.5rem;
        margin-top: 1rem;
    }

    .fa-player-title {
        font-size: 1.2rem;
    }

    .fa-player-channels-bar {
        padding: 0.6rem 0.75rem;
    }

    .fa-channel-pill {
        padding: 5px 11px;
        font-size: 0.8rem;
    }

    .fa-player-controls {
        flex-direction: column;
        align-items: flex-start;
    }
}

