:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --success-color: #10b981;
    --success-hover: #059669;
    --danger-color: #ef4444;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px 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: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 2rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-primary);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

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

.example-file {
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.example-file p {
    font-size: 0.95rem;
    margin: 0;
}

.example-file a {
    color: white;
    text-decoration: underline;
    font-weight: 600;
    transition: opacity 0.3s ease;
}

.example-file a:hover {
    opacity: 0.8;
}

main {
    padding: 2rem;
}

section {
    margin-bottom: 2rem;
}

section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

section h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary-color);
    background: #eef2ff;
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    color: var(--primary-color);
}

.upload-area p {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 1rem;
}

.file-types {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.file-info {
    margin-top: 1rem;
    padding: 1rem;
    background: #ecfdf5;
    border-radius: 8px;
    border: 1px solid #86efac;
}

.file-details {
    color: var(--text-primary);
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.setting-group {
    display: flex;
    flex-direction: column;
}

.setting-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.setting-group select {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.setting-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Checkbox Group */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checkbox-item label {
    cursor: pointer;
    user-select: none;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 12px;
    background: var(--bg-secondary);
    border-radius: 6px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, #8b5cf6 100%);
    transition: width 0.3s ease;
    border-radius: 6px;
}

.status-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.status-details {
    text-align: center;
    color: var(--text-primary);
    font-size: 0.875rem;
    margin-top: 0.5rem;
    font-style: italic;
}

/* Buttons */
.actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.btn svg {
    width: 20px;
    height: 20px;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: var(--success-hover);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

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

/* Results */
.results {
    background: #ecfdf5;
    border: 1px solid #86efac;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.results h3 {
    color: var(--success-color);
    margin-bottom: 1rem;
}

.results-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.results-info p {
    font-size: 1rem;
}

/* Footer */
footer {
    background: var(--bg-secondary);
    padding: 1.5rem 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
}

footer .note {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--danger-color);
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    main {
        padding: 1.5rem;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .checkbox-group {
        grid-template-columns: 1fr;
    }

    .actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

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

.file-info,
.excel-settings,
.model-status,
.translation-progress,
.results {
    animation: fadeIn 0.3s ease;
}

/* Loading spinner for model download */
.model-status h3 {
    position: relative;
    padding-left: 2rem;
}

.model-status h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translateY(-50%) rotate(360deg);
    }
}
