/* TranscribeX Styles */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(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-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* Login View */
#login-view {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-container {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.login-container h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.login-form {
    margin-top: 2rem;
}

.login-form input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.login-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.hint {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.error {
    background: #fee2e2;
    color: var(--error-color);
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
    font-size: 0.875rem;
}

/* Main View */
#main-view {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    box-shadow: var(--shadow-sm);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
}

#user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

#user-email {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.quota {
    background: var(--bg-color);
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

.card {
    background: var(--card-bg);
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.card h2 {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 0.75rem;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.drop-zone:hover {
    border-color: var(--primary-color);
    background: var(--bg-color);
}

.drop-zone.drag-over {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.upload-icon {
    width: 4rem;
    height: 4rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.drop-text {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.or-text {
    color: var(--text-secondary);
    margin: 1rem 0;
}

.file-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.file-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 0.5rem;
}

.file-selected .filename {
    font-weight: 500;
    color: var(--text-primary);
}

/* Settings */
.settings {
    margin: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

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

.setting-label {
    font-weight: 500;
    color: var(--text-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: help;
    transition: all 0.2s;
}

.info-icon:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-option:hover {
    border-color: var(--primary-color);
}

.radio-option input[type="radio"] {
    cursor: pointer;
}

.radio-option input[type="radio"]:checked + span {
    color: var(--primary-color);
    font-weight: 500;
}

.select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s;
}

.select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.speaker-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.speaker-inputs input[type="number"] {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    font-size: 1rem;
}

.speaker-inputs .to {
    color: var(--text-secondary);
}

/* Buttons */
.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

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

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

.btn-large {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.125rem;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-secondary:hover {
    opacity: 0.9;
}

.btn-text {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
}

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

/* Progress */
.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

.progress-bar {
    flex: 1;
    height: 0.75rem;
    background: var(--border-color);
    border-radius: 0.375rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.progress-fill.pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

.progress-percent {
    font-weight: 500;
    color: var(--text-primary);
    min-width: 3rem;
}

.progress-status {
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: block;
    margin-top: 0.5rem;
}

.time-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: block;
    margin-top: 0.5rem;
}

#upload-progress h3,
#processing-progress h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

/* Jobs List */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.jobs-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.no-jobs {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

.job-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.job-info {
    flex: 1;
}

.job-filename {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

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

.job-status {
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-complete {
    background: #d1fae5;
    color: #065f46;
}

.status-processing {
    background: #dbeafe;
    color: #1e40af;
}

.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.status-queued {
    background: #e0e7ff;
    color: #3730a3;
}

.job-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
}

.btn-download {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s;
}

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

.usage-summary {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.usage-summary strong {
    color: var(--text-primary);
}

#monthly-cost {
    color: var(--primary-color);
    font-weight: 600;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--card-bg);
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--primary-color);
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--error-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    main {
        padding: 1rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .radio-group {
        flex-direction: column;
    }
    
    .job-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .job-actions {
        margin-left: 0;
        width: 100%;
    }
    
    .btn-download {
        flex: 1;
    }
    
    #toast-container {
        left: 1rem;
        right: 1rem;
    }
}
