:root {
    --bg-main: #0f121a;
    --bg-card: #1c212e;
    --accent-orange: #ff7324;
    --text-main: #ffffff;
    --text-muted: #a0a8b9;
    --border-color: #2d3548;
    --positive-green: #2ecc71;
    --negative-red: #e74c3c;
    --font-main: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body, html {
    margin: 0; padding: 0;
    width: 100%; height: 100%;
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow: hidden;
}

/* ========================================== */
/* VSTUPNÍ BRÁNA (ACCESS CONTROL)             */
/* ========================================== */
.access-control-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, #0f121a 0%, #1c212e 100%);
    display: flex; align-items: center; justify-content: center;
    z-index: 11000;
    transition: opacity 0.5s ease;
}

.access-control-content {
    background: rgba(28, 33, 46, 0.8);
    backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: 16px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
}

.fade-in-step {
    animation: fadeInStep 0.3s ease-out forwards;
}
@keyframes fadeInStep {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* HLAVNÍ KONTEJNER */
.app-container {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
}

/* MAPA */
.map-section {
    flex-grow: 1;
    height: 100%;
    z-index: 1;
}

/* ========================================== */
/* ČTEČKA PŘÍBĚHŮ (DIARY READER - SPA)        */
/* ========================================== */
.diary-reader-panel {
    width: 30%; 
    min-width: 350px;
    max-width: 500px;
    background: var(--bg-main);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: -5px 0 20px rgba(0,0,0,0.5);
    
    transform: translateX(100%);
    display: none; 
}

.diary-reader-panel.open {
    display: flex;
    animation: slideInRight 0.3s forwards;
}

@keyframes slideInRight {
    to { transform: translateX(0); }
}

.diary-reader-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
}

.diary-reader-content {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.reader-day-block {
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 25px;
}

.reader-day-title {
    color: var(--accent-orange);
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.reader-text {
    color: var(--text-main);
    line-height: 1.6;
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.reader-photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.reader-photo-grid img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s;
    border: 1px solid var(--border-color);
}

.reader-photo-grid img:hover {
    transform: scale(1.05);
    border-color: var(--accent-orange);
}

.reader-gallery-link {
    display: inline-block;
    margin-top: 15px;
    color: #3498db;
    font-size: 0.85rem;
    font-weight: bold;
    text-decoration: none;
    background: rgba(52, 152, 219, 0.15);
    padding: 8px 12px;
    border-radius: 5px;
    border: 1px solid #3498db;
    text-align: center;
}

.reader-gallery-link:hover {
    background: rgba(52, 152, 219, 0.3);
}

/* ========================================== */
/* TLAČÍTKA PŘÍBĚHU (PC vs MOBIL)             */
/* ========================================== */
/* 1. Tlačítko uvnitř dashboardu (pro PC) */
.dashboard-story-btn {
    background: linear-gradient(135deg, var(--accent-orange), #e6661d);
    color: white;
    border: none;
    padding: 16px 20px;
    border-radius: 12px;
    font-weight: 900;
    font-size: 1.1rem;
    box-shadow: 0 4px 15px rgba(255, 115, 36, 0.4);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
    text-align: center;
    width: 100%;
    margin-top: auto; 
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dashboard-story-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 115, 36, 0.6);
}

.dashboard-story-btn:active {
    transform: translateY(0);
}

/* 2. Plovoucí tlačítka dole nad mapou (pro MOBIL) */
.floating-actions-container {
    position: fixed;
    bottom: 110px; /* Původní vzdálenost pro Live Tracking */
    right: 20px; /* 💡 ÚPRAVA ZDE: Posunuto doprava pro snazší kliknutí palcem */
    left: auto;
    transform: none; /* Odstraněno původní centrování */
    display: flex;
    flex-direction: column; /* 💡 ÚPRAVA ZDE: Položky se řadí nad sebe */
    align-items: flex-end; /* Zarovnáme je doprava */
    gap: 12px;
    z-index: 1060;
}

/* 💡 ÚPRAVA ZDE: Nová třída pro layout v Deníku - posune tlačítka k dolnímu okraji */
.floating-actions-container.archived-layout {
    bottom: 30px !important;
}

/* 💡 ÚPRAVA ZDE: Skryté rozbalovací menu */
.mobile-actions-menu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.9);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: bottom right;
}

/* 💡 ÚPRAVA ZDE: Zobrazení menu po kliknutí */
.floating-actions-container.menu-open .mobile-actions-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.floating-action-btn {
    background: linear-gradient(135deg, var(--accent-orange), #e6661d);
    color: white;
    border: 2px solid rgba(255,255,255,0.1);
    padding: 12px 20px;
    border-radius: 30px;
    font-weight: 800;
    font-size: 0.95rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.8);
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.floating-action-btn.diary-btn {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

/* 💡 ÚPRAVA ZDE: Hlavní tlačítko menu */
.floating-action-btn.main-toggle-btn {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    padding: 14px 22px;
    font-size: 1.05rem;
    z-index: 2;
}

.floating-action-btn:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* Stará třída */
.floating-reader-btn {
    display: none; 
}


/* DASHBOARD PANEL */
.dashboard-section {
    width: 380px;
    height: 100%;
    background: var(--bg-main);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
    z-index: 10000;
    transition: transform 0.3s ease, width 0.3s ease;
}

.dashboard-header { margin-bottom: 20px; }
.dashboard-header h1 { font-size: 1.2rem; font-weight: 800; letter-spacing: 0.5px; }

/* STATUS INDIKÁTOR */
.status-indicator {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}
.status-live { color: #ff4757; background: rgba(255, 71, 87, 0.1); }
.status-planned { color: var(--accent-orange); background: rgba(255, 115, 36, 0.1); }
.status-archive { color: var(--text-muted); background: rgba(255, 255, 255, 0.05); }

/* RIDER CARDS */
.rider-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    transition: transform 0.2s;
}
.rider-title { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.rider-color-dot { width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 10px rgba(0,0,0,0.5); }
.rider-name-text { font-size: 1.1rem; font-weight: 700; }

/* STATS GRID */
.main-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat-card {
    background: rgba(255, 255, 255, 0.03); padding: 10px; border-radius: 8px;
    display: flex; flex-direction: column;
}
.stat-label {
    font-size: 0.6rem; color: var(--text-muted); font-weight: 800;
    text-transform: uppercase; margin-bottom: 4px;
}
.stat-value { font-size: 1rem; font-weight: 700; }
.stat-value .unit { font-size: 0.7rem; color: var(--text-muted); font-weight: 400; }

.text-orange { color: var(--accent-orange); }
.text-positive { color: var(--positive-green); }
.text-negative { color: var(--negative-red); }

/* MAPA LABELS */
.rider-map-label {
    background: rgba(18, 21, 30, 0.9) !important;
    border: 1px solid var(--accent-orange) !important;
    color: white !important; font-weight: 800 !important; font-size: 0.8rem !important;
    padding: 2px 8px !important; border-radius: 4px !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5) !important;
}

/* FLOATING MENU BUTTON (MOBILE) */
.floating-menu-btn {
    position: absolute; top: 20px; right: 20px; z-index: 1100;
    background: var(--bg-card); color: var(--text-main); border: 1px solid var(--border-color);
    padding: 10px 18px; border-radius: 8px; font-weight: 800; cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4); display: none;
}

/* Plovoucí tlačítko na rychlé focení */
.floating-photo-btn {
    position: absolute; top: 20px; right: 400px; z-index: 990;
    background: var(--accent-orange); color: white; border: 2px solid white;
    width: 48px; height: 48px; border-radius: 50%; display: flex;
    justify-content: center; align-items: center; font-size: 1.5rem;
    cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    transition: transform 0.2s, background 0.2s, right 0.3s ease;
}
.floating-photo-btn:hover { transform: scale(1.1); background: #e6661d; }

.close-panel-btn {
    background: none; border: none; color: var(--text-muted); font-size: 1.2rem;
    cursor: pointer; padding: 5px; display: none;
}

/* MOBILE QUICK STATS BAR */
.mobile-quick-stats {
    position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
    width: calc(100% - 40px); max-width: 450px; background: rgba(28, 33, 46, 0.95);
    backdrop-filter: blur(10px); border: 1px solid var(--border-color); border-radius: 15px;
    padding: 12px 15px; z-index: 1050; box-shadow: 0 8px 32px rgba(0,0,0,0.5); display: none;
}
.mobile-quick-stats.visible { display: block; }
.quick-stats-content { display: flex; justify-content: space-around; align-items: center; gap: 15px; }

/* VYCENTROVANÝ OBSAH PRO QUICK STATS */
.quick-stat-rider { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; flex-grow: 1; }
.qs-header { display: flex; justify-content: center; align-items: center; width: 100%; gap: 10px; }
.qs-name { font-weight: 800; font-size: 0.8rem; display: flex; align-items: center; gap: 5px; }
.qs-day { font-size: 0.65rem; color: var(--accent-orange); font-weight: 800; }
.qs-data-row { display: flex; justify-content: center; align-items: baseline; gap: 8px; }
.qs-data-main { font-weight: 800; font-size: 1rem; }
.qs-data-sub { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; }
.qs-eta { font-size: 0.65rem; color: var(--positive-green); font-weight: 700; margin-top: 2px; }

/* ACCORDION ANIMACE */
.accordion-card { cursor: pointer; }
.accordion-header { display: flex; justify-content: space-between; align-items: center; }
.map-toggle-wrapper { display: flex; align-items: center; }
.map-checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 0.7rem; color: var(--text-muted); font-weight: 700; cursor: pointer; }

/* POHYB ANIMACE PRO MARKER */
@keyframes pulse-orange {
    0% { r: 8; stroke-width: 2; stroke-opacity: 1; }
    100% { r: 15; stroke-width: 0; stroke-opacity: 0; }
}
.moving-anim { animation: pulse-orange 1.5s infinite; }

/* ========================================== */
/* ADMIN STYLES & MENU                        */
/* ========================================== */
#adminLockBtn { transition: opacity 0.3s, transform 0.2s; }
#adminLockBtn:hover { opacity: 1 !important; transform: scale(1.2); }

#adminMenuToggleBtn { transition: background 0.2s, color 0.2s; }
#adminMenuToggleBtn:hover { background: rgba(52, 152, 219, 0.2) !important; color: #5dade2 !important; }

.admin-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); display: flex; align-items: center; justify-content: center;
    z-index: 10550; 
    backdrop-filter: blur(5px);
}
.admin-modal-content {
    background: var(--bg-card); padding: 2.5rem; border-radius: 16px;
    max-width: 400px; width: 90%; text-align: center; border: 1px solid var(--border-color);
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}
.admin-modal-content h3 { color: var(--accent-orange); margin-bottom: 1rem; font-size: 1.4rem; font-weight: 800; }
.admin-modal-content p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; margin-bottom: 2.5rem; }
.admin-modal-actions { display: flex; flex-direction: column; gap: 12px; }

.btn-primary { 
    background: var(--accent-orange); color: white; border: none; padding: 14px; 
    border-radius: 8px; cursor: pointer; font-weight: 800; font-size: 1rem; 
    transition: background 0.2s, transform 0.1s; 
}
.btn-primary:hover { background: #e6661d; }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary { 
    background: transparent; color: var(--text-muted); border: 1px solid var(--border-color); 
    padding: 12px; border-radius: 8px; cursor: pointer; font-weight: 600; 
    transition: color 0.2s, border-color 0.2s; 
}
.btn-secondary:hover { color: var(--text-main); border-color: var(--text-muted); }

/* Vypnutí prvků pro ne-admin uživatele */
body:not(.is-admin) .admin-only { display: none !important; }

/* ========================================== */
/* FOTO EDITOR (Nahrávání poznámek)           */
/* ========================================== */
.editor-row {
    display: flex; gap: 15px; background: rgba(255, 255, 255, 0.03); padding: 10px;
    border-radius: 8px; border: 1px solid var(--border-color); align-items: flex-start;
}
.editor-preview-box { width: 100px; flex-shrink: 0; }
.editor-preview-box img { width: 100%; border-radius: 6px; box-shadow: 0 4px 10px rgba(0,0,0,0.5); object-fit: cover; aspect-ratio: 1 / 1; }
.editor-input-box { flex-grow: 1; display: flex; }
.editor-input-box textarea {
    width: 100%; min-height: 100px; background: rgba(0, 0, 0, 0.2); border: 1px solid var(--border-color);
    color: var(--text-main); padding: 10px; border-radius: 6px; font-family: inherit; resize: vertical; outline: none;
}
.editor-input-box textarea:focus { border-color: var(--accent-orange); }

/* ========================================== */
/* PŘEHRÁVAČ ANIMACE (PLAYBACK PLAYER)        */
/* ========================================== */
.floating-player {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); width: calc(100% - 40px);
    max-width: 600px; background: rgba(28, 33, 46, 0.95); backdrop-filter: blur(10px);
    border: 1px solid var(--accent-orange); border-radius: 12px; padding: 15px 20px; z-index: 2000;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8); display: flex; flex-direction: column; gap: 12px;
}
.player-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255, 255, 255, 0.1); padding-bottom: 10px; }
.player-rider-info { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; }
.player-day { color: var(--accent-orange); font-weight: 800; font-size: 0.85rem; letter-spacing: 1px; text-transform: uppercase; }
.player-controls { display: flex; align-items: center; gap: 15px; }
.player-btn {
    background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); color: white; border-radius: 50%;
    width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1.2rem;
    transition: all 0.2s; flex-shrink: 0;
}
.player-btn:hover { background: var(--accent-orange); border-color: var(--accent-orange); transform: scale(1.05); }
.player-close { width: 32px; height: 32px; font-size: 0.9rem; background: rgba(231, 76, 60, 0.1); color: var(--negative-red); border-color: var(--negative-red); }
.player-close:hover { background: var(--negative-red); color: white; border-color: var(--negative-red); }
.timeline-container { flex-grow: 1; display: flex; align-items: center; }
.player-slider { width: 100%; cursor: pointer; accent-color: var(--accent-orange); height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); outline: none; }
.player-time { font-size: 0.9rem; font-weight: 700; color: var(--text-main); min-width: 60px; text-align: right; font-variant-numeric: tabular-nums; }
.player-speed { background: var(--bg-main); color: white; border: 1px solid var(--border-color); border-radius: 6px; padding: 6px 10px; font-weight: bold; cursor: pointer; outline: none; font-size: 0.85rem; }

/* ========================================== */
/* ZÁVĚREČNÝ SOUHRN ANIMACE                   */
/* ========================================== */
.animation-summary-panel {
    position: absolute; top: 20px; left: 50%; transform: translateX(-50%); background: rgba(28, 33, 46, 0.95);
    backdrop-filter: blur(10px); border: 1px solid var(--accent-orange); border-radius: 12px; padding: 20px 30px;
    z-index: 2000; box-shadow: 0 10px 40px rgba(0,0,0,0.8); display: flex; flex-direction: column; align-items: center;
    gap: 15px; min-width: 300px; animation: slideDownFade 0.5s ease-out;
}
@keyframes slideDownFade { from { top: -50px; opacity: 0; } to { top: 20px; opacity: 1; } }
.summary-title { color: var(--accent-orange); font-size: 1.5rem; font-weight: 900; letter-spacing: 2px; text-transform: uppercase; text-shadow: 0 2px 10px rgba(255, 115, 36, 0.3); }
.summary-stats { display: flex; justify-content: space-between; width: 100%; gap: 20px; border-top: 1px solid rgba(255, 255, 255, 0.1); padding-top: 15px; }
.summary-item { display: flex; flex-direction: column; align-items: center; }
.summary-label { font-size: 0.65rem; color: var(--text-muted); font-weight: 800; text-transform: uppercase; margin-bottom: 5px; letter-spacing: 1px; }
.summary-val { font-size: 1.4rem; font-weight: 800; color: var(--text-main); }
.summary-unit { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }

/* ========================================== */
/* ORIENTAČNÍ CEDULKY (RELIVE STYLE)          */
/* ========================================== */
.relive-city-label { position: relative; display: flex; align-items: center; animation: popUpLabel 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; pointer-events: none; }
@keyframes popUpLabel { 0% { opacity: 0; transform: scale(0.5); } 100% { opacity: 1; transform: scale(1); } }
.label-dot { width: 10px; height: 10px; border-radius: 50%; background-color: #ffffff; border: 2px solid var(--accent-orange); margin-bottom: 6px; box-shadow: 0 0 10px rgba(0,0,0,0.6); }
.label-text { position: absolute; left: 18px; top: -8px; font-size: 11px; font-weight: 700; background-color: rgba(255, 255, 255, 0.85); padding: 2px 6px; border-radius: 4px; white-space: nowrap; color: #12151e; box-shadow: 0 2px 5px rgba(0,0,0,0.3); border: 1px solid rgba(255, 255, 255, 0.1); text-transform: uppercase; pointer-events: none; }
.label-special .label-text { background: var(--accent-orange); color: #ffffff; border: 1px solid #ffffff; box-shadow: 0 6px 20px rgba(255, 115, 36, 0.4); }
.label-special .label-dot { background-color: var(--accent-orange); border-color: #ffffff; }
.label-camp .label-text { background: var(--bg-card); color: #ffffff; border: 2px solid var(--accent-orange); box-shadow: 0 6px 15px rgba(0,0,0,0.6); }
.label-camp .label-dot { background-color: var(--bg-card); border: 2px solid var(--accent-orange); }

/* ========================================== */
/* FOTOGALERIE (KINO REŽIM A LIGHTBOX)        */
/* ========================================== */
.lightbox-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: #000; z-index: 12000; display: flex; justify-content: center; align-items: center; }
.lightbox-content { position: relative; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; }
.lightbox-content img { width: 100%; height: 100%; object-fit: contain; }
.lightbox-text-container { position: absolute; bottom: 0; left: 0; width: 100%; padding: 80px 20px 40px 20px; background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 60%, transparent 100%); text-align: center; display: flex; flex-direction: column; align-items: center; pointer-events: none; z-index: 10; }
.lightbox-note { font-size: 1.4rem; font-weight: 900; color: white; margin-bottom: 10px; line-height: 1.4; max-width: 800px; text-shadow: 2px 2px 4px rgba(0,0,0,1), 0 0 15px rgba(0,0,0,0.8); }
.lightbox-time { font-size: 0.85rem; color: #e0e0e0; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; text-shadow: 1px 1px 3px rgba(0,0,0,1); }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0, 0, 0, 0.4); border: 1px solid rgba(255,255,255,0.2); color: white; font-size: 2rem; width: 50px; height: 50px; border-radius: 50%; cursor: pointer; display: flex; justify-content: center; align-items: center; transition: all 0.2s; z-index: 20; }
.lightbox-nav:hover { background: var(--accent-orange); border-color: var(--accent-orange); transform: translateY(-50%) scale(1.1); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-close { position: absolute; top: 20px; right: 20px; background: rgba(0, 0, 0, 0.4); border: none; color: white; font-size: 1.5rem; width: 45px; height: 45px; border-radius: 50%; cursor: pointer; transition: all 0.2s; z-index: 20; display: flex; justify-content: center; align-items: center; }
.lightbox-close:hover { background: var(--negative-red); transform: scale(1.1); }

body.is-admin #deletePhotoBtn.admin-only {
    display: flex !important; position: absolute; top: 20px; left: 20px; bottom: auto; right: auto;
    background: rgba(231, 76, 60, 0.8); color: white; border: none; width: 45px; height: 45px;
    border-radius: 50%; font-size: 1.3rem; cursor: pointer; justify-content: center; align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5); z-index: 20; transition: all 0.2s;
}
#deletePhotoBtn:hover { background: rgba(231, 76, 60, 1); transform: scale(1.1); }

/* ========================================== */
/* DENÍK EXPEDIC (DIARY CARDS)                */
/* ========================================== */
.diary-card {
    position: relative; background: var(--bg-card); border: 1px solid var(--border-color);
    border-radius: 16px; overflow: hidden; min-height: 250px; display: flex; flex-direction: column;
    justify-content: flex-end; cursor: pointer; transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.diary-card:hover { transform: translateY(-5px); box-shadow: 0 10px 25px rgba(0,0,0,0.6); border-color: var(--accent-orange); }
.diary-card-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; z-index: 1; transition: transform 0.5s ease; }
.diary-card:hover .diary-card-bg { transform: scale(1.05); }
.diary-card-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(to bottom, rgba(15, 18, 26, 0.1) 0%, rgba(15, 18, 26, 0.9) 70%, rgba(15, 18, 26, 1) 100%); z-index: 2; }
.diary-card-content { position: relative; z-index: 3; padding: 20px; display: flex; flex-direction: column; gap: 15px; }
.diary-card-header { display: flex; flex-direction: column; gap: 4px; }
.diary-card-title { font-size: 1.4rem; font-weight: 900; color: var(--text-main); text-shadow: 0 2px 4px rgba(0,0,0,0.8); margin: 0; line-height: 1.2; }
.diary-card-date { font-size: 0.8rem; color: var(--accent-orange); font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; }
.diary-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 15px; }
.diary-stat { display: flex; flex-direction: column; align-items: center; text-align: center; }
.diary-stat-val { font-size: 1.2rem; font-weight: 800; color: var(--text-main); line-height: 1; }
.diary-stat-label { font-size: 0.65rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; margin-top: 4px; }

/* VÝBĚR TITULNÍ FOTKY PRO DENÍK */
.cover-photo-option { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px transparent; transition: all 0.2s ease; opacity: 0.6; }
.cover-photo-option:hover { opacity: 1; transform: scale(1.05); }
.cover-photo-option.selected { border-color: var(--accent-orange); opacity: 1; box-shadow: 0 0 10px rgba(255, 115, 36, 0.6); transform: scale(1.05); }

/* ========================================== */
/* RESPONSIVITA (VŠE PRO MOBILY NA JEDNOM MÍSTĚ) */
/* ========================================== */
@media (max-width: 900px) {
    .dashboard-section {
        position: fixed; right: 0; width: 320px; transform: translateX(100%);
    }
    .dashboard-section.minimized { transform: translateX(100%); }
    .dashboard-section:not(.minimized) { transform: translateX(0); }
    .close-panel-btn { display: block; }
    
    .floating-menu-btn { display: block; }
    
    .floating-photo-btn { top: 60px; right: 20px; }
    
    /* SPA Reader - Na mobilu jako Bottom Sheet */
    .diary-reader-panel {
        position: fixed;
        bottom: 0; left: 0; right: 0;
        width: 100%;
        min-width: unset; max-width: unset;
        height: 85vh; 
        border-left: none;
        border-top: 1px solid var(--accent-orange);
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        
        transform: translateY(100%);
        box-shadow: 0 -5px 20px rgba(0,0,0,0.7);
        z-index: 1150; 
    }

    .diary-reader-panel.open {
        transform: translateY(0);
        animation: slideUpBottom 0.3s forwards;
    }

    @keyframes slideUpBottom {
        to { transform: translateY(0); }
    }

    .diary-reader-header {
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
    }

    .floating-player { bottom: 20px; width: calc(100% - 20px); padding: 12px 15px; }
    .player-controls { gap: 10px; }
    
    .animation-summary-panel { top: 10px; padding: 12px 20px; min-width: 280px; gap: 10px; }
    .summary-title { font-size: 1.2rem; letter-spacing: 1px; }
    .summary-stats { gap: 10px; padding-top: 10px; }
    .summary-label { font-size: 0.55rem; margin-bottom: 3px; }
    .summary-val { font-size: 1.1rem; }
    .summary-unit { font-size: 0.7rem; }

    .label-text { font-size: 0.7rem; padding: 4px 10px; }
    
    .lightbox-nav { width: 40px; height: 40px; font-size: 1.2rem; }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    .lightbox-text-container { padding: 60px 15px 30px 15px; }
    .lightbox-note { font-size: 1.1rem; }
    .lightbox-time { font-size: 0.75rem; }
    
    .editor-row { flex-direction: column; }
    .editor-preview-box { width: 100%; max-width: 150px; margin: 0 auto; }

    #diaryList { padding: 10px !important; gap: 15px !important; grid-template-columns: 1fr !important; overflow-x: hidden !important; }
    .diary-card { min-height: 180px; }
    .diary-card-content { padding: 15px; gap: 8px; }
    .diary-card-title { font-size: 1.1rem; }
    .diary-card-date { font-size: 0.7rem; }
    .diary-card-stats { padding-top: 10px; }
    .diary-stat-val { font-size: 1.1rem; }
    .diary-stat-label { font-size: 0.6rem; margin-top: 2px; }
}

@media (max-width: 900px) and (orientation: landscape) {
    .lightbox-text-container { padding: 40px 10px 10px 10px; }
    .lightbox-note { font-size: 0.95rem; margin-bottom: 3px; line-height: 1.2; max-width: 95%; }
    .lightbox-time { font-size: 0.65rem; }
    .lightbox-nav { width: 35px; height: 35px; font-size: 1rem; }
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    .lightbox-close { width: 35px; height: 35px; font-size: 1rem; top: 10px; right: 10px; }
    body.is-admin #deletePhotoBtn.admin-only { width: 35px; height: 35px; font-size: 1rem; top: 10px; left: 10px; }
}