:root {
    --bg-color: #0d1117;
    --card-bg: rgba(22, 27, 34, 0.7);
    --border-color: rgba(48, 54, 61, 0.8);
    --primary-color: #58a6ff;
    --primary-hover: #3182ce;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --danger-color: #f85149;
    --success-color: #3fb950;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem;
    background-image: radial-gradient(circle at top center, rgba(88, 166, 255, 0.1), transparent 40%);
}

.dashboard {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo span {
    color: var(--primary-color);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

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

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(63, 185, 80, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(63, 185, 80, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(63, 185, 80, 0);
    }
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.75rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.75rem;
    margin-bottom: 0.5rem;
}

.panel-header h2 {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.results-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.badge {
    background: rgba(88, 166, 255, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 4px;
    padding: 0.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color);
}

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

label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.custom-select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: var(--font-family);
    appearance: none;
    outline: none;
    transition: all 0.2s;
}

.custom-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.2);
}

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

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(88, 166, 255, 0.05);
}

.upload-icon {
    width: 32px;
    height: 32px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.text-sm {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 10px;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-family: var(--font-family);
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

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

.btn.primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn.primary:disabled {
    background-color: var(--border-color);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.btn.secondary {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn.secondary:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.btn.record {
    background-color: rgba(248, 81, 73, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(248, 81, 73, 0.2);
    width: 100%;
}

.btn.record:hover {
    background-color: rgba(248, 81, 73, 0.2);
}

.btn.record.recording {
    animation: recording-pulse 2s infinite;
}

@keyframes recording-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(248, 81, 73, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(248, 81, 73, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(248, 81, 73, 0);
    }
}

.full-width {
    width: 100%;
}

.mt-4 {
    margin-top: 1rem;
}

.hide {
    display: none !important;
}

.recording-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    color: var(--danger-color);
    font-weight: 500;
}

.wave {
    width: 4px;
    height: 15px;
    background-color: var(--danger-color);
    border-radius: 2px;
    animation: waveform 1s ease-in-out infinite;
}

.wave:nth-child(2) {
    animation-delay: 0.1s;
}

.wave:nth-child(3) {
    animation-delay: 0.2s;
}

@keyframes waveform {

    0%,
    100% {
        height: 10px;
    }

    50% {
        height: 25px;
    }
}

.results-content {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 1.5rem;
    min-height: 200px;
    line-height: 1.6;
    font-size: 1rem;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.results-content.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-align: center;
}

.empty-icon {
    width: 48px;
    height: 48px;
    opacity: 0.5;
    margin-bottom: 1rem;
}

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(88, 166, 255, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 1rem;
}

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

.align-results {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.word-chip {
    background: rgba(88, 166, 255, 0.1);
    border: 1px solid rgba(88, 166, 255, 0.2);
    color: var(--primary-color);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.word-chip:hover {
    background: rgba(88, 166, 255, 0.2);
    transform: translateY(-2px);
}

.audio-preview {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.audio-preview audio {
    height: 40px;
    outline: none;
}