/* ==========================================================================
   Timestamp Minimalist Dark Theme (Monochrome - No colors)
   ========================================================================== */

:root {
    --bg-dark: #0a0a0a;
    --bg-panel: #121212;
    --bg-card: #171717;
    --bg-hover: #262626;
    
    --accent-primary: #ffffff;
    --accent-hover: #e5e5e5;
    
    --text-main: #fafafa;
    --text-muted: #a1a1aa;
    --text-dim: #52525b;
    
    --border-color: #27272a;
    --border-highlight: #3f3f46;
    
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    accent-color: #ffffff;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    color-scheme: dark;
}

/* App Container Layout */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* Header */
.app-header {
    height: 54px;
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 10;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 1.05rem;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.logo-icon {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.header-stats {
    font-size: 0.8rem;
    color: var(--text-muted);
}

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

/* Main Workspace Split */
.app-workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar Controls */
.control-panel {
    width: 360px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.panel-section {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
}

.section-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Form Controls */
.form-group {
    margin-bottom: 12px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.form-row {
    display: flex;
    gap: 8px;
}

.flex-1 {
    flex: 1;
}

.form-input, .form-select {
    width: 100%;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 7px 10px;
    font-size: 0.8rem;
    font-family: inherit;
    transition: border-color 0.15s;
    -webkit-appearance: none;
    appearance: none;
    color-scheme: dark;
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.form-input:focus, .form-select:focus, .form-input-sm:focus {
    outline: none;
    border-color: #ffffff;
}

.form-input-sm {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 3px 6px;
    font-size: 0.75rem;
    font-family: inherit;
    color-scheme: dark;
}

.toolbar-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Native date/time input calendar icons — force white */
input[type="date"],
input[type="time"] {
    color-scheme: dark;
}

/* Checkboxes — strictly white, no purple */
input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #ffffff;
    cursor: pointer;
    flex-shrink: 0;
}

/* Time Summary Card */
.time-summary-box {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

.summary-item {
    display: flex;
    flex-direction: column;
}

.summary-label {
    font-size: 0.68rem;
    color: var(--text-dim);
    text-transform: uppercase;
}

.summary-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
}

/* Sliders */
.range-with-val {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

input[type="range"] {
    flex: 1;
    accent-color: #ffffff;
    cursor: pointer;
    color-scheme: dark;
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 3px 6px;
}

input[type="color"] {
    border: none;
    width: 24px;
    height: 20px;
    border-radius: 2px;
    cursor: pointer;
    background: none;
}

.color-val-hex {
    font-size: 0.75rem;
    font-family: monospace;
    color: var(--text-muted);
}

.checkbox-group {
    display: flex;
    gap: 14px;
}

.checkbox-label {
    font-size: 0.78rem;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Position Grid Buttons */
.position-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.pos-btn {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.pos-btn:hover {
    border-color: var(--border-highlight);
    color: var(--text-main);
}

.pos-btn.active {
    background-color: #ffffff;
    border-color: #ffffff;
    color: #0a0a0a;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #ffffff;
    color: #0a0a0a;
}

.btn-primary:hover:not(:disabled) {
    background-color: #e5e5e5;
}

.btn-secondary {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--bg-hover);
    border-color: var(--border-highlight);
}

.btn-secondary-sm {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
}

.btn-icon {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background-color: var(--bg-hover);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
}

.btn-text:hover {
    color: var(--text-main);
    text-decoration: underline;
}

/* Center Preview Section */
.preview-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #050505;
    position: relative;
    overflow: hidden;
}

/* Dropzone */
.dropzone-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.dropzone-card {
    border: 1px dashed var(--border-highlight);
    border-radius: var(--radius-lg);
    background-color: var(--bg-panel);
    padding: 48px;
    text-align: center;
    max-width: 480px;
    width: 100%;
    transition: border-color 0.2s;
}

.dropzone-card.drag-over {
    border-color: #ffffff;
    background-color: var(--bg-card);
}

.dropzone-icon {
    font-size: 2rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.dropzone-card h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.dropzone-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Preview Viewport */
.preview-viewport {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-toolbar {
    height: 40px;
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.preview-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
}

.badge {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--text-main);
}

.badge-dim {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.preview-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.canvas-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow: hidden;
    position: relative;
}

canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 2px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

/* Thumbnail Strip */
.thumbnail-strip-container {
    height: 110px;
    background-color: var(--bg-panel);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.thumbnail-header {
    height: 26px;
    padding: 0 14px;
    background-color: var(--bg-card);
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.thumbnail-strip {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    overflow-x: auto;
    white-space: nowrap;
}

.thumb-card {
    width: 72px;
    height: 62px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.15s;
    background-color: var(--bg-dark);
}

.thumb-card:hover {
    border-color: var(--border-highlight);
}

.thumb-card.active {
    border-color: #ffffff;
    border-width: 2px;
}

.thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-time-badge {
    position: absolute;
    bottom: 2px;
    left: 2px;
    right: 2px;
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 0.6rem;
    padding: 1px 3px;
    border-radius: 2px;
    text-align: center;
    font-family: monospace;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.modal-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: 380px;
    padding: 20px;
}

.modal-card-lg {
    width: 640px;
    max-width: 90vw;
    padding: 28px;
}

.text-center {
    text-align: center;
}

.modal-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
    margin-bottom: 20px;
}

.modal-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
}

.modal-header h3 {
    font-size: 1rem;
    margin-bottom: 14px;
    color: #fff;
}

/* Mode Options Grid */
.mode-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .mode-options-grid {
        grid-template-columns: 1fr;
    }
}

.mode-option-card {
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.2s ease;
}

.mode-option-card:hover {
    border-color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.05);
}

.mode-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: var(--bg-panel);
    border: 1px solid var(--border-highlight);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #ffffff;
    margin-bottom: 14px;
}

.mode-option-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #ffffff;
}

.mode-option-card p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
    flex: 1;
}

.btn-full {
    width: 100%;
}

/* Section Title Row with Badge */
.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-title-row .section-title {
    margin-bottom: 0;
}

.badge-mode-status {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    background-color: #ffffff;
    color: #0a0a0a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-mode-status.off {
    background-color: var(--bg-dark);
    color: var(--text-dim);
    border: 1px solid var(--border-color);
}

/* Preset Buttons */
.preset-btn-group {
    display: flex;
    gap: 6px;
}

.preset-btn {
    flex: 1;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    padding: 5px 0;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.preset-btn:hover {
    border-color: var(--border-highlight);
    color: var(--text-main);
}

.preset-btn.active {
    background-color: #ffffff;
    border-color: #ffffff;
    color: #0a0a0a;
    font-weight: 600;
}

.progress-bar-wrapper {
    height: 6px;
    background-color: var(--bg-dark);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar-fill {
    height: 100%;
    background-color: #ffffff;
    transition: width 0.15s ease;
}

.progress-status-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.ml-2 { margin-left: 8px; }

