/*
 * Soubor: style.css
 * Verze: 31.0 (Upload Progress)
 * Popis: Kompletní styly.
 * Novinky: Styly pro Progress Bar v modálním okně.
 */

:root {
    --bg-color: #000;
    --card-bg: #ffffff;
    --primary-color: #007bff;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --like-color: #fe2c55;
    --text-color: #fff;
    --text-dark: #333;
    --border-radius: 8px;
    --input-bg: #f5f5f5;
    --input-border: #ddd;
    --gray-text: #888;
    --drawer-bg: #1e1e1e;
}

html, body {
    height: 100%; margin: 0; padding: 0; background-color: var(--bg-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
body { overflow: hidden; }

.app-layout { display: flex; flex-direction: column; color: var(--text-color); height: 100%; }

/* --- Hlavička (Top Bar) --- */
.app-header {
    flex: 0 0 auto;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, transparent 100%);
    padding: 10px 15px;
    position: absolute; top: 0; left: 0; width: 100%; z-index: 100;
    box-sizing: border-box; pointer-events: none;
}

.header-content {
    display: flex; justify-content: space-between; align-items: center;
    width: 100%; position: relative; height: 40px;
}

.header-left { display: flex; align-items: center; gap: 10px; z-index: 102; pointer-events: auto; }
.header-right { display: flex; align-items: center; gap: 12px; z-index: 102; pointer-events: auto; }

.feed-switch-container {
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    z-index: 101; pointer-events: auto; display: flex; gap: 15px;
    font-size: 1rem; font-weight: 600; text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
    white-space: nowrap;
}

.feed-link {
    text-decoration: none; color: rgba(255,255,255,0.6); padding-bottom: 4px;
    transition: color 0.2s, border-bottom 0.2s; border-bottom: 2px solid transparent;
}
.feed-link.active { color: white; border-bottom-color: white; }

.icon-btn {
    width: 40px; height: 40px; border-radius: 50%; display: flex; justify-content: center; align-items: center;
    text-decoration: none; line-height: 1; transition: background 0.2s; cursor: pointer; border: none;
    flex-shrink: 0; box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.sort-btn { background-color: rgba(0, 0, 0, 0.4); color: rgba(255, 255, 255, 0.9); border: 1px solid rgba(255, 255, 255, 0.15); }
.sort-btn:active { background-color: rgba(255,255,255,0.2); }

.profile-btn { background-color: rgba(0,0,0,0.4); border: 1px solid rgba(255,255,255,0.3); color: white; padding: 0; overflow: hidden; }
.profile-btn img { width: 100%; height: 100%; object-fit: cover; }

.add-video-btn { background: linear-gradient(90deg, #00f2ea, #ff0050); color: white; font-size: 24px; text-shadow: 0 1px 1px rgba(0,0,0,0.3); border: none; }


/* --- PROGRESS BAR (NOVÉ) --- */
.progress-wrapper {
    margin-top: 15px;
    display: none; /* Skryté, dokud se nenahrává */
    width: 100%;
}
.progress-container {
    width: 100%;
    background-color: #444;
    border-radius: 10px;
    overflow: hidden;
    height: 10px;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00f2ea, #ff0050);
    transition: width 0.2s ease;
}
.progress-text {
    text-align: center;
    font-size: 0.85rem;
    color: #ccc;
    margin-top: 5px;
}


/* --- Zbytek stylů (Feed, Profil, Auth atd.) --- */
.tiktok-feed { flex: 1 1 auto; height: 100%; overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none; padding: 0; margin: 0; background: #000; }
.tiktok-feed::-webkit-scrollbar { display: none; }
.empty-msg { text-align: center; color: #aaa; margin-top: 50vh; transform: translateY(-50%); }
.empty-msg a { text-decoration: none; font-weight: bold; }

.video-item { height: 100%; width: 100%; position: relative; scroll-snap-align: start; scroll-snap-stop: always; background: #000; overflow: hidden; display: flex; justify-content: center; align-items: center; }
video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }

.video-sidebar { position: absolute; right: 10px; bottom: 80px; display: flex; flex-direction: column; align-items: center; gap: 20px; z-index: 30; padding-bottom: 20px; }
.sidebar-item { display: flex; flex-direction: column; align-items: center; color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }
.avatar-circle { width: 48px; height: 48px; border-radius: 50%; border: 2px solid white; overflow: hidden; margin-bottom: 10px; background: #333; display: flex; justify-content: center; align-items: center; }
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.action-btn { background: none; border: none; color: white; padding: 0; cursor: pointer; transition: transform 0.1s; display: flex; justify-content: center; align-items: center; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
.action-btn svg { width: 36px; height: 36px; fill: rgba(255,255,255,0.9); }
.action-btn:active { transform: scale(0.9); }
.like-btn.liked svg { fill: var(--like-color); color: var(--like-color); animation: pulse 0.4s ease; }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }
.sidebar-item span { font-size: 13px; font-weight: 600; margin-top: 5px; }

.video-overlay { position: absolute; bottom: 0; left: 0; width: 100%; padding: 20px 80px 30px 15px; box-sizing: border-box; background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.3) 60%, transparent 100%); color: white; pointer-events: none; }
.author-name { margin: 0 0 8px 0; font-size: 1.1rem; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,0.8); pointer-events: auto; }
.video-description { font-size: 0.95rem; line-height: 1.4; color: rgba(255,255,255,0.9); margin-bottom: 10px; pointer-events: auto; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }
.video-description.expanded { -webkit-line-clamp: unset; overflow: visible; background: rgba(0,0,0,0.7); padding: 10px; border-radius: 8px; position: relative; z-index: 40; }
.music-info { display: flex; align-items: center; font-size: 0.9rem; gap: 8px; overflow: hidden; }
.music-icon { animation: spin 4s linear infinite; }

.play-animation-overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; z-index: 20; }
.play-icon, .pause-icon { font-size: 60px; color: rgba(255, 255, 255, 0.8); background: rgba(0, 0, 0, 0.3); border-radius: 50%; width: 90px; height: 90px; display: none; justify-content: center; align-items: center; backdrop-filter: blur(2px); padding-left: 8px; }
.animate-play .play-icon, .animate-pause .pause-icon { display: flex; animation: popFade 0.6s ease-out forwards; }
@keyframes popFade { 0% { opacity: 0; transform: scale(0.5); } 30% { opacity: 1; transform: scale(1.1); } 100% { opacity: 0; transform: scale(1.4); } }
.floating-heart { position: absolute; width: 80px; height: 80px; color: var(--like-color); transform: translate(-50%, -50%); pointer-events: none; z-index: 100; display: flex; justify-content: center; align-items: center; animation: floatUpFade 0.8s ease-out forwards; }
.floating-heart svg { width: 100%; height: 100%; filter: drop-shadow(0 2px 5px rgba(0,0,0,0.3)); }
@keyframes floatUpFade { 0% { transform: translate(-50%, -50%) scale(0) rotate(-15deg); opacity: 0; } 20% { transform: translate(-50%, -50%) scale(1.2) rotate(-15deg); opacity: 1; } 40% { transform: translate(-50%, -50%) scale(1.0) rotate(-15deg); opacity: 1; } 100% { transform: translate(-50%, -150%) scale(1.2) rotate(0deg); opacity: 0; } }

.video-counter { position: absolute; left: 15px; top: 70px; right: auto; background: rgba(0,0,0,0.3); padding: 4px 10px; border-radius: 12px; font-size: 12px; color: rgba(255,255,255,0.6); pointer-events: none; z-index: 50; }

.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); }
.modal-content { background: #222; margin: 20% auto; padding: 20px; width: 85%; max-width: 400px; border-radius: 12px; color: white; border: 1px solid #444; }
.upload-controls-modal input, .upload-controls-modal textarea { background: #333; border: 1px solid #555; color: white; margin-bottom: 10px; }
.upload-btn { width: 100%; background: var(--primary-color); padding: 12px; border: none; border-radius: 4px; color: white; font-weight: bold; cursor: pointer; }
.close-modal { color: #aaa; float: right; font-size: 28px; cursor: pointer; }
.loader-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 2000; display: flex; justify-content: center; align-items: center; color: white; }
.spinner { border: 5px solid rgba(255,255,255,0.2); border-top: 5px solid var(--primary-color); border-radius: 50%; width: 50px; height: 50px; animation: spin 1s linear infinite; margin: 0 auto 20px auto; }

.comments-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1000; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.comments-overlay.open { opacity: 1; pointer-events: auto; }
.comments-drawer { position: fixed; bottom: 0; left: 0; width: 100%; height: 70%; background: var(--drawer-bg); border-radius: 12px 12px 0 0; z-index: 1001; transform: translateY(100%); transition: transform 0.3s cubic-bezier(0.1, 0.7, 0.1, 1); display: flex; flex-direction: column; box-shadow: 0 -5px 20px rgba(0,0,0,0.5); }
.comments-drawer.open { transform: translateY(0); }
.drawer-header { padding: 15px; text-align: center; border-bottom: 1px solid #333; position: relative; flex-shrink: 0; }
.drawer-title { font-weight: bold; font-size: 0.9rem; }
.close-drawer-btn { position: absolute; right: 15px; top: 15px; background: none; border: none; color: #aaa; cursor: pointer; padding: 0; }
.comments-list { flex: 1; overflow-y: auto; padding: 15px; display: flex; flex-direction: column; gap: 15px; }
.comment-item { display: flex; gap: 10px; align-items: flex-start; }
.comment-avatar { width: 32px; height: 32px; border-radius: 50%; background: #333; overflow: hidden; flex-shrink: 0; }
.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-content { flex: 1; font-size: 0.9rem; }
.comment-username { font-weight: 600; font-size: 0.85rem; color: #ccc; margin-right: 5px; }
.comment-text { color: #eee; line-height: 1.3; }
.comment-date { display: block; font-size: 0.75rem; color: #666; margin-top: 4px; }
.comment-input-area { padding: 10px 15px 20px 15px; border-top: 1px solid #333; background: var(--drawer-bg); display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.comment-input-area input { flex: 1; background: #333; border: none; padding: 10px 15px; border-radius: 20px; color: white; outline: none; }
.comment-send-btn { background: none; border: none; color: var(--primary-color); font-weight: 600; cursor: pointer; padding: 5px 10px; }

/* Profil styly (zachováno) */
.profile-body { overflow-y: auto; background-color: #121212; color: white; }
.profile-nav { display: flex; justify-content: space-between; align-items: center; padding: 15px; background: #121212; position: sticky; top: 0; z-index: 100; border-bottom: 1px solid #333; }
.profile-nav h2 { margin: 0; font-size: 1.1rem; font-weight: 700; }
.back-btn, .logout-icon { color: white; text-decoration: none; display: flex; align-items: center; }
.profile-content { padding-bottom: 20px; }
.profile-header-info { display: flex; align-items: center; padding: 20px 15px; gap: 20px; }
.profile-avatar-lg { width: 80px; height: 80px; border-radius: 50%; overflow: hidden; background: #333; flex-shrink: 0; border: 2px solid #222; }
.profile-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.avatar-placeholder { width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; font-size: 2rem; font-weight: bold; color: #ccc; background: #333; }
.profile-stats { display: flex; gap: 30px; flex-grow: 1; justify-content: space-around; }
.stat-item { display: flex; flex-direction: column; align-items: center; }
.stat-value { font-weight: 700; font-size: 1.2rem; color: white; }
.stat-label { font-size: 0.8rem; color: var(--gray-text); }
.profile-bio { padding: 0 15px 20px 15px; font-size: 0.9rem; color: #ddd; }
.profile-bio p { margin: 5px 0; }
.profile-tabs { display: flex; border-top: 1px solid #333; border-bottom: 1px solid #333; }
.tab-btn { flex: 1; background: transparent; border: none; padding: 12px; color: #666; cursor: pointer; border-bottom: 2px solid transparent; transition: all 0.2s; }
.tab-btn.active { color: white; border-bottom: 2px solid white; }
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: #000; }
.grid-item { position: relative; aspect-ratio: 3/4; background: #222; overflow: hidden; display: block; }
.grid-item video { width: 100%; height: 100%; object-fit: cover; }
.grid-overlay { position: absolute; bottom: 5px; left: 5px; color: white; font-size: 0.8rem; text-shadow: 1px 1px 2px black; font-weight: 600; }
.empty-state { padding: 40px; text-align: center; color: #666; grid-column: 1 / -1; }
.login-body { display: flex; justify-content: center; align-items: center; min-height: 100vh; background: linear-gradient(135deg, #1e2024 0%, #232526 100%); color: var(--text-dark); padding: 20px; box-sizing: border-box; overflow: auto; }
.auth-container { background: var(--card-bg); padding: 2.5rem; border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,0.3); width: 100%; max-width: 420px; text-align: center; animation: fadeIn 0.5s ease-out; }
.auth-title { margin-top: 0; margin-bottom: 0.5rem; font-size: 2rem; font-weight: 800; color: #000; letter-spacing: -1px; }
.auth-subtitle { margin-bottom: 2rem; color: #666; font-size: 1rem; }
.input-group { margin-bottom: 1.2rem; text-align: left; }
.input-group input { width: 100%; padding: 14px 16px; background: var(--input-bg); border: 1px solid var(--input-border); border-radius: 8px; box-sizing: border-box; font-size: 1rem; transition: all 0.2s; outline: none; }
.input-group input:focus { background: #fff; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1); }
.auth-btn { width: 100%; padding: 14px; border: none; border-radius: 8px; cursor: pointer; font-size: 1rem; font-weight: 600; transition: transform 0.1s, opacity 0.2s; margin-top: 10px; }
.auth-btn:active { transform: scale(0.98); }
.auth-btn:hover { opacity: 0.9; }
.primary-btn { background-color: var(--primary-color); color: white; }
.success-btn { background-color: var(--success-color); color: white; }
.auth-footer { margin-top: 1.5rem; font-size: 0.9rem; color: #666; }
.auth-footer a { color: var(--primary-color); text-decoration: none; font-weight: 600; cursor: pointer; }
.auth-footer a:hover { text-decoration: underline; }
.flash-msg { position: fixed; top: 70px; left: 50%; transform: translateX(-50%); z-index: 1000; padding: 10px 20px; border-radius: 4px; color: #fff; text-align: center; width: 90%; max-width: 400px; box-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.error-msg { background-color: rgba(220, 53, 69, 0.95); border: 1px solid #dc3545; }
.success-msg { background-color: rgba(40, 167, 69, 0.95); border: 1px solid #28a745; }

@media (max-width: 380px) {
    .app-header { padding: 8px; }
    .feed-switch-container { font-size: 0.9rem; gap: 10px; }
    .icon-btn { width: 35px; height: 35px; }
}


/* --- END OF FEED TOAST --- */
.end-feed-msg {
    position: fixed;
    bottom: 100px; /* Trochu výš než spodní okraj, aby to nezakryl sidebar */
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: rgba(0, 0, 0, 0.7);
    color: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    pointer-events: none; /* Aby přes to šlo klikat/scrollovat */
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 900;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(4px);
}

.end-feed-msg.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
