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

body { background: #111; color: #aaa; font-family: sans-serif; min-height: 100vh; }

.login { max-width: 400px; margin: 40px auto; padding: 0 1rem; }
.dashboard { max-width: 1100px; margin: 0 auto; padding: 24px; }
.page { max-width: 1100px; margin: 0 auto; padding: 24px; }


input { 
    background: #333; 
    border: none;
    border-radius: 8px;
    color: #888; 
    display: block; 
    width: 100%; 
    margin-top: 10px;
    margin-bottom: 10px; 
    padding: 10px; 
    box-sizing: border-box; 
}
input:focus { outline: none; }

.login-button { background: #333; color: #aaa; border: none; border-radius: 4px; padding: 10px 24px; cursor: pointer; }
.login-button:hover { background: #222; border:none; }

.error { color: red; font-size: 13px; }
.success { color: green; font-size: 13px; }

a { cursor: pointer; }
hr { margin: 20px 0; }
h2 { text-align: center; }

nav {
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
nav a { color: #aaa; cursor: pointer; text-decoration: none; font-weight: 600; }
nav a:hover { color: #eee; }

.stat-bar {
    padding: 0px 12px;
    font-size: 12px;
    color: #888;
    text-align: center;
    margin: auto;
    max-width: 200px;
}

#dropzone {
    border: 2px dashed #888;
    border-radius: 8px;
    padding: 32px;
    text-align: center;
    color: #888;
    font-size: 14px;
    margin-bottom: 24px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: #222;
}
#dropzone.over { border-color: #555; background: #f9f9f9; color: #333; }
#dropzone input { display: none; }

#upload-status { font-size: 13px; color: #555; margin-bottom: 16px; min-height: 18px; }
#upload-status.err { color: red; }
#upload-status.ok  { color: green; }

.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.video-card {
    background: #333;
    border: 1px solid #555;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.15s;
}
.video-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.12); }

.thumb {
    width: 100%;
    aspect-ratio: 16/9;
    background: #222;
    display: flex;
    position: relative;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 22px;
}
.thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.thumb .overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #aaa;
}
.thumb .overlay.processing {
    background: rgba(240,240,240,0.85);
    color: #aaa;
    font-size: 12px;
}

.video-info { padding: 8px; }
.video-info .title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-info .meta  { font-size: 11px; color: #888; margin-top: 2px; }

@media (max-width: 800px) {
    .grid { grid-template-columns: repeat(3, 1fr); }
}

.player-wrap {
    width: 100%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16/9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-wrap video { width: 100%; height: 100%; display: block; }

.processing-banner {
    color: #888;
    font-size: 14px;
    text-align: center;
}

.below { display: flex; gap: 16px; margin-top: 16px; align-items: flex-start; }

.player-main { flex: 1; min-width: 0; }

.title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }

#title-display { font-size: 18px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#title-input { font-size: 18px; font-weight: 600; background: #2a2a2a; border: 1px solid #444; border-radius: 4px; color: #eee; padding: 2px 8px; flex: 1; display: none; font-family: sans-serif; }

.btn { padding: 6px 12px; font-size: 12px; border: 1px solid #444; border-radius: 4px; background: #2a2a2a; color: #ccc; cursor: pointer; white-space: nowrap; font-family: sans-serif; }
.btn:hover { background: #333; color: #eee; }
.btn.danger { border-color: #6b2a2a; color: #e07070; }
.btn.danger:hover { background: #3a1a1a; }
.btn.primary { background: #eee; color: #111; border-color: #eee; }
.btn.primary:hover { background: #ccc; }

.status-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 99px;
    margin-bottom: 10px;
}
.status-badge.done       { background: #1a3a1a; color: #6dbf6d; border: 1px solid #2d6b2d; }
.status-badge.processing { background: #3a3a1a; color: #cfb84a; border: 1px solid #6b5a1a; }
.status-badge.failed     { background: #3a1a1a; color: #e07070; border: 1px solid #6b2a2a; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag { font-size: 11px; padding: 2px 10px; border-radius: 99px; background: #2a2a2a; border: 1px solid #3a3a3a; color: #aaa; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }

.sidebar { width: 220px; flex-shrink: 0; }

.info-box {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    padding: 12px;
    font-size: 12px;
    color: #888;
    margin-bottom: 12px;
}
.info-box .row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid #222; }
.info-box .row:last-child { border-bottom: none; }
.info-box .row span:last-child { color: #ccc; text-align: right; }

.share-box {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    padding: 12px;
    font-size: 12px;
}
.share-box h4 { font-size: 13px; color: #aaa; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }

.share-active-links span { font-size: 14px; }
.share-active-links a { color: #aaa; cursor: pointer; text-decoration: none; font-weight: 600; }

select {
    width: 100%;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    color: #ccc;
    padding: 6px;
    font-size: 12px;
    margin-bottom: 8px;
    font-family: sans-serif;
}

.share-link-out {
    background: #222;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 11px;
    color: #6dbf6d;
    word-break: break-all;
    margin-bottom: 8px;
    display: none;
    font-family: monospace;
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #eee;
    color: #111;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 13px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}
.toast.show { opacity: 1; }

