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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0f1117;
    color: #e1e4e8;
    min-height: 100vh;
}

.hidden { display: none !important; }

/* Auth */
#auth-screen {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh;
}
.auth-box {
    background: #1c1f26; padding: 2rem; border-radius: 12px;
    display: flex; flex-direction: column; gap: 1rem; width: 320px;
}
.auth-box h1 { text-align: center; font-size: 1.4rem; }
.auth-box input {
    padding: 0.7rem; border-radius: 6px; border: 1px solid #333;
    background: #0f1117; color: #e1e4e8; font-size: 1rem;
}
.auth-box button {
    padding: 0.7rem; border-radius: 6px; border: none;
    background: #238636; color: #fff; font-size: 1rem; cursor: pointer;
}
.auth-box button:hover { background: #2ea043; }

/* Header */
header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 2rem; border-bottom: 1px solid #21262d;
}
header h1 { font-size: 1.3rem; }

.header-actions { display: flex; gap: 0.5rem; align-items: center; }

/* Tabs */
.tabs { display: flex; gap: 0.3rem; }
.tab-btn {
    padding: 0.4rem 1rem; border-radius: 6px; border: 1px solid transparent;
    background: transparent; color: #8b949e; cursor: pointer; font-size: 0.9rem;
}
.tab-btn.active { background: #21262d; color: #e1e4e8; border-color: #333; }
.tab-btn:hover { color: #e1e4e8; }

/* Buttons */
.btn, .btn-small {
    padding: 0.5rem 1rem; border-radius: 6px; border: 1px solid #333;
    background: #21262d; color: #e1e4e8; cursor: pointer; font-size: 0.9rem;
}
.btn:hover, .btn-small:hover { background: #30363d; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: #1f6feb; border-color: #1f6feb; }
.btn-primary:hover { background: #388bfd; }
.btn-success { background: #238636; border-color: #238636; }
.btn-success:hover { background: #2ea043; }
.btn-warning { background: #9e6a03; border-color: #9e6a03; }
.btn-warning:hover { background: #bb8009; }
.btn-danger { background: #da3633; border-color: #da3633; color: #fff; }
.btn-danger:hover { background: #f85149; }
.btn-small { padding: 0.3rem 0.7rem; font-size: 0.8rem; }

/* Filters */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.filters { display: flex; gap: 0.3rem; }
.filter-btn {
    padding: 0.3rem 0.8rem; border-radius: 20px; border: 1px solid #333;
    background: transparent; color: #8b949e; cursor: pointer; font-size: 0.85rem;
}
.filter-btn.active { background: #1f6feb; border-color: #1f6feb; color: #fff; }
.filter-btn:hover { border-color: #58a6ff; }

/* Main */
main { padding: 1.5rem 2rem; }

/* Table */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.6rem 1rem; text-align: left; border-bottom: 1px solid #21262d; }
th { color: #8b949e; font-weight: 500; font-size: 0.85rem; }
td { font-size: 0.9rem; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #161b22; }

/* Status badges */
.badge {
    display: inline-block; padding: 0.15rem 0.6rem; border-radius: 12px;
    font-size: 0.8rem; font-weight: 500;
}
.badge-pending { background: #1c1c0e; color: #d29922; border: 1px solid #3d2e00; }
.badge-processing { background: #0c1929; color: #58a6ff; border: 1px solid #0d419d; }
.badge-completed { background: #0e1c0e; color: #3fb950; border: 1px solid #196c2e; }
.badge-cancelled { background: #1c0e0e; color: #f85149; border: 1px solid #6e1b1b; }

/* Editor layout */
.editor-layout {
    display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; margin-top: 1rem;
}

/* Video panel */
.video-panel { min-width: 0; position: relative; }

#video-select {
    width: 100%; padding: 0.5rem 0.7rem; margin-bottom: 0.5rem;
    border-radius: 6px; border: 1px solid #333;
    background: #161b22; color: #e1e4e8; font-size: 0.9rem;
    cursor: pointer; appearance: auto;
}
#video-select:focus { border-color: #1f6feb; outline: none; }

.video-js { width: 100% !important; height: auto !important; aspect-ratio: 16/9; border-radius: 8px; overflow: hidden; }

.player-controls {
    display: flex; align-items: center; gap: 0.7rem; margin-top: 0.7rem;
    font-size: 0.85rem; color: #8b949e; font-variant-numeric: tabular-nums;
}
.timeline-container { flex: 1; position: relative; }
.timeline {
    height: 6px; background: #21262d; border-radius: 3px; cursor: pointer;
    position: relative;
}
.timeline-progress {
    height: 100%; background: #1f6feb; border-radius: 3px;
    width: 0%; pointer-events: none;
}
#markers-container {
    position: relative; height: 18px; margin-top: 2px;
}
.marker {
    position: absolute; height: 14px; border-radius: 2px;
    background: rgba(218, 54, 51, 0.4); border: 1px solid #da3633;
    top: 2px; cursor: pointer; min-width: 4px;
}
.marker:hover { background: rgba(218, 54, 51, 0.7); }

/* Controls panel */
.controls-panel {
    background: #161b22; border-radius: 8px; padding: 1.5rem;
    display: flex; flex-direction: column; gap: 1rem;
    max-height: calc(100vh - 200px); overflow-y: auto;
}
.controls-panel h3 { font-size: 1rem; color: #c9d1d9; margin-top: 0.2rem; }
.controls-panel .hint { font-size: 0.8rem; color: #8b949e; margin: 0.1rem 0 0.5rem; }
.controls-panel hr { border: none; border-top: 1px solid #21262d; margin: 0.8rem 0; }

.mark-buttons { display: flex; gap: 0.5rem; }
.mark-buttons .btn { flex: 1; }
.mark-input input {
    width: 100%; padding: 0.4rem 0.6rem; border-radius: 6px;
    border: 1px solid #333; background: #0f1117; color: #e1e4e8; font-size: 0.9rem;
}

.action-buttons { display: flex; flex-direction: column; gap: 0.5rem; }
.action-buttons .btn { width: 100%; }

#force-user-select {
    width: 100%; padding: 0.4rem; border-radius: 6px;
    border: 1px solid #333; background: #0f1117; color: #e1e4e8;
    font-size: 0.9rem; margin-bottom: 0.5rem;
}

/* Highlights list */
.highlight-item {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.4rem 0.5rem; background: #0f1117; border-radius: 6px;
    font-size: 0.85rem;
}
.highlight-item .hl-time { color: #58a6ff; white-space: nowrap; }
.highlight-item .hl-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.highlight-item .hl-delete {
    background: none; border: none; color: #f85149; cursor: pointer;
    font-size: 1rem; padding: 0 0.3rem;
}

/* Cuts list */
.cut-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.4rem 0.5rem; background: #0f1117; border-radius: 6px;
    font-size: 0.85rem; margin-top: 0.3rem;
}
.cut-item .cut-status { font-size: 0.8rem; }
.cut-item .cut-actions { display: flex; align-items: center; gap: 0.4rem; }
.cut-item .hl-delete {
    background: none; border: none; color: #f85149; cursor: pointer;
    font-size: 1.1rem; padding: 0 0.2rem; line-height: 1;
}
.cut-item .hl-delete:hover { color: #ff7b72; }

#request-info {
    background: #161b22; border-radius: 8px; padding: 1rem; margin-top: 0.7rem;
    font-size: 0.9rem; line-height: 1.6;
}

/* Toast notifications */
.toast {
    position: fixed; bottom: 1.5rem; right: 1.5rem; padding: 0.8rem 1.2rem;
    border-radius: 8px; font-size: 0.9rem; z-index: 9999;
    animation: fadeIn 0.3s;
}
.toast-success { background: #238636; color: #fff; }
.toast-error { background: #da3633; color: #fff; }
.toast-info { background: #1f6feb; color: #fff; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Loading */
.loading { text-align: center; padding: 2rem; color: #8b949e; }

/* Modal */
.modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal-content {
    background: #1c1f26; border-radius: 12px; padding: 1.5rem;
    width: 400px; display: flex; flex-direction: column; gap: 0.8rem;
}
.modal-content h2 { font-size: 1.2rem; }
.modal-content label {
    display: flex; flex-direction: column; gap: 0.3rem;
    font-size: 0.85rem; color: #8b949e;
}
.modal-content select,
.modal-content input {
    padding: 0.5rem; border-radius: 6px; border: 1px solid #333;
    background: #0f1117; color: #e1e4e8; font-size: 0.9rem;
}
.modal-row { display: flex; gap: 0.8rem; }
.modal-row label { flex: 1; }
.modal-actions { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 0.5rem; }

/* Crop toggle & slider */
.crop-toggle {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.85rem; color: #c9d1d9; cursor: pointer;
}
.crop-toggle input { cursor: pointer; }

#crop-slider-row {
    display: flex; align-items: center; gap: 0.5rem; margin-top: 0.3rem;
}
#crop-slider {
    flex: 1; height: 6px; -webkit-appearance: none; appearance: none;
    background: #21262d; border-radius: 3px; outline: none;
}
#crop-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
    background: #1f6feb; cursor: pointer;
}
#crop-slider-label { font-size: 0.8rem; color: #8b949e; min-width: 3rem; }

/* Crop overlay */
.crop-overlay {
    position: absolute; top: 0; left: 0; right: 0;
    pointer-events: none; z-index: 5; border-radius: 8px; overflow: hidden;
}
.crop-overlay-left, .crop-overlay-right {
    position: absolute; top: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.55);
}
