/* =============================================================================
   flycheapy — TV Tonight
   Dark modern theme, completely new design
   ============================================================================= */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #e63946;
    --primary-dark: #c1121f;
    --primary-light: #fde8ea;
    --accent: #f4a261;
    --bg: #0f0f13;
    --bg-alt: #16161d;
    --surface: #1c1c27;
    --surface-hover: #24243a;
    --text: #f1faee;
    --text-muted: #a8b2d1;
    --border: #2a2a3d;
    --border-light: #333350;
    --success: #06d6a0;
    --error: #ef476f;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
    --max-w: 1140px;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }

/* ─── HEADER ─────────────────────────────────────────────────── */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(12px);
}

.header-inner {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.site-logo:hover { color: var(--accent); text-decoration: none; }

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: var(--text);
}

.header-nav { display: flex; align-items: center; gap: 4px; }

.header-nav a {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

.header-nav a:hover {
    background: var(--surface-hover);
    color: var(--text);
    text-decoration: none;
}

@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .header-nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 12px 24px;
        box-shadow: var(--shadow-lg);
    }
    .header-nav.open { display: flex; }
    .header-nav a { width: 100%; padding: 14px 16px; }
}

/* ─── MAIN ───────────────────────────────────────────────────── */
.site-main {
    min-height: 60vh;
    padding: 48px 24px 80px;
}

/* ─── BREADCRUMB ─────────────────────────────────────────────── */
.breadcrumb { margin-bottom: 20px; font-size: 0.85rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; }
.breadcrumb li { display: inline; }
.breadcrumb li + li::before { content: ' / '; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span[aria-current="page"] { color: var(--text); font-weight: 500; }

/* ─── HOME HERO ──────────────────────────────────────────────── */
.home-hero {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 56px;
}

.home-hero h1 {
    font-size: clamp(2.4rem, 7vw, 4rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin-bottom: 18px;
}

.home-hero h1 span { color: var(--primary); }

.home-hero p {
    font-size: 1.15rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 36px;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}

/* ─── SEARCH ─────────────────────────────────────────────────── */
.search-form { max-width: 520px; margin: 0 auto 20px; }

.search-form form {
    display: flex;
    border: 2px solid var(--border);
    border-radius: 50px;
    overflow: hidden;
    background: var(--surface);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-form form:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(230,57,70,0.15);
}

.search-form input[type="text"] {
    flex: 1;
    padding: 16px 24px;
    border: none;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    background: transparent;
    color: var(--text);
    min-width: 0;
}

.search-form input::placeholder { color: var(--text-muted); }

.search-form button {
    padding: 16px 32px;
    background: var(--primary);
    color: #fff;
    border: none;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
    white-space: nowrap;
}

.search-form button:hover { background: var(--primary-dark); }

/* ─── SECTION TITLE ──────────────────────────────────────────── */
.section-title {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ─── CHANNEL GRID — 4 cols desktop, 1 col mobile ────────────── */
.channels-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    max-width: 1000px;
    margin: 0 auto;
}

@media (min-width: 480px) { .channels-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .channels-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .channels-grid { grid-template-columns: repeat(4, 1fr); } }

.channel-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 16px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-align: center;
    transition: all 0.2s;
    text-decoration: none;
}

.channel-card:hover {
    border-color: var(--primary);
    background: var(--surface-hover);
    box-shadow: 0 8px 30px rgba(230,57,70,0.2);
    transform: translateY(-4px);
    text-decoration: none;
    color: var(--text);
}

.channel-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.channel-card-name {
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.channel-card-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    background: rgba(230,57,70,0.1);
    padding: 3px 10px;
    border-radius: 50px;
}

/* ─── HOME CTA ───────────────────────────────────────────────── */
.home-cta { text-align: center; margin-top: 28px; }
.btn-lg { padding: 14px 36px; font-size: 1rem; border-radius: 50px; }

/* ─── HOME CONTENT ───────────────────────────────────────────── */
.home-content { max-width: 750px; margin: 56px auto 0; }
.home-content h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 14px; color: var(--text); }
.home-content p { color: var(--text-muted); line-height: 1.8; margin-bottom: 16px; }

.home-features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin: 24px 0 44px;
}

@media (min-width: 500px) { .home-features { grid-template-columns: repeat(2, 1fr); } }

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.feature-card:hover { border-color: var(--primary); box-shadow: 0 4px 20px rgba(230,57,70,0.1); }

.feature-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    display: block;
}

.feature-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; color: var(--text); }
.feature-card p { color: var(--text-muted); font-size: 0.92rem; line-height: 1.6; margin: 0; }

/* ─── HOME FAQ ───────────────────────────────────────────────── */
.home-faq { max-width: 750px; margin: 56px auto 0; }
.home-faq h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 20px; text-align: center; }

.faq-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    overflow: hidden;
}

.faq-item summary {
    padding: 18px 24px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text);
    transition: background 0.15s;
}

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.3rem; color: var(--text-muted); transition: transform 0.2s; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item summary:hover { background: var(--surface-hover); }

.faq-item .faq-answer {
    padding: 0 24px 18px;
    color: var(--text-muted);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* ─── TV GUIDE CONTAINER ─────────────────────────────────────── */
.tv-guide-container { max-width: var(--max-w); margin: 0 auto; }

.tv-guide-container h1 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    margin-bottom: 8px;
    font-weight: 700;
    line-height: 1.2;
}

.tv-guide-subtitle { color: var(--text-muted); font-size: 1rem; margin-bottom: 28px; }

/* ─── CONTROLS ───────────────────────────────────────────────── */
.tv-guide-controls { display: flex; flex-direction: column; gap: 12px; margin: 24px 0; }
@media (min-width: 600px) { .tv-guide-controls { flex-direction: row; gap: 16px; } }

.tv-guide-controls .ctrl-group { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }

.tv-guide-controls label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.tv-guide-controls select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 48px;
    padding: 0 42px 0 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background-color: var(--surface);
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a8b2d1' d='M10.293 3.293L6 7.586 1.707 3.293 0.293 4.707 6 10.414l5.707-5.707z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 10px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.tv-guide-controls select:hover { border-color: var(--text-muted); }
.tv-guide-controls select:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(230,57,70,0.15); }

#tv-guide-info { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; font-weight: 500; }

/* ─── TABLE ──────────────────────────────────────────────────── */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
}

.tv-guide-table { width: 100%; border-collapse: collapse; background: var(--surface); }

.tv-guide-table th, .tv-guide-table td {
    padding: 14px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.tv-guide-table thead th {
    background: var(--bg-alt);
    font-weight: 700;
    font-size: 0.78em;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
}

.tv-guide-table tbody tr { transition: background 0.1s; }
.tv-guide-table tbody tr:hover { background: var(--surface-hover); }

.tv-guide-table td.action-cell { text-align: center; white-space: nowrap; }

.tv-guide-table tr.now, .tv-guide-table tr.now td {
    background: rgba(230,57,70,0.08);
    border-left: 3px solid var(--primary);
}

.tv-guide-table tr.past { opacity: 0.45; }
.tv-guide-table tr.past:hover { opacity: 0.65; }

.channel-name { font-weight: 600; font-size: 0.95em; color: var(--text); }

/* ─── BUTTONS ────────────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 10px 22px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 0.88em;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s;
}

.btn:hover { background: var(--primary-dark); text-decoration: none; color: #fff; }
.btn:active { transform: scale(0.97); }

/* ─── CHANNEL DESC ───────────────────────────────────────────── */
.channel-desc {
    background: var(--surface);
    padding: 28px;
    border-radius: var(--radius);
    margin: 30px 0;
    line-height: 1.8;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.channel-desc p { margin-bottom: 12px; }
.channel-desc p:last-child { margin-bottom: 0; }

/* ─── CHANNEL SECTIONS ───────────────────────────────────────── */
.channel-sections { margin: 32px 0; }
.channel-sections section { margin-bottom: 24px; }
.channel-sections h2 { font-size: 1.3rem; margin-bottom: 8px; font-weight: 700; }
.channel-sections p { color: var(--text-muted); line-height: 1.7; }

/* ─── RELATED ────────────────────────────────────────────────── */
.related-channels { margin: 32px 0; }
.related-channels h3 { font-size: 1.2rem; margin-bottom: 12px; }
.related-channels h4 { font-size: 0.95rem; color: var(--text-muted); margin: 16px 0 8px; }

.related-channels ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.related-channels li a {
    display: inline-block;
    padding: 7px 16px;
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.88em;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.15s;
}

.related-channels li a:hover {
    border-color: var(--primary);
    background: rgba(230,57,70,0.08);
    color: var(--primary);
    text-decoration: none;
}

/* ─── FAQ (Channel) ──────────────────────────────────────────── */
.faq-section { margin: 40px 0; }
.faq-section h2 { font-size: 1.4rem; margin-bottom: 20px; }

.faq-item-channel {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    background: var(--surface);
}

.faq-item-channel summary {
    padding: 16px 20px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text);
}

.faq-item-channel summary::-webkit-details-marker { display: none; }
.faq-item-channel summary::after { content: '+'; font-size: 1.2rem; color: var(--text-muted); }
.faq-item-channel[open] summary::after { content: '−'; }
.faq-item-channel .faq-answer { padding: 0 20px 16px; color: var(--text-muted); line-height: 1.7; }

/* ─── SEARCH PAGE ────────────────────────────────────────────── */
.search-page h1 { margin-bottom: 16px; }
.search-count { color: var(--text-muted); margin-bottom: 20px; font-size: 0.95rem; }

.no-results-box {
    text-align: center;
    padding: 48px 20px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.no-results { color: var(--text-muted); text-align: center; padding: 40px; }
.text-center { text-align: center; }

/* ─── PAGINATION ─────────────────────────────────────────────── */
.pagination { margin: 32px 0; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.pagination a, .pagination span {
    display: inline-block;
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.88em;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface);
    transition: all 0.15s;
}

.pagination .current, .pagination a:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    text-decoration: none;
}

/* ─── ERROR ──────────────────────────────────────────────────── */
.error-page { text-align: center; padding: 80px 20px; }
.error-page h1 { font-size: 2rem; margin-bottom: 12px; }
.error-page p { color: var(--text-muted); margin-bottom: 24px; }

.error-page a {
    display: inline-block;
    padding: 14px 32px;
    background: var(--primary);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.error-page a:hover { background: var(--primary-dark); text-decoration: none; }

/* ─── STATIC PAGES ───────────────────────────────────────────── */
.static-page { max-width: 750px; margin: 0 auto; }

.static-page h1 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
}

.static-updated { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 28px; }

.static-content { line-height: 1.8; }
.static-content h2 { font-size: 1.3rem; font-weight: 700; margin-top: 32px; margin-bottom: 10px; }
.static-content h3 { font-size: 1.05rem; font-weight: 600; margin-top: 20px; margin-bottom: 8px; }
.static-content p { margin-bottom: 16px; color: var(--text-muted); }
.static-content ul, .static-content ol { margin: 12px 0 16px 24px; }
.static-content li { margin-bottom: 8px; color: var(--text-muted); }

/* ─── CONTACT ────────────────────────────────────────────────── */
.contact-methods { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 20px 0 32px; }
@media (min-width: 600px) { .contact-methods { grid-template-columns: repeat(2, 1fr); } }

.contact-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color 0.2s;
}

.contact-card:hover { border-color: var(--primary); }
.contact-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.contact-card p { font-size: 0.92rem; color: var(--text-muted); margin-bottom: 8px; line-height: 1.5; }
.contact-email { font-weight: 600; color: var(--primary) !important; }

.contact-form { max-width: 600px; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.92rem; color: var(--text); }

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--surface);
    color: var(--text);
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(230,57,70,0.15);
}

.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-muted); }
.form-group textarea { resize: vertical; min-height: 100px; }

.form-submit {
    display: inline-block;
    padding: 14px 32px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}

.form-submit:hover { background: var(--primary-dark); }

/* ─── ALERTS ─────────────────────────────────────────────────── */
.alert { padding: 16px 20px; border-radius: var(--radius-sm); margin: 20px 0; font-weight: 500; font-size: 0.95rem; }
.alert-success { background: rgba(6,214,160,0.1); color: var(--success); border: 1px solid rgba(6,214,160,0.3); }
.alert-error { background: rgba(239,71,111,0.1); color: var(--error); border: 1px solid rgba(239,71,111,0.3); }

/* ─── FOOTER ─────────────────────────────────────────────────── */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 40px 24px;
}

.footer-container {
    max-width: var(--max-w);
    margin: 0 auto;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }

.footer-links a {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 500;
    transition: color 0.15s;
}

.footer-links a:hover { color: var(--primary); text-decoration: none; }

.footer-copyright {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-top: 24px;
    width: 100%;
}

/* ─── RESPONSIVE TABLE ───────────────────────────────────────── */
@media screen and (max-width: 600px) {
    .tv-guide-table thead { display: none; }
    .tv-guide-table tr { display: block; border-bottom: 1px solid var(--border); padding: 14px 16px; }
    .tv-guide-table td { display: flex; justify-content: space-between; align-items: center; border: none; padding: 6px 0; }

    .tv-guide-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--text-muted);
        text-transform: uppercase;
        font-size: 0.72em;
        letter-spacing: 0.05em;
        min-width: 80px;
    }

    .tv-guide-table tr.now { border-left: 3px solid var(--primary); background: rgba(230,57,70,0.08); }
    .tv-guide-table tr.now td { background: transparent; }
}
