:root {
    --primary-color: #0ea5e9;
    --primary-hover: #0284c7;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --dark: #1e293b;
    --dark-light: #334155;
    --light: #f8fafc;
    --light-gray: #e2e8f0;
    --border-color: #cbd5e1;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --shadow: 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, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

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

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-content h1 {
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 700;
}

.subtitle {
    opacity: 0.95;
    font-size: 14px;
}

.health-indicators {
    display: flex;
    gap: 20px;
    font-size: 14px;
}

.indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 8px;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Tabs */
.tabs {
    display: flex;
    background: var(--light);
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 18px 24px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s;
    position: relative;
}

.tab-btn:hover {
    background: rgba(14, 165, 233, 0.1);
    color: var(--primary-color);
}

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

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

/* Tab Content */
.tab-content {
    padding: 40px;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s;
}

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

/* Card */
.card {
    background: white;
}

.card h2 {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.description {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 14px;
}

/* Forms */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

textarea {
    width: 100%;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.char-count {
    text-align: right;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* File Input */
.file-input-wrapper {
    position: relative;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.file-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--light);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.file-label:hover {
    border-color: var(--primary-color);
    background: rgba(14, 165, 233, 0.05);
}

.file-icon {
    font-size: 24px;
}

#file-name, #transcribe-file-name {
    color: var(--text-secondary);
}

.help-text {
    display: block;
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Buttons */
.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

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

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

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

.btn-secondary {
    background: var(--light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    margin-right: 10px;
    margin-top: 10px;
}

.btn-secondary:hover {
    background: var(--light-gray);
}

/* Spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Progress Bar */
.progress-bar {
    margin: 20px 0;
    background: var(--light);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    animation: progress 2s ease-in-out infinite;
    width: 0%;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.progress-text {
    position: relative;
    z-index: 1;
    font-weight: 600;
    color: var(--text-primary);
}

/* Results */
.results {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--light-gray);
}

.results h3 {
    font-size: 22px;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.result-section {
    background: var(--light);
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid var(--primary-color);
}

.result-section h4 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.result-content {
    background: white;
    padding: 20px;
    border-radius: 6px;
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 15px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.transcription {
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.analysis {
    white-space: pre-wrap;
}

.key-points {
    list-style: none;
    padding: 0;
}

.key-points li {
    background: white;
    padding: 14px 20px;
    margin-bottom: 10px;
    border-radius: 6px;
    border-left: 3px solid var(--success-color);
    font-size: 15px;
}

.key-points li::before {
    content: '✓';
    color: var(--success-color);
    font-weight: bold;
    margin-right: 12px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.meta-info {
    display: block;
    margin-top: 10px;
    color: var(--text-secondary);
    font-size: 13px;
}

/* Footer */
.footer {
    background: var(--dark);
    color: white;
    padding: 24px 30px;
    text-align: center;
    font-size: 14px;
}

.footer p {
    margin: 6px 0;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
}

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

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

    .header {
        flex-direction: column;
        text-align: center;
    }

    .tabs {
        flex-direction: column;
    }

    .tab-content {
        padding: 20px;
    }

    .header-content h1 {
        font-size: 22px;
    }
}
