/* LogaTV – světlý veselý design – BEZ externích fontů */

:root {
    --bg-base:       #f0f4ff;
    --bg-surface:    #ffffff;
    --bg-card:       #ffffff;
    --bg-card-hover: #fff8f2;
    --bg-sidebar:    #ffffff;

    --accent:        #ff5722;
    --accent-dim:    #e64a19;
    --accent-subtle: rgba(255,87,34,0.09);

    --accent2:       #00bcd4;
    --accent3:       #ffeb3b;
    --accent4:       #66bb6a;

    --text-primary:  #1a237e;
    --text-secondary:#546e7a;
    --text-muted:    #90a4ae;

    --border:        #e0e4ef;
    --border-strong: #c5cae9;

    --live-green:    #43a047;
    --warn-amber:    #fb8c00;
    --danger:        #e53935;

    --radius-sm:  8px;
    --radius-md:  14px;
    --radius-lg:  20px;

    --font-display: 'Nunito', 'Segoe UI', Arial, sans-serif;
    --font-body:    'DM Sans', 'Segoe UI', Arial, sans-serif;

    --shadow-card:  0 2px 12px rgba(26,35,126,0.07);
    --shadow-hover: 0 8px 28px rgba(255,87,34,0.18);

    --sidebar-w: 260px;
    --transition: 0.17s ease;
}

/* Google Fonts – neblokující */

*, *:before, *:after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    background: var(--bg-base) !important;
    color: var(--text-primary) !important;
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c5cae9; border-radius: 4px; }
* { scrollbar-width: thin; scrollbar-color: #c5cae9 transparent; }

/* ── LOGIN ── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8f5e9 0%, #e3f2fd 40%, #fff8e1 100%) !important;
}

.login-box {
    background: #fff;
    padding: 48px 44px;
    border-radius: 24px;
    box-shadow: 0 12px 48px rgba(26,35,126,0.13);
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.login-logo {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 2.8em;
    color: var(--accent);
    margin-bottom: 4px;
    letter-spacing: -1px;
}
.login-logo span { color: var(--accent2); }

.login-subtitle {
    font-size: 0.87em;
    color: var(--text-muted);
    margin-bottom: 30px;
}

.login-box input {
    width: 100%;
    padding: 13px 16px;
    margin-bottom: 13px;
    background: #f5f7ff;
    border: 2px solid var(--border);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1em;
    transition: border-color var(--transition);
    display: block;
}
.login-box input:focus { outline: none; border-color: var(--accent); background: #fff; }

.login-box button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent), #ff8a65);
    border: none;
    color: #fff;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.08em;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: opacity var(--transition), transform 0.1s;
    letter-spacing: 0.5px;
}
.login-box button:hover { opacity: 0.92; transform: translateY(-1px); }

.login-error {
    color: var(--danger);
    font-size: 0.87em;
    margin-bottom: 14px;
    padding: 10px 14px;
    background: rgba(229,57,53,0.07);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--danger);
    text-align: left;
}

/* ── HEADER ── */
.page-header {
    background: #fff;
    border-bottom: 2px solid var(--border);
    padding: 0 28px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 10px rgba(26,35,126,0.07);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.logo-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #42a5f5, #66bb6a, #ffa726, #ef5350);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(66,165,245,0.3);
}
.logo-text {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.65em;
    line-height: 1;
    letter-spacing: -0.5px;
}
.logo-moje {
    background: linear-gradient(90deg, #1565c0, #00897b, #f9a825);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.logo-tv {
    color: #1a237e;
    -webkit-text-fill-color: #1a237e;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-base);
    border-radius: 30px;
    padding: 5px 14px 5px 5px;
    font-size: 0.87em;
    font-weight: 600;
    color: var(--text-secondary);
}

.user-avatar {
    width: 30px; height: 30px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9em;
    color: #fff;
}

.btn-logout {
    padding: 7px 15px;
    background: transparent;
    border: 2px solid var(--border-strong);
    color: var(--text-secondary);
    border-radius: 30px;
    font-size: 0.84em;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.btn-logout:hover { border-color: var(--danger); color: var(--danger); background: rgba(229,57,53,0.05); }

/* ── KATEGORIE ── */
.cat-bar {
    background: #fff;
    padding: 12px 28px;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: wrap;
}

.cat-btn {
    padding: 6px 16px;
    border-radius: 30px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85em;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition);
    border: 2px solid var(--border);
    background: #fff;
    color: var(--text-secondary);
    text-decoration: none;
    display: inline-block;
}
.cat-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-subtle); }
.cat-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── KANÁLY GRID ── */
.channels-wrap { padding: 24px 28px; }

.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.channel-card {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border);
    overflow: hidden;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-card);
}
.channel-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-hover);
    transform: translateY(-3px);
}

.channel-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #fff3e0, #e3f2fd);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 12px;
}

.channel-thumb img {
    max-width: 80%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.no-icon { font-size: 2em; opacity: 0.4; }

.channel-body {
    padding: 10px 12px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    border-top: 1px solid var(--border);
}

.channel-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 0.88em;
    color: var(--text-primary);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.epg-now-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.78em;
    color: var(--text-secondary);
    font-weight: 500;
    overflow: hidden;
}

.epg-live-dot {
    width: 7px; height: 7px;
    background: var(--live-green);
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.8s infinite;
    flex-shrink: 0;
}
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.5;transform:scale(0.8)} }

.epg-now-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.epg-time-small {
    font-size: 0.74em;
    color: var(--text-muted);
    font-weight: 500;
}

/* ── PLAYER LAYOUT ── */
.player-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-base);
}

.epg-panel {
    width: 360px;
    min-width: 300px;
    background: #fff;
    border-right: 2px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.epg-panel-header {
    padding: 14px 16px;
    border-bottom: 2px solid var(--border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #fff3e0, #e3f2fd);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #fff;
    border: 2px solid var(--border);
    border-radius: 30px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.82em;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    flex-shrink: 0;
}
.btn-back:hover { border-color: var(--accent); color: var(--accent); }

.epg-channel-info { flex: 1; overflow: hidden; }
.epg-channel-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1em;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.epg-label { font-size: 0.72em; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

/* Tabs */
.epg-tabs { display: flex; border-bottom: 2px solid var(--border); flex-shrink: 0; }
.epg-tab {
    flex: 1;
    padding: 10px 0;
    text-align: center;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.87em;
    cursor: pointer;
    color: var(--text-muted);
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
    background: transparent;
}
.epg-tab:hover { color: var(--accent); }
.epg-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Datum nav */
.archive-date-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: #f8f9ff;
}
.date-nav-btn {
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1em;
    transition: all var(--transition);
    color: var(--text-secondary);
}
.date-nav-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.date-nav-btn:disabled { opacity: 0.3; cursor: default; }
.date-nav-label { font-family: var(--font-display); font-weight: 700; font-size: 0.92em; color: var(--text-primary); }

/* EPG scroll */
.epg-scroll { flex: 1; overflow-y: auto; padding: 8px 10px; }

.epg-item {
    padding: 11px 13px;
    border-radius: var(--radius-md);
    margin-bottom: 6px;
    border: 2px solid var(--border);
    background: #fff;
    transition: all var(--transition);
}
.epg-item.now {
    background: linear-gradient(135deg, #fff8e1, #fff3e0);
    border-color: var(--accent);
    box-shadow: 0 2px 10px rgba(255,87,34,0.12);
}
.epg-item.past { cursor: pointer; background: #f8f9ff; }
.epg-item.past:hover {
    border-color: var(--accent2);
    background: linear-gradient(135deg, #e0f7fa, #fff);
    transform: translateX(3px);
}
.epg-item.playing { border-color: var(--accent2); background: linear-gradient(135deg, #e0f7fa, #fff); }

.epg-item-time {
    font-family: var(--font-display);
    font-size: 0.83em;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 3px;
    display: flex; align-items: center; gap: 6px;
}
.epg-item.past .epg-item-time { color: var(--accent2); }
.epg-item.playing .epg-item-time { color: var(--accent2); }

.epg-item-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.92em;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 3px;
}
.epg-item-desc {
    font-size: 0.80em;
    color: var(--text-secondary);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.epg-remaining {
    display: inline-block;
    margin-top: 5px;
    font-size: 0.75em;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--warn-amber);
    background: rgba(251,140,0,0.1);
    border: 1px solid rgba(251,140,0,0.3);
    border-radius: 20px;
    padding: 2px 9px;
}
.epg-archive-hint {
    display: inline-flex; align-items: center; gap: 4px;
    margin-top: 5px;
    font-size: 0.75em;
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--accent2);
    background: rgba(0,188,212,0.1);
    border: 1px solid rgba(0,188,212,0.3);
    border-radius: 20px;
    padding: 2px 9px;
}

/* Badges */
.badge-live { display:inline-flex; align-items:center; gap:5px; padding:4px 12px; background:rgba(67,160,71,0.12); border:1.5px solid rgba(67,160,71,0.4); color:#2e7d32; border-radius:20px; font-family:var(--font-display); font-weight:800; font-size:0.82em; }
.badge-archive { display:inline-flex; align-items:center; gap:5px; padding:4px 12px; background:rgba(0,188,212,0.12); border:1.5px solid rgba(0,188,212,0.4); color:#00838f; border-radius:20px; font-family:var(--font-display); font-weight:800; font-size:0.82em; }
.badge-buffer { display:inline-flex; align-items:center; gap:5px; padding:4px 12px; background:rgba(251,140,0,0.12); border:1.5px solid rgba(251,140,0,0.4); color:var(--warn-amber); border-radius:20px; font-family:var(--font-display); font-weight:800; font-size:0.82em; }
.badge-error { display:inline-flex; align-items:center; gap:5px; padding:4px 12px; background:rgba(229,57,53,0.1); border:1.5px solid rgba(229,57,53,0.3); color:var(--danger); border-radius:20px; font-family:var(--font-display); font-weight:800; font-size:0.82em; }

/* Video panel */
.video-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #1a1a2e;
    min-width: 0;
}
.video-wrap {
    flex: 1;
    display: flex; align-items: center; justify-content: center;
    background: #0d0d1a;
    padding: 20px;
}
.video-inner {
    width: 100%;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    position: relative;
}
.video-ratio { position:relative; width:100%; height:0; padding-top:56.25%; }
@supports (aspect-ratio:16/9) { .video-ratio { height:auto; padding-top:0; aspect-ratio:16/9; } }
.video-ratio video { position:absolute; top:0; left:0; width:100%; height:100%; display:block; background:#000; }

.player-info-bar {
    padding: 12px 18px;
    background: #1e2340;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.player-info-bar h1 {
    font-family: var(--font-display);
    font-size: 1em; font-weight: 800;
    color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
}

.btn-live-back {
    display: none;
    align-items: center; gap: 5px;
    padding: 6px 13px;
    background: rgba(255,87,34,0.15);
    border: 1.5px solid rgba(255,87,34,0.4);
    color: #ff8a65;
    border-radius: 20px;
    font-family: var(--font-display); font-weight: 700; font-size: 0.82em;
    cursor: pointer; transition: all var(--transition);
}
.btn-live-back.visible { display: inline-flex; }
.btn-live-back:hover { background: var(--accent); color: #fff; }

.no-epg { padding: 40px 16px; text-align: center; color: var(--text-muted); font-family: var(--font-display); font-weight: 600; font-size: 0.93em; }
.no-epg .no-epg-icon { font-size: 2em; margin-bottom: 10px; }

.empty-state { text-align:center; padding:80px 20px; color:var(--text-muted); font-family:var(--font-display); grid-column:1/-1; }
.empty-state .empty-icon { font-size:3em; margin-bottom:12px; }

/* Responsive */
@media (max-width:800px) {
    .player-layout { flex-direction:column; height:auto; overflow:auto; }
    .epg-panel { width:100%; min-width:0; height:auto; max-height:50vh; border-right:none; border-bottom:2px solid var(--border); }
    .video-panel { min-height:56vw; }
    .video-wrap { padding:10px; }
    .page-header { padding:0 14px; }
    .channels-wrap { padding:14px; }
    .cat-bar { padding:10px 14px; }
    .channels-grid { grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); gap:10px; }
}

/* Login logo */
.login-logo-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 6px;
}
