/* Salazar Web — Dark Theme */
:root {
    --bg: #0f1117;
    --card: #1a1d27;
    --border: #2a2d3a;
    --accent: #6c63ff;
    --accent-hover: #5a52e0;
    --success: #2ecc71;
    --error: #e74c3c;
    --text: #e8e8e8;
    --text-dim: #888;
    --radius: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 40px 20px;
}

.container {
    width: 100%;
    max-width: 600px;
}

h1 {
    text-align: center;
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--accent);
}

.subtitle {
    text-align: center;
    color: var(--text-dim);
    margin-bottom: 32px;
    font-size: 14px;
}

/* Cards */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 20px;
}

/* Login Form */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--accent);
}

/* Buttons */
.btn {
    display: inline-block;
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
    text-decoration: none;
}

.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #27ae60; }
.btn-danger { background: var(--error); }

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 16px;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(108, 99, 255, 0.05);
}

.upload-zone .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-zone p {
    color: var(--text-dim);
    font-size: 14px;
}

.upload-zone .highlight {
    color: var(--accent);
    text-decoration: underline;
}

#file-list {
    max-height: 150px;
    overflow-y: auto;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-dim);
}

#file-list .file-item {
    padding: 4px 0;
    border-bottom: 1px solid var(--border);
}

/* Progress */
.progress-section { display: none; }
.progress-section.active { display: block; }

.progress-bar-container {
    width: 100%;
    height: 24px;
    background: var(--bg);
    border-radius: 12px;
    overflow: hidden;
    margin: 16px 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #8b5cf6);
    border-radius: 12px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-dim);
}

.status-text {
    font-size: 14px;
    color: var(--text);
    margin-top: 12px;
    padding: 8px 12px;
    background: var(--bg);
    border-radius: 8px;
    min-height: 36px;
}

/* Log viewer */
.log-viewer {
    margin-top: 16px;
    max-height: 200px;
    overflow-y: auto;
    background: #000;
    border-radius: 8px;
    padding: 12px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 11px;
    color: #0f0;
    line-height: 1.5;
    display: none;
}

.log-viewer.active { display: block; }

.log-toggle {
    margin-top: 12px;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-dim);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.log-toggle:hover { border-color: var(--accent); color: var(--text); }

/* Error */
.error-msg {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid var(--error);
    border-radius: 8px;
    padding: 12px;
    color: var(--error);
    margin-top: 12px;
    display: none;
}

.error-msg.active { display: block; }

/* Download section */
.download-section { display: none; }
.download-section.active { display: block; text-align: center; }
.download-section .icon { font-size: 64px; margin-bottom: 16px; }

/* Thumbnail Grid */
.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

.thumb-item {
    position: relative;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px;
    text-align: center;
    transition: border-color 0.2s;
}

.thumb-item:hover { border-color: var(--accent); }

.thumb-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.thumb-icon {
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.thumb-label {
    display: block;
    font-size: 10px;
    color: var(--text-dim);
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.thumb-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    cursor: pointer;
    line-height: 18px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.thumb-item:hover .thumb-remove { opacity: 1; }

.file-count {
    font-size: 13px;
    color: var(--text-dim);
    padding: 6px 0;
}

/* Timer */
.timer-display {
    font-size: 14px;
    color: var(--accent);
    text-align: center;
    padding: 8px 0;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Current folder */
.current-folder {
    display: none;
    font-size: 13px;
    color: var(--text);
    background: rgba(108, 99, 255, 0.1);
    border: 1px solid rgba(108, 99, 255, 0.2);
    border-radius: 8px;
    padding: 8px 12px;
    margin-top: 10px;
}

.folder-progress {
    color: var(--text-dim);
    font-size: 12px;
}

/* Result Preview */
.result-preview {
    margin-bottom: 20px;
}

.preview-title {
    font-size: 15px;
    margin-bottom: 12px;
    color: var(--text);
}

.preview-folder {
    margin-bottom: 16px;
}

.preview-folder-name {
    display: block;
    font-size: 12px;
    color: var(--accent);
    margin-bottom: 8px;
    font-weight: 600;
}

.preview-images {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.preview-img-wrap {
    flex-shrink: 0;
    text-align: center;
}

.preview-img-wrap img {
    width: 140px;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.preview-img-label {
    display: block;
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 4px;
    text-transform: capitalize;
}

/* Processing Options */
.options-section {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.options-title {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 14px;
    font-weight: 600;
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 8px;
    transition: background 0.15s;
    user-select: none;
}

.option-item:hover {
    background: rgba(108, 99, 255, 0.06);
}

.option-item input[type="checkbox"] {
    display: none;
}

.option-check {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

.option-item input[type="checkbox"]:checked + .option-check {
    background: var(--accent);
    border-color: var(--accent);
}

.option-item input[type="checkbox"]:checked + .option-check::after {
    content: "✓";
    color: white;
    font-size: 13px;
    font-weight: 700;
}

.option-label {
    font-size: 13px;
    color: var(--text);
}

.option-item input[type="checkbox"]:not(:checked) ~ .option-label {
    color: var(--text-dim);
    text-decoration: line-through;
}

/* Responsive */
@media (max-width: 480px) {
    body { padding: 16px 12px; }
    .card { padding: 20px; }
    .upload-zone { padding: 32px 16px; }
    .thumbnail-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
    .preview-img-wrap img { width: 110px; height: 140px; }
}
