/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* Navbar */
.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 600;
}

.nav-links a {
    color: white;
    text-decoration: none;
    margin-left: 1.5rem;
    opacity: 0.9;
    transition: opacity 0.2s;
}

.nav-links a:hover {
    opacity: 1;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
}

.nav-user span {
    opacity: 0.8;
}

.logout-link {
    color: white;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    transition: background 0.2s;
}

.logout-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.alert-error {
    background-color: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #ecf0f1;
    color: #333;
}

.btn-secondary:hover {
    background-color: #dfe6e9;
}

.btn-full {
    width: 100%;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.button-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-box h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.login-box .subtitle {
    color: #7f8c8d;
    margin-bottom: 2rem;
}

.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

/* Upload */
.upload-container {
    max-width: 700px;
    margin: 0 auto;
}

.step {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 1.5rem;
}

.step h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.25rem;
}

.step.hidden {
    display: none;
}

/* Upload Area */
.upload-area {
    border: 3px dashed #bdc3c7;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #3498db;
    background-color: #f8fafc;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.upload-area p {
    color: #7f8c8d;
    margin-bottom: 1rem;
}

/* File Info */
.file-info {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #ecf0f1;
}

.file-info h3 {
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-item {
    text-align: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
}

.info-item .label {
    display: block;
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 0.25rem;
}

.hidden {
    display: none;
}

/* Model Selector */
.model-selector {
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.model-selector label {
    font-weight: 500;
    color: #2c3e50;
}

.model-dropdown {
    padding: 0.75rem 1rem;
    border: 2px solid #ecf0f1;
    border-radius: 8px;
    font-size: 1rem;
    min-width: 250px;
    cursor: pointer;
    background: white;
}

.model-dropdown:focus {
    outline: none;
    border-color: #3498db;
}

/* Page Range Selector */
.page-range-selector {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
}

.page-range-selector > label {
    display: block;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    text-align: center;
}

.page-inputs {
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.page-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-input-group label {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.page-input {
    width: 80px;
    padding: 0.5rem;
    border: 2px solid #ecf0f1;
    border-radius: 6px;
    font-size: 1rem;
    text-align: center;
}

.page-input:focus {
    outline: none;
    border-color: #3498db;
}

.page-hint {
    font-size: 0.8rem;
    color: #95a5a6;
    text-align: center;
    margin-top: 0.5rem;
}

/* Annotation Options */
.annotation-options {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #3498db;
}

.annotation-header {
    display: block;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 0.75rem;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.checkbox-item:hover {
    background-color: #e8f4fd;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3498db;
    cursor: pointer;
}

.checkbox-item span {
    font-size: 0.95rem;
    color: #2c3e50;
}

.annotation-hint {
    font-size: 0.8rem;
    color: #95a5a6;
    margin-top: 0.75rem;
    font-style: italic;
}

.model-info {
    text-align: center;
    padding: 0.75rem;
    background: #e8f4fd;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.model-info .label {
    color: #7f8c8d;
    margin-right: 0.5rem;
}

.model-info .value {
    font-weight: 600;
    color: #3498db;
}

/* Estimate */
.estimate-box {
    text-align: center;
}

.estimate-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.estimate-item {
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: 8px;
}

.estimate-item .label {
    display: block;
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.estimate-item .value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
}

.estimate-item.highlight {
    background: #e8f4fd;
    border: 2px solid #3498db;
}

.estimate-item.highlight .value {
    color: #3498db;
}

.estimate-note {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 1rem;
}

/* Progress */
.progress-container {
    margin-bottom: 2rem;
}

.progress-bar {
    height: 12px;
    background: #ecf0f1;
    border-radius: 6px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 6px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.current-page {
    text-align: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.transcription-preview {
    background: #1e1e1e;
    border-radius: 8px;
    padding: 1rem;
}

.transcription-preview h4 {
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.transcription-preview pre {
    color: #e0e0e0;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.85rem;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 200px;
    overflow-y: auto;
}

/* Complete */
.complete-box {
    text-align: center;
}

.complete-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.complete-box > p {
    font-size: 1.25rem;
    color: #2c3e50;
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-item {
    padding: 1.25rem;
    background: #f8fafc;
    border-radius: 8px;
}

.stat-item .label {
    display: block;
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.stat-item .value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.mode-btn {
    flex: 1;
    padding: 1.5rem 1rem;
    background: white;
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.mode-btn:hover {
    border-color: #bdc3c7;
}

.mode-btn.active {
    border-color: #3498db;
    background: #e8f4fd;
}

.mode-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.mode-label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.mode-desc {
    display: block;
    font-size: 0.85rem;
    color: #7f8c8d;
}

/* 2-column info grid for annotation mode */
.info-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* Processing spinner */
.processing-spinner {
    text-align: center;
    padding: 3rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #ecf0f1;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 600px) {
    .info-grid,
    .estimate-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .button-group {
        flex-direction: column;
    }

    .login-box {
        margin: 1rem;
        padding: 2rem;
    }

    .mode-toggle {
        flex-direction: column;
    }

    .info-grid-2 {
        grid-template-columns: 1fr;
    }
}
