/* PDF Translator - Main Styles */

:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --success: #16a34a;
    --error: #dc2626;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* Header */
.header {
    background: var(--primary);
    color: white;
    padding: 1.5rem 2rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.header p {
    font-size: 0.95rem;
    opacity: 0.9;
}

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

/* Card */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

/* Steps */
.steps {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

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

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 1.5rem;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary);
    background: #eff6ff;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.upload-area h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.upload-area p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.file-input {
    display: none;
}

.file-name {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
}

/* Language Selection */
.lang-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

.lang-group {
    flex: 1;
}

.lang-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.lang-group select {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    color: var(--text);
    cursor: pointer;
}

.swap-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: all 0.2s;
    margin-top: 1.2rem;
    flex-shrink: 0;
}

.swap-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Submit Button */
.btn-translate {
    width: 100%;
    padding: 0.85rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-translate:hover {
    background: var(--primary-hover);
}

.btn-translate:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

/* Flash Messages */
.flash {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.flash.error {
    background: #fef2f2;
    color: var(--error);
    border: 1px solid #fecaca;
}

.flash.success {
    background: #f0fdf4;
    color: var(--success);
    border: 1px solid #bbf7d0;
}

/* Result Page */
.result-card {
    text-align: center;
}

.result-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.result-card h2 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: var(--success);
}

.result-info {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.btn-download {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: var(--success);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: background 0.2s;
    margin-bottom: 0.75rem;
}

.btn-download:hover {
    background: #15803d;
}

.btn-back {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-back:hover {
    text-decoration: underline;
}

/* Loading */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    margin-top: 1rem;
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Formats */
.formats {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Options Row (Service + Domain) */
.options-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.option-group {
    flex: 1;
}

.option-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.option-group select {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    color: var(--text);
    cursor: pointer;
}

/* API Key Warning */
.api-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: #92400e;
}

.warning-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Result meta info */
.result-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.8;
}

/* Footer */
.footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 600px) {
    .steps {
        gap: 1rem;
    }
    .options-row {
        flex-direction: column;
    }
    .lang-row {
        flex-direction: column;
    }
    .swap-btn {
        margin-top: 0;
        transform: rotate(90deg);
    }
    .container {
        padding: 0 0.75rem;
    }
}
