/* Modern Voice Lab Design */

:root {
    --primary: #0f172a;
    --secondary: #1e293b;
    --accent: #3b82f6;
    --accent-light: #60a5fa;
    --success: #10b981;
    --warning: #836d47;
    --danger: #ef4444;
    --text: #f1f5f9;
    --text-muted: #cbd5e1;
    --border: #fcfcfc;
    --bg: #0f172a;
    --bg-secondary: #1e293b;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme */
[data-theme="light"] {
    --primary: #ffffff;
    --secondary: #f8fafc;
    --accent: #3b82f6;
    --accent-light: #2563eb;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #062b5c;
    --bg: #f8fafc;
    --bg-secondary: #ffffff;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.app-modern {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header-modern {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-bottom: 1px solid var(--border);
    padding: 2rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

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

.header-modern__logo h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.25rem;
}

.header-modern__logo {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.header-modern__logo p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Header Actions */
.header-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 10px;
    vertical-align: middle;
    margin-top: -4px;
}

.theme-toggle-btn,
.help-btn {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.theme-toggle-btn:hover,
.help-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.1);
}

.theme-toggle-btn:active,
.help-btn:active {
    transform: scale(0.95);
}

/* Theme Icons */
.theme-icon {
    position: absolute;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.theme-icon.hidden {
    opacity: 0;
    transform: rotate(180deg);
}

.theme-icon:not(.hidden) {
    opacity: 1;
    transform: rotate(0deg);
}

.header-modern__status {
    display: flex;
    gap: 2rem;
}

.status-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    position: relative;
}

.status-item:first-child {
    min-width: 180px;
    flex-direction: column;
    align-items: flex-start;
}

.status-item:nth-child(2) {
    min-width: 100px;
}

.status-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.status-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-light);
}

/* Queue Details & Progress Bar */
.queue-details {
    margin-top: 0.5rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.queue-details.hidden {
    display: none;
}

.queue-eta {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 100%);
    border-radius: 2px;
    transition: width 0.3s ease-out;
    position: relative;
}

.progress-bar__fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    animation: progressShimmer 2s infinite;
}

@keyframes progressShimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Main Layout */
.main-modern {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 2rem;
    display: flex;
    gap: 2rem;
}

/* Navigation */
.nav-modern {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 200px;
    flex-shrink: 0;
}

.nav-modern__item {
    padding: 1rem 1.5rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    text-align: left;
}

.nav-modern__item:hover {
    background: var(--bg-secondary);
    color: var(--text);
    border-color: var(--border);
}

.nav-modern__item.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* Content */
.content-modern {
    flex: 1;
    min-width: 0;
}

.section-modern {
    animation: fadeIn 0.3s ease-in;
}

.section-modern.hidden {
    display: none;
}

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

.section-modern h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    letter-spacing: -0.5px;
}

/* Grid */
.grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.card-modern {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 2rem;
    transition: var(--transition);
}

.card-modern:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.1);
}

.card-modern h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.list-modern {
    list-style: none;
    counter-reset: item;
}

.list-modern li {
    counter-increment: item;
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-muted);
    line-height: 1.6;
}

.list-modern li:before {
    content: counter(item);
    position: absolute;
    left: 0;
    width: 1.25rem;
    height: 1.25rem;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Forms */
.form {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

.form-row {
    margin-bottom: 1.5rem;
}

.form-row label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.form-row input,
.form-row textarea,
.form-row select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.8);
    border: 2px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
    outline: none;
    border-color: var(--accent-light);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
    background: rgba(15, 23, 42, 1);
}

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

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    display: inline-block;
}

.btn:hover {
    background: var(--border);
    border-color: var(--accent);
}

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

.btn.primary:hover {
    background: var(--accent-light);
    border-color: var(--accent-light);
}

.btn.danger {
    background: transparent;
    border-color: var(--danger);
    color: var(--danger);
}

.btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Cards */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: var(--transition);
}

.card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.card__title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.card__text {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--accent);
    padding: 1rem;
    border-radius: 0.25rem;
    margin: 1rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.card__actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

/* Audio */
audio {
    width: 100%;
    margin: 1rem 0;
    border-radius: 0.5rem;
}

/* Alert */
.alert {
    background: rgba(59, 130, 246, 0.15);
    border: 2px solid var(--accent);
    border-radius: 0.75rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    color: var(--text);
    font-weight: 500;
}

/* Footer */
.footer-modern {
    background: var(--secondary);
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    margin-top: auto;
}

.footer-modern a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

.footer-modern a:hover {
    color: var(--accent-light);
}

.footer-modern__socials {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.social-link-text {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--accent);
    border-radius: 0.5rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
}

.social-link-text:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.social-link-text svg {
    width: 18px;
    height: 18px;
}

/* Toast */
#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.toast {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: slideIn 0.3s ease-out;
    box-shadow: var(--shadow);
}

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

.toast__link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.toast__link:hover {
    color: var(--accent-light);
}

/* Utilities */
.muted {
    color: var(--text-muted);
}

.subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Details/Tips */
details {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 1rem 0;
    cursor: pointer;
}

details:hover {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.05);
}

details summary {
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    user-select: none;
}

details summary:hover {
    color: var(--accent-light);
}

.tips-content {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.tips-content p {
    margin: 0.75rem 0;
    color: var(--text-muted);
    line-height: 1.6;
}

.tips-content strong {
    color: var(--text);
}

/* Checkbox */
.form-row.checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-row.checkbox label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    cursor: pointer;
    font-weight: 500;
}

.form-row.checkbox input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
    accent-color: var(--accent);
}

/* Info Icon */
.info-icon {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 1.25rem;
    font-size: 0.75rem;
    font-weight: bold;
    cursor: help;
    margin-left: 0.5rem;
}

.info-icon[data-tooltip] {
    position: relative;
}

.info-icon[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-secondary);
    border: 1px solid var(--accent);
    color: var(--text);
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    white-space: pre-wrap;
    width: 200px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Job Status */
.job-status {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.job-status__line {
    height: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
    margin-bottom: 1rem;
    border-radius: 1px;
}

.job-status p {
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .main-modern {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-modern {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
    }

    .header-modern__container {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .header-modern__status {
        width: 100%;
        justify-content: space-between;
        gap: 1rem;
    }

    .status-item:first-child {
        min-width: 120px;
    }

    .status-item:nth-child(2) {
        min-width: 80px;
    }

    .queue-details {
        width: 100%;
    }

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

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

    .section-modern h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .main-modern {
        padding: 1rem;
    }

    .header-modern {
        padding: 1rem 0;
    }

    .header-modern__container {
        padding: 0 1rem;
    }

    .header-modern__logo {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .header-modern__logo h1 {
        font-size: 1.5rem;
    }

    .header-actions {
        margin-left: auto;
        margin-top: 0;
    }

    .theme-toggle-btn,
    .help-btn {
        width: 32px;
        height: 32px;
    }

    .header-modern__status {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .status-item:first-child {
        min-width: 100px;
        max-width: 120px;
    }

    .status-item:nth-child(2),
    .status-item:nth-child(3) {
        min-width: 70px;
        flex: 1;
    }

    .queue-eta {
        font-size: 0.7rem;
    }

    .progress-bar {
        height: 2px;
    }

    .nav-modern {
        gap: 0.25rem;
    }

    .nav-modern__item {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
    }

    .form {
        padding: 1rem;
    }

    .card-modern {
        padding: 1rem;
    }

    .section-modern h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 360px) {
    .status-item:first-child {
        display: none;
    }

    .header-modern__status {
        gap: 0.5rem;
        justify-content: flex-start;
    }

    .status-item {
        min-width: auto;
        flex: 0 0 auto;
    }

    .status-label {
        font-size: 0.65rem;
    }

    .status-value {
        font-size: 0.9rem;
    }

    .header-modern__logo h1 {
        font-size: 1.25rem;
    }

    .theme-toggle-btn,
    .help-btn {
        width: 28px;
        height: 28px;
    }
}

/* Onboarding Modal */
.onboarding-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.onboarding-modal.hidden {
    display: none;
}

.onboarding-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.onboarding-content {
    position: relative;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    animation: onboardingSlideIn 0.3s ease-out;
}

@keyframes onboardingSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.onboarding-header {
    text-align: center;
    margin-bottom: 2rem;
}

.onboarding-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.onboarding-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

.onboarding-steps {
    margin-bottom: 2rem;
}

.step-indicator {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.step-current {
    color: var(--accent-light);
    font-weight: 600;
}

.onboarding-step {
    display: none;
    text-align: center;
}

.onboarding-step.active {
    display: block;
    animation: stepFadeIn 0.4s ease-out;
}

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

.step-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.onboarding-step h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 1rem;
}

.onboarding-step p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.step-tips {
    list-style: none;
    text-align: left;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin: 0;
}

.step-tips li {
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
    font-size: 0.875rem;
}

.step-tips li:before {
    content: "✓";
    color: var(--accent);
    position: absolute;
    left: 0;
    font-weight: bold;
}

.step-tips li:last-child {
    margin-bottom: 0;
}

.onboarding-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
}

.onboarding-actions .btn {
    transition: var(--transition);
}

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

/* Onboarding Highlight Overlay */
.onboarding-highlight {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
}

.onboarding-highlight.hidden {
    display: none;
}

.onboarding-highlight-area {
    position: absolute;
    border: 3px solid var(--accent);
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
    transition: all 0.3s ease-out;
    animation: highlightPulse 2s infinite;
}

@keyframes highlightPulse {
    0%, 100% {
        border-color: var(--accent);
    }
    50% {
        border-color: var(--accent-light);
    }
}

/* Responsive Onboarding */
@media (max-width: 768px) {
    .onboarding-content {
        padding: 1.5rem;
        margin: 1rem;
        width: calc(100% - 2rem);
        max-height: 90vh;
    }

    .onboarding-title {
        font-size: 1.5rem;
    }

    .onboarding-step h3 {
        font-size: 1.25rem;
    }

    .step-icon {
        font-size: 2.5rem;
    }

    .onboarding-actions {
        flex-direction: column;
        gap: 1rem;
    }

    .action-buttons {
        width: 100%;
    }

    .action-buttons .btn {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .onboarding-content {
        padding: 1rem;
    }

    .onboarding-title {
        font-size: 1.25rem;
    }

    .step-tips {
        padding: 0.75rem;
    }

    .step-tips li {
        font-size: 0.8rem;
    }
}
