/* Soubor: assets/css/style.css | Verze: 4.80 (Sidebar Cards & Modal Checklists) */

* { box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
body { margin: 0; padding: 0; background-color: #f4f6f9; color: #333; display: flex; height: 100vh; overflow: hidden; }

/* --- Layout Desktop --- */
.container { display: flex; width: 100%; height: 100%; position: relative; }
.sidebar { width: 320px; background: #f8fafc; border-right: 1px solid #e2e8f0; padding: 20px; overflow-y: auto; flex-shrink: 0; display: flex; flex-direction: column; z-index: 1000; transition: left 0.3s ease; }
.main-content { flex-grow: 1; padding: 30px; overflow-y: auto; background: #f4f6f9; position: relative; width: 100%; }

/* --- Mobile Header & Overlay --- */
.mobile-header { display: none; align-items: center; gap: 15px; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #e1e4e8; background: #f4f6f9; position: sticky; top: 0; z-index: 9980; }
.mobile-header h2 { margin: 0; color: #2c3e50; font-size: 1.3rem; flex-grow: 1; }
.hamburger-btn { background: #3498db; color: white; border: none; padding: 8px 12px; border-radius: 4px; font-size: 1.2rem; cursor: pointer; display: flex; align-items: center; justify-content: center; position: relative; z-index: 9990; }
.mobile-overlay { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(15, 23, 42, 0.6); z-index: 9990; backdrop-filter: blur(2px); }

/* --- Sidebar prvky --- */
.sidebar h2 { margin-top: 0; color: #1e293b; font-size: 1.5rem; border-bottom: 2px solid #3498db; padding-bottom: 10px; }
.sidebar h3 { font-size: 0.95rem; color: #64748b; text-transform: uppercase; margin-top: 25px; margin-bottom: 12px; font-weight: 700; letter-spacing: 0.5px; }
.user-info { background: #ffffff; border: 1px solid #e2e8f0; padding: 15px; border-radius: 8px; margin-bottom: 0; margin-top: auto; font-size: 0.95rem; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.user-info a { color: #ef4444; font-weight: bold; text-decoration: none; display: inline-block; margin-top: 8px; font-size: 0.9rem; }

ul { list-style: none; padding: 0; margin: 0; }
.menu-link { display: block; padding: 12px 15px; color: #334155; text-decoration: none; border-radius: 8px; margin-bottom: 5px; transition: all 0.2s; font-weight: 600; background: #ffffff; border: 1px solid transparent; }
.menu-link:hover { background: #f1f5f9; border-color: #e2e8f0; }
.menu-link.active { background: #3498db; color: white; border-color: #3498db; box-shadow: 0 2px 4px rgba(52,152,219,0.2); }

/* Nový vzhled pro seznamy (Karty) */
.album-list li, .channel-list li { background: #ffffff; border: 1px solid #e2e8f0; padding: 12px; margin-bottom: 10px; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,0.02); transition: all 0.2s; display: flex; flex-direction: column; gap: 8px; }
.album-list li:hover, .channel-list li:hover { border-color: #cbd5e1; box-shadow: 0 3px 6px rgba(0,0,0,0.04); transform: translateY(-1px); }
.album-list li.active { border-color: #3498db; background: #f0f8ff; border-left: 4px solid #3498db; }

.list-item-main { display: flex; justify-content: space-between; align-items: flex-start; width: 100%; gap: 10px; }
.item-name { font-weight: 600; font-size: 1.05rem; color: #1e293b; text-decoration: none; word-break: break-word; line-height: 1.3; }
.list-item-sub { font-size: 0.85rem; color: #64748b; line-height: 1.4; }

/* --- Formuláře a tlačítka --- */
.form-group { display: flex; gap: 10px; margin-bottom: 15px; align-items: flex-end; }
input[type="text"], input[type="password"], input[type="number"], input[type="url"], select { padding: 12px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 1rem; width: 100%; outline: none; transition: border-color 0.2s; background: #fff; }
input[type="text"]:focus, input[type="password"]:focus, input[type="url"]:focus, select:focus { border-color: #3498db; box-shadow: 0 0 0 2px rgba(52,152,219,0.2); }
label { display: block; font-size: 0.9rem; margin-bottom: 6px; font-weight: 600; color: #475569; }

.btn { background: #3498db; color: white; border: none; padding: 12px 18px; border-radius: 6px; cursor: pointer; font-weight: bold; transition: background 0.2s; text-decoration: none; display: inline-flex; justify-content: center; align-items: center; font-size: 1rem; }
.btn:hover { background: #2980b9; }
.btn-danger { background: #ef4444; color: white; border: none; padding: 8px 14px; border-radius: 6px; cursor: pointer; font-weight: bold; font-size: 0.95rem; }
.btn-danger:hover { background: #dc2626; }
.push-tv-btn { background: #2ecc71; color: white; border: none; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 0.85rem; font-weight: bold; box-shadow: 0 2px 4px rgba(46,204,113,0.2); }
.push-tv-btn:hover { background: #27ae60; }

/* --- Taby (Záložky) --- */
.tabs { display: flex; margin-bottom: 20px; border-bottom: 2px solid #e2e8f0; gap: 5px; }
.tab-link { padding: 12px 20px; cursor: pointer; border: none; background: none; font-weight: 600; color: #64748b; font-size: 1rem; border-bottom: 3px solid transparent; margin-bottom: -2px; transition: all 0.2s; border-radius: 6px 6px 0 0; }
.tab-link:hover { color: #1e293b; background: #f8fafc; }
.tab-link.active { color: #3498db; border-bottom-color: #3498db; background: #fff; }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* --- Obsah alba (Grid) --- */
.card { background: white; padding: 25px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); margin-bottom: 20px; border: 1px solid #e2e8f0; width: 100%; }
.card h3 { margin-top: 0; color: #1e293b; border-bottom: 1px solid #f1f5f9; padding-bottom: 12px; margin-bottom: 18px; font-size: 1.2rem; }
.upload-group { border: 2px dashed #3498db; background: #f0f8ff; padding: 40px 20px; text-align: center; border-radius: 10px; cursor: pointer; margin-top: 15px; transition: background 0.3s; }
.upload-group.drag-over { background: #d6eaf8; border-color: #2980b9; }
.upload-group input[type="file"] { display: none; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.photo-item { background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.06); border: 1px solid #e2e8f0; transition: transform 0.2s; display: flex; flex-direction: column; position: relative; }
.photo-item:hover { transform: translateY(-4px); box-shadow: 0 6px 12px rgba(0,0,0,0.1); }
.photo-item.sortable-ghost { opacity: 0.4; }
.drag-handle { cursor: grab; padding: 10px; background: #f8fafc; text-align: center; font-size: 16px; color: #94a3b8; border-bottom: 1px solid #e2e8f0; }
.drag-handle:active { cursor: grabbing; }
.photo-item img { width: 100%; height: 160px; object-fit: cover; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
.photo-info { padding: 15px; font-size: 0.9rem; color: #475569; word-break: break-all; flex-grow: 1; display: flex; flex-direction: column; justify-content: space-between; }

/* --- Dashboard Statistiky a Notifikace --- */
.dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; margin-bottom: 24px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; margin-bottom: 24px; }
.stat-card { background: #fff; padding: 24px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); border: 1px solid #e2e8f0; text-align: center; }
.stat-card h3 { margin: 0 0 12px 0; color: #64748b; font-size: 0.9rem; text-transform: uppercase; border: none; padding: 0; letter-spacing: 0.5px; }
.stat-card p { margin: 0; font-size: 2.8rem; font-weight: bold; color: #1e293b; line-height: 1; }
.stat-card .success { color: #10b981; }
.stat-card .warning { color: #f59e0b; }

.notif-card { display: flex; align-items: flex-start; gap: 12px; background: #fef3c7; border-left: 4px solid #f59e0b; padding: 16px; border-radius: 6px; margin-bottom: 12px; font-size: 0.95rem; color: #92400e; line-height: 1.5; box-shadow: 0 1px 2px rgba(0,0,0,0.02); }
.notif-card.empty { background: #fee2e2; border-color: #ef4444; color: #991b1b; }
.notif-card.sync { background: #e0f2fe; border-color: #0ea5e9; color: #075985; }
.notif-icon { font-size: 1.5rem; padding-top: 2px; }
.notif-content { flex-grow: 1; }
.notif-time { font-size: 0.8rem; color: #b45309; font-weight: 700; margin-bottom: 4px; display: block; text-transform: uppercase; letter-spacing: 0.5px; }
.notif-details { margin-top: 10px; font-size: 0.85rem; opacity: 0.9; padding-top: 10px; border-top: 1px solid rgba(0,0,0,0.08); }

/* Obálka pro responzivní tabulky */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 6px; }
.dash-table { width: 100%; border-collapse: collapse; min-width: 400px; }
.dash-table th { background: #f8fafc; padding: 14px; text-align: left; border-bottom: 2px solid #cbd5e1; font-size: 0.95rem; }
.dash-table td { padding: 14px; border-bottom: 1px solid #e2e8f0; font-size: 0.95rem; }

/* --- Tabulky (Uživatelé, Logy) --- */
table { width: 100%; border-collapse: collapse; min-width: 500px; }
th { background: #f8fafc; padding: 16px; text-align: left; border-bottom: 2px solid #cbd5e1; color: #475569; font-weight: 600; font-size: 0.95rem; }
td { padding: 16px; border-bottom: 1px solid #e2e8f0; color: #334155; font-size: 0.95rem; }
tr:hover td { background: #f1f5f9; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 0.8rem; font-weight: bold; }
.badge.admin { background: #fee2e2; color: #ef4444; }
.badge.user { background: #e0f2fe; color: #0ea5e9; }

/* --- Pilulky (Pills) --- */
.pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; line-height: 1.2; }
.pill-album { background-color: #f1f5f9; color: #334155; text-transform: none; font-weight: 600; border: 1px dashed #cbd5e1; }
.pill-auto { background-color: #dcfce7; color: #166534; }
.pill-manual { background-color: #ffedd5; color: #9a3412; }

/* --- Plánovač a Stavy --- */
.scheduler-grid { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.channel-column { background: white; width: 350px; border-radius: 10px; border: 1px solid #e2e8f0; box-shadow: 0 2px 8px rgba(0,0,0,0.04); overflow: hidden; max-width: 100%; }
.channel-header { background: #f8fafc; padding: 18px; border-bottom: 1px solid #e2e8f0; display: flex; justify-content: space-between; align-items: center; }
.channel-header h3 { margin: 0; color: #1e293b; font-size: 1.15rem; border: none; padding: 0; word-break: break-all; }
.channel-body { padding: 18px; min-height: 200px; }

.event-card { background: #f8fafc; border-left: 6px solid #d946ef; padding: 16px; margin-bottom: 12px; border-radius: 6px; border-top: 1px solid #e2e8f0; border-right: 1px solid #e2e8f0; border-bottom: 1px solid #e2e8f0; cursor: pointer; transition: all 0.2s; position: relative; }
.event-card:hover { background: #f1f5f9; box-shadow: 0 2px 6px rgba(0,0,0,0.05); }
.event-card.playing-now { border-left-color: #10b981; background-color: #ecfdf5; }
.event-card.playing-now:hover { background-color: #d1fae5; }
.event-card.playing-now::after { content: 'Právě běží'; position: absolute; top: 16px; right: 16px; background: #10b981; color: white; font-size: 0.7rem; padding: 4px 10px; border-radius: 12px; font-weight: bold; }
.event-card.up-next { border-left-color: #f59e0b; background-color: #fffbeb; }
.event-card.up-next::after { content: 'Následuje'; position: absolute; top: 16px; right: 16px; background: #f59e0b; color: white; font-size: 0.7rem; padding: 4px 10px; border-radius: 12px; font-weight: bold; }

.channel-column.is-manual .event-card { opacity: 0.6; filter: grayscale(0.8); border-left-color: #cbd5e1; }
.channel-column.is-manual .event-card:hover { opacity: 0.9; filter: grayscale(0); }
.channel-column.is-manual .event-card.playing-now::after { content: 'Běželo by'; background: #94a3b8; color: white; }
.channel-column.is-manual .event-card.up-next::after { content: 'Následovalo by'; background: #cbd5e1; color: #475569; }

.event-time { font-weight: bold; color: #1e293b; font-size: 1.05rem; margin-bottom: 8px; }
.event-album { color: #64748b; font-size: 0.95rem; }
.dropdown-content { display: none; position: absolute; right: 0; top: 100%; background-color: #ffffff; min-width: 240px; box-shadow: 0px 10px 25px rgba(0,0,0,0.1); z-index: 100; border-radius: 8px; border: 1px solid #e2e8f0; padding: 8px 0; }
.dropdown-content a { color: #334155; padding: 14px 20px; text-decoration: none; display: block; font-size: 1rem; font-weight: 500; transition: background 0.2s; }
.dropdown-content a:hover { background-color: #f1f5f9; }
.dropdown-content a.danger-text { color: #ef4444; border-top: 1px solid #f1f5f9; margin-top: 5px; padding-top: 14px; }

/* --- Modální okna a Checkboxy --- */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.7); display: none; align-items: center; justify-content: center; z-index: 10000; backdrop-filter: blur(2px); }
.modal-box { background: white; padding: 30px; border-radius: 12px; width: 90%; max-width: 480px; box-shadow: 0 15px 35px rgba(0,0,0,0.2); max-height: 90vh; overflow-y: auto; }
.modal-box h3 { margin-top: 0; margin-bottom: 24px; color: #1e293b; border: none; padding: 0; font-size: 1.4rem; font-weight: 700; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 30px; }

/* Nový prvek: Scrollující seznam checkboxů pro modální okna */
.modal-checkbox-list { margin-bottom: 20px; max-height: 250px; overflow-y: auto; border: 1px solid #e2e8f0; padding: 15px; border-radius: 8px; background: #f8fafc; }
.modal-checkbox-list label { display: flex; align-items: center; margin-bottom: 12px; font-weight: 500; cursor: pointer; padding: 4px 0; }
.modal-checkbox-list label:last-child { margin-bottom: 0; }
.modal-checkbox-list input[type="checkbox"] { margin-right: 12px; width: 18px; height: 18px; cursor: pointer; accent-color: #3498db; }
.modal-checkbox-list .select-all-label { font-weight: bold; border-bottom: 1px solid #cbd5e1; padding-bottom: 12px; margin-bottom: 12px; color: #3498db; }

#loader-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.9); z-index: 9999; display: none; flex-direction: column; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: bold; color: #3498db; }
.progress-bar-container { width: 80%; max-width: 320px; height: 14px; background: #e2e8f0; border-radius: 7px; margin-top: 15px; overflow: hidden; }
.progress-bar { width: 0%; height: 100%; background: #3498db; transition: width 0.3s; }
.progress-text { margin-top: 10px; font-size: 1rem; color: #64748b; }

/* --- Ikony a akce --- */
.action-icons { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; } 
.icon-btn { background: #f1f5f9; border: 1px solid #e2e8f0; cursor: pointer; color: #64748b; padding: 8px 12px; font-size: 1.1rem; font-weight: bold; border-radius: 6px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s; }
.icon-btn:hover, .icon-btn:active { color: #3498db; background: #e0f2fe; border-color: #bae6fd; }
.icon-btn.danger:hover, .icon-btn.danger:active { color: #ef4444; background: #fee2e2; border-color: #fecaca; }

/* ==========================================================================
   STRIKTNÍ ROZDĚLENÍ ZOBRAZENÍ: DESKTOP vs MOBIL (zlom na 1024px)
   ========================================================================== */

@media (min-width: 1025px) {
    .mobile-header { display: none !important; }
    .sidebar { left: 0 !important; display: flex !important; transform: none !important; }
    .mobile-overlay { display: none !important; }
    .action-icons { opacity: 0; transition: opacity 0.2s; }
    .album-list li:hover .action-icons, .channel-list li:hover .action-icons { opacity: 1; }
    .icon-btn { background: transparent; border-color: transparent; }
    .icon-btn:hover { background: #f1f5f9; border-color: #e2e8f0; }
}

@media (max-width: 1024px) {
    body { height: auto; overflow: auto; }
    .container { flex-direction: column; display: block; }
    .sidebar { position: fixed; left: -350px; top: 0; bottom: 0; width: 320px; height: 100vh; box-shadow: 5px 0 25px rgba(0,0,0,0.15); transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 9999; }
    .sidebar.open { left: 0 !important; }
    .mobile-overlay.open { display: block !important; }
    .sidebar h2 { display: none; }
    .mobile-header { display: flex !important; }
    .main-content { padding: 15px; width: 100%; height: auto; overflow-y: visible; }
    
    .album-list li, .channel-list li { margin-bottom: 12px; }
    .action-icons { opacity: 1; width: 100%; justify-content: flex-start; margin-top: 5px; border-top: 1px dashed #e2e8f0; padding-top: 8px; }
    
    .dash-grid { grid-template-columns: 1fr; gap: 15px; margin-bottom: 15px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 15px; }
    .scheduler-grid { flex-direction: column; align-items: stretch; gap: 15px; }
    .channel-column { width: 100%; }
    .tabs { flex-wrap: wrap; gap: 4px; }
    .tab-link { flex: 1 1 auto; text-align: center; padding: 14px 10px; font-size: 0.95rem; border: 1px solid #e2e8f0; border-bottom: none; background: #f8fafc; }
    .tab-link.active { border-top: 3px solid #3498db; }
    .form-group { flex-direction: column; align-items: stretch; gap: 10px; }
    .form-group > div { width: 100%; }
    .form-group input, .form-group select { width: 100% !important; }
    .upload-group { padding: 30px 15px; }
    .card { padding: 15px; margin-bottom: 15px; }
    .photo-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
    .photo-item img { height: 120px; }
    .btn, .btn-danger { width: 100%; padding: 14px; font-size: 1.05rem; }
}

@media (max-width: 400px) {
    .stat-grid { grid-template-columns: 1fr; }
}
