/* Modern Compact Dashboard Design - Cursor Style */

:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --primary-light: #818cf8;
    --secondary-color: #764ba2;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-elevated: #334155;
    --surface-hover: #475569;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border-color: #334155;
    --border-hover: #475569;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    letter-spacing: -0.01em;
}

/* App Container */
.app-container {
    min-height: 100vh;
    padding: 0;
    background: var(--background);
}

/* Compact Header */
.app-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    padding: 12px 20px;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

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

.logo-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    font-size: 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.app-title {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 16px;
    transition: var(--transition);
}

.status-indicator:hover {
    background: rgba(16, 185, 129, 0.2);
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

.status-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--success);
}

/* Main Content - Compact */
.main-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 16px;
}

/* Compact Tabs */
.tabs-container {
    background: var(--surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
    box-shadow: var(--shadow-sm);
}

.tabs-wrapper {
    display: flex;
    gap: 4px;
    max-width: 1600px;
    margin: 0 auto;
}

.tab-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.tab-button:hover {
    color: var(--text-primary);
    background: rgba(102, 126, 234, 0.1);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
}

.tab-button .material-icons {
    font-size: 18px;
}

/* Compact Tab Content */
.tab-content-container {
    background: var(--surface);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-lg);
    min-height: 500px;
}

.tab-content {
    display: none;
    animation: fadeIn 0.2s ease;
}

.tab-content.active {
    display: block;
}

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

/* Compact Card Design */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--border-hover);
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(102, 126, 234, 0.05);
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
    letter-spacing: -0.3px;
}

.card-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
}

.card-body {
    padding: 16px 20px;
}

/* Compact Form Elements */
.input-section {
    margin-bottom: 16px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-primary);
    background: var(--surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
    font-family: inherit;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
    background: var(--surface-hover);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 4px;
}

/* Compact Input Tabs */
.input-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: var(--surface-elevated);
    padding: 3px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.input-tab {
    flex: 1;
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.input-tab:hover {
    color: var(--text-primary);
    background: rgba(102, 126, 234, 0.1);
}

.input-tab.active {
    background: var(--surface);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.input-mode {
    display: none;
}

.input-mode.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

/* Compact File Upload */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 32px 16px;
    text-align: center;
    background: var(--surface-elevated);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 16px;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.file-upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.01);
}

.upload-icon {
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 8px;
    opacity: 0.7;
}

.upload-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 11px;
    color: var(--text-secondary);
}

.file-input {
    display: none;
}

/* Compact Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary .material-icons {
    font-size: 18px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    font-weight: 500;
}

.btn-secondary:hover {
    background: var(--surface-hover);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-secondary .material-icons {
    font-size: 16px;
}

/* Compact Results Section */
.results-section {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Compact Result Item */
.result-item {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    margin-bottom: 8px;
}

.result-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--border-color);
    transition: var(--transition);
}

.result-item.processing::before {
    background: var(--warning);
}

.result-item.success::before {
    background: var(--success);
}

.result-item.error::before {
    background: var(--error);
}

.result-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
    transform: translateX(2px);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.result-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.result-status {
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-status.processing {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.result-status.success {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.result-status.error {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.result-content {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 13px;
}

.result-metadata {
    display: flex;
    gap: 12px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    font-size: 10px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.result-metadata span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.result-metadata .material-icons {
    font-size: 14px;
    opacity: 0.7;
}

/* Compact Evaluation Result Container */
.evaluation-result-container {
    background: transparent;
    border-radius: 0;
    padding: 0;
    border: none;
    box-shadow: none;
}

/* Compact Question Result Card */
.question-result-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.question-result-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.question-result-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(2px);
    border-color: var(--border-hover);
}

/* Compact Band Score Cards */
.band-score-card {
    background: var(--surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    text-align: center;
    transition: var(--transition);
    min-width: 80px;
}

.band-score-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    border-color: var(--primary-color);
    background: var(--surface-hover);
}

.band-score-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.band-score-value {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Compact Diagnostic Cards */
.diagnostic-card {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    font-size: 12px;
}

.diagnostic-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateX(2px);
}

.diagnostic-card.flow-clarity {
    background: rgba(59, 130, 246, 0.1);
    border-left: 2px solid #3b82f6;
}

.diagnostic-card.grammar {
    background: rgba(139, 92, 246, 0.1);
    border-left: 2px solid #8b5cf6;
}

.diagnostic-card.vocabulary {
    background: rgba(249, 115, 22, 0.1);
    border-left: 2px solid #f97316;
}

.diagnostic-card.pronunciation {
    background: rgba(34, 197, 94, 0.1);
    border-left: 2px solid #22c55e;
}

/* Compact Transcription Feedback Card */
.feedback-card {
    background: var(--surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border-left: 2px solid var(--primary-color);
    font-size: 12px;
}

.feedback-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(2px);
}

.feedback-card.vocabulary {
    border-left-color: #f97316;
}

.feedback-card.grammar {
    border-left-color: #8b5cf6;
}

.feedback-card.flow_clarity {
    border-left-color: #3b82f6;
}

.feedback-card.pronunciation {
    border-left-color: #22c55e;
}

/* Compact Overall AI Feedback Section */
.ai-feedback-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-top: 12px;
    box-shadow: var(--shadow-lg);
    color: white;
}

.ai-feedback-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-sm);
    padding: 10px;
    margin-bottom: 0;
    box-shadow: var(--shadow-sm);
    border-left: 2px solid var(--primary-color);
    transition: var(--transition);
}

.ai-feedback-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.ai-feedback-card.high {
    border-left-color: #ef4444;
}

.ai-feedback-card.medium {
    border-left-color: #f59e0b;
}

.ai-feedback-card.low {
    border-left-color: #10b981;
}

/* Audio Player */
.audio-player {
    margin-top: 10px;
    padding: 10px;
    background: var(--surface-elevated);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.audio-player audio {
    width: 100%;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 3px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    width: 0%;
    transition: width 0.3s ease;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

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

.loading-spinner {
    background: var(--surface);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    text-align: center;
    border: 1px solid var(--border-color);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

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

.loading-spinner p {
    color: var(--text-primary);
    font-size: 13px;
    margin: 0;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 280px;
    animation: slideInRight 0.3s ease;
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--error);
}

.toast.info {
    border-left: 3px solid var(--info);
}

.toast .material-icons {
    font-size: 18px;
}

.toast span:last-child {
    font-size: 13px;
    color: var(--text-primary);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* JSON Viewer */
.json-viewer {
    background: #0f172a;
    color: #e2e8f0;
    padding: 16px;
    border-radius: var(--radius-md);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    overflow-x: auto;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.empty-state .material-icons {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.3;
    color: var(--text-tertiary);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-content {
        padding: 12px;
    }
    
    .card-body {
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 0;
    }
    
    .app-header {
        padding: 10px 16px;
    }
    
    .main-content {
        padding: 12px;
    }
    
    .tabs-container {
        padding: 0 12px;
    }
    
    .tab-content-container {
        padding: 12px;
    }
    
    .card-body {
        padding: 12px;
    }
    
    .tabs-wrapper {
        overflow-x: auto;
        scrollbar-width: none;
    }
    
    .tabs-wrapper::-webkit-scrollbar {
        display: none;
    }
    
    .tab-button {
        white-space: nowrap;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .evaluation-result-container {
        padding: 0;
    }
    
    .question-result-card {
        padding: 12px;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection Color */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: var(--text-primary);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--surface);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}
