@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-hover: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    --border-hover: #cbd5e1;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode - Deep Blue Theme */
[data-theme="dark"] {
    --primary-color: #818cf8;
    --primary-dark: #6366f1;
    --primary-light: #a5b4fc;
    --secondary-color: #a78bfa;
    --accent-color: #f472b6;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-light: #64748b;
    --border-color: #334155;
    --border-hover: #475569;
    --success-color: #34d399;
    --error-color: #f87171;
    --warning-color: #fbbf24;
    --info-color: #60a5fa;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] body,
body.dark-mode {
    background: #0f172a;
    color: var(--text-primary);
}

[data-theme="dark"] .navbar {
    background: rgba(30, 41, 59, 0.95);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .main-content {
    background: #0f172a;
}

[data-theme="dark"] .card,
[data-theme="dark"] .step-card,
[data-theme="dark"] .dubai3-rendition-row-v2,
[data-theme="dark"] .dubai3-rendition-row-collapsed {
    background: linear-gradient(135deg, #1e293b 0%, rgba(99, 102, 241, 0.05) 100%);
    border-color: var(--border-color);
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: #1e293b;
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
    border-color: var(--primary-color);
    background: #334155;
}

[data-theme="dark"] .btn-secondary {
    background: #334155;
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .btn-secondary:hover {
    background: #475569;
}

[data-theme="dark"] .footer {
    background: #1e293b;
    border-top-color: var(--border-color);
}

/* Dark Mode - Dubai 3 Specific Styles */
[data-theme="dark"] .dubai3-step-container {
    background: #0f172a;
}

[data-theme="dark"] .dubai3-step-header {
    background: linear-gradient(135deg, #1e293b 0%, rgba(99, 102, 241, 0.1) 100%);
    border-color: var(--border-color);
}

[data-theme="dark"] .dubai3-step-content {
    background: #0f172a;
}

[data-theme="dark"] .dubai3-rendition-list {
    background: #0f172a;
}

[data-theme="dark"] .dubai3-rendition-row-v2 {
    background: linear-gradient(135deg, #1e293b 0%, rgba(99, 102, 241, 0.08) 100%);
    border-color: #334155;
}

[data-theme="dark"] .dubai3-rendition-row-v2:hover {
    border-color: #475569;
}

[data-theme="dark"] .dubai3-rendition-row-collapsed {
    background: linear-gradient(135deg, #1e293b 0%, rgba(99, 102, 241, 0.05) 100%);
    border-color: #334155;
}

[data-theme="dark"] .dubai3-rendition-row-collapsed:hover {
    border-color: #475569;
}

[data-theme="dark"] .dubai3-rendition-row-collapsed.has-final-tts {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    border-color: rgba(16, 185, 129, 0.3);
}

[data-theme="dark"] .dubai3-rendition-row-collapsed.has-tts-no-final {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.03) 100%);
    border-color: rgba(239, 68, 68, 0.2);
}

[data-theme="dark"] .dubai3-translated-textarea,
[data-theme="dark"] .dubai3-original-text-content {
    background: #1e293b;
    border-color: #334155;
    color: var(--text-primary);
}

[data-theme="dark"] .dubai3-translated-textarea:focus,
[data-theme="dark"] .dubai3-original-text-content:focus {
    border-color: var(--primary-color);
    background: #334155;
}

[data-theme="dark"] .dubai3-save-translation-btn:hover {
    background: rgba(16, 185, 129, 0.15);
}

[data-theme="dark"] .dubai3-segment-speaker-edit,
[data-theme="dark"] .dubai3-segment-time-edit {
    color: var(--text-primary);
}

[data-theme="dark"] .dubai3-segment-speaker-edit:hover,
[data-theme="dark"] .dubai3-segment-time-edit:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: #475569;
}

[data-theme="dark"] .dubai3-segment-speaker-edit:focus,
[data-theme="dark"] .dubai3-segment-time-edit:focus {
    background: #334155;
    border-color: var(--primary-color);
}

[data-theme="dark"] .dubai3-header-settings-content {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .dubai3-header-settings-toggle {
    color: var(--text-secondary);
}

[data-theme="dark"] .dubai3-header-settings-toggle:hover {
    background: rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .dubai3-header-setting select,
[data-theme="dark"] .dubai3-header-setting input {
    background: #334155;
    border-color: #475569;
    color: var(--text-primary);
}

[data-theme="dark"] .dubai3-rendition-tts-section {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.08) 100%);
    border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .dubai3-version-btn {
    background: #334155;
    border-color: #475569;
    color: var(--text-primary);
}

[data-theme="dark"] .dubai3-version-btn.empty-slot {
    background: #1e293b;
    border-color: #a78bfa;
}

[data-theme="dark"] .dubai3-version-btn:hover {
    background: #475569;
}

[data-theme="dark"] .dubai3-collapsed-slot.empty {
    background: #1e293b;
    border-color: #a78bfa;
    color: #a78bfa;
}

[data-theme="dark"] .dubai3-view-toggle {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .dubai3-view-btn {
    color: var(--text-secondary);
}

[data-theme="dark"] .dubai3-view-btn:hover {
    background: rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .dubai3-view-btn.active {
    background: var(--primary-color);
    color: white;
}

[data-theme="dark"] .dubai3-collapse-btn {
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--text-secondary);
}

[data-theme="dark"] .dubai3-collapse-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-color);
}

[data-theme="dark"] .dubai3-waveform-mode-toggle {
    border-left-color: rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .dubai3-waveform-mode-btn {
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--text-secondary);
}

[data-theme="dark"] .dubai3-waveform-mode-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-color);
}

[data-theme="dark"] .dubai3-graphs-stack {
    background: #1e293b;
    border-color: #334155;
}

[data-theme="dark"] .dubai3-graph-container {
    background: #1e293b;
}

[data-theme="dark"] .dubai3-graph-header {
    color: var(--text-secondary);
}

[data-theme="dark"] .dubai3-play-original-btn,
[data-theme="dark"] .dubai3-play-tts-btn {
    background: #1e293b;
}

[data-theme="dark"] .dubai3-collapsed-play-btn {
    background: transparent;
    border-color: #475569;
    color: var(--text-secondary);
}

[data-theme="dark"] .dubai3-collapsed-play-btn.source {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

[data-theme="dark"] .dubai3-collapsed-play-btn.tts {
    border-color: #34d399;
    color: #34d399;
}

[data-theme="dark"] .dubai3-gen-model-select {
    background: #1e293b;
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

[data-theme="dark"] .dubai3-translate-btn,
[data-theme="dark"] .dubai3-orig-translate-btn,
[data-theme="dark"] .dubai3-collapsed-translate-btn {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
}

[data-theme="dark"] .dubai3-translate-btn:hover,
[data-theme="dark"] .dubai3-orig-translate-btn:hover,
[data-theme="dark"] .dubai3-collapsed-translate-btn:hover {
    background: rgba(99, 102, 241, 0.25);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    font-size: 16px;
}

/* Apply light background for all pages (modern style) */
body:not([data-home="true"]) {
    background: #ffffff;
    background-attachment: fixed;
}

body:not([data-home="true"])::before {
    display: none;
}

#app {
    position: relative;
    z-index: 1;
}

.main-content {
    padding: 0rem 0rem;
    min-height: calc(100vh - 80px);
}

/* Footer */
.app-footer {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    padding: 3rem 2rem 1.5rem;
    margin-top: 4rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #ffffff;
}

.footer-section p {
    margin: 0.5rem 0;
    color: #cbd5e1;
    font-size: 0.95rem;
}

.footer-section a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-section a:hover {
    color: #ffffff;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

.footer-bottom p {
    margin: 0;
}

/* Pricing */
.pricing-hero {
    padding: 4.5rem clamp(1rem, 5vw, 4rem) 2.5rem;
    text-align: center;
    background: radial-gradient(circle at top, rgba(99,102,241,0.25), transparent 55%),
                linear-gradient(180deg, rgba(15,23,42,0.95) 0%, rgba(15,23,42,0.7) 65%, transparent 100%);
}

.pricing-hero-content {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 32px;
    padding: 2.5rem 2.25rem;
    box-shadow: 0 25px 65px rgba(15,23,42,0.12);
}

.pricing-hero .eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--primary-color);
    font-weight: 700;
}

.pricing-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin: 1rem 0;
    color: #0f172a;
}

.pricing-hero .subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.hero-tags span {
    background: var(--surface);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.pricing-tabs {
    padding: 1.5rem clamp(1rem, 6vw, 5rem) 0.75rem;
    text-align: center;
}

.pricing-tabs-inner {
    display: inline-flex;
    border: 1px solid rgba(15,23,42,0.12);
    border-radius: 999px;
    padding: 0.25rem;
    background: #fff;
    gap: 0.25rem;
}

.pricing-tab {
    border: none;
    background: transparent;
    border-radius: 999px;
    padding: 0.6rem 1.6rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.pricing-tab.active {
    background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    box-shadow: 0 10px 20px rgba(99,102,241,0.25);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 1rem clamp(1rem, 6vw, 5rem) 3.5rem;
    max-width: none;
    width: 100%;
}

.pricing-card {
    background: #fff;
    border-radius: 22px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(15,23,42,0.08);
    border: 1px solid rgba(15,23,42,0.06);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.pricing-card.featured {
    border: 2px solid transparent;
    background: linear-gradient(#fff, #fff) padding-box,
                linear-gradient(120deg, var(--primary-color), var(--secondary-color)) border-box;
    box-shadow: 0 30px 50px rgba(99,102,241,0.18);
    transform: translateY(-6px);
}

.pricing-card.selected {
    border: 2px solid var(--primary-color);
    box-shadow: 0 30px 60px rgba(99,102,241,0.25);
}

.pricing-card.featured.selected {
    border: 2px solid transparent;
}

.landing-business {
    padding: clamp(3rem, 6vw, 5rem) clamp(1.25rem, 6vw, 5rem) 5rem;
    background: linear-gradient(180deg, #f5f7ff 0%, #fff 45%, #f7f8fb 100%);
    display: flex;
    flex-direction: column;
    gap: clamp(2.5rem, 4vw, 3.5rem);
}

.business-hero {
    background: white;
    border-radius: 32px;
    padding: clamp(2rem, 5vw, 3.5rem);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.08);
}

.hero-pill {
    display: inline-flex;
    padding: 0.35rem 1rem;
    border-radius: 999px;
    background: rgba(99,102,241,0.12);
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.business-hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    margin: 0 0 1rem;
    color: #0f172a;
    line-height: 1.15;
}

.hero-lead {
    color: var(--text-secondary);
    font-size: clamp(1rem, 2vw, 1.2rem);
    line-height: 1.7;
    max-width: 920px;
}

.hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 1.5rem 0 2rem;
}

.hero-tags span {
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-weight: 600;
    font-size: 0.9rem;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.landing-business .btn-outline {
    border-color: rgba(15,23,42,0.2);
    color: #0f172a;
    background: white;
}

.business-section {
    background: white;
    border-radius: 28px;
    padding: clamp(2rem, 4vw, 3rem);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

.business-section header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.section-pill {
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    color: var(--primary-color);
}

.business-section h2 {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    color: #0f172a;
}

.business-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.business-grid.split {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.business-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    padding: 1.75rem;
    background: #fafbff;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.business-card.highlight {
    background: linear-gradient(135deg, #eef2ff, #fdf2ff);
}

.business-card h3 {
    margin: 0;
    color: #0f172a;
    font-size: 1.1rem;
}

.business-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.business-card li {
    position: relative;
    padding-left: 1.25rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.business-card li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.55rem;
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: var(--primary-color);
}

.industry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.industry-grid article {
    border-radius: 16px;
    border: 1px solid rgba(15,23,42,0.09);
    padding: 1.25rem;
    background: #f9fafb;
}

.industry-grid h3 {
    margin: 0 0 0.5rem;
    color: #0f172a;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.metric-card {
    text-align: center;
    padding: 1.5rem;
    border-radius: 18px;
    background: #0f172a;
    color: white;
}

.metric-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.testimonial-grid article {
    border-radius: 20px;
    border: 1px solid rgba(15,23,42,0.1);
    padding: 1.5rem;
    background: #fff7ed;
}

.testimonial-grid p {
    margin: 0 0 1rem;
    color: #0f172a;
    font-size: 1rem;
    line-height: 1.6;
}

.testimonial-grid span {
    font-weight: 600;
    color: #9a3412;
}

.business-section.contact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.contact-intro ul {
    padding-left: 1rem;
    color: var(--text-secondary);
}

.contact-form-wrapper {
    background: #eef2ff;
    border-radius: 24px;
    padding: 1.75rem;
}

.business-contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.business-contact-form .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.business-contact-form label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-weight: 600;
    color: #0f172a;
}

.business-contact-form input,
.business-contact-form textarea {
    border: 1px solid rgba(15,23,42,0.15);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    font-size: 1rem;
}

.business-contact-form textarea {
    resize: vertical;
}

.contact-status {
    margin-top: 1rem;
}

.contact-status.error {
    color: #b91c1c;
}

.contact-status.success {
    color: #15803d;
}

.contact-hint {
    margin-top: 0.75rem;
    font-size: 0.9rem;
    color: #475569;
}

.about-page {
    padding: clamp(3rem, 6vw, 5rem) clamp(1.25rem, 6vw, 5rem) 5rem;
    background: white;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.about-hero {
    background: linear-gradient(135deg, #eef2ff, #fdf2ff);
    border-radius: 32px;
    padding: clamp(2rem, 5vw, 3.5rem);
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.08);
}

.about-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #0f172a;
}

.about-hero h1 {
    margin: 1rem 0 0.75rem;
    font-size: clamp(2rem, 4vw, 3rem);
    color: #0f172a;
}

.about-lead {
    color: #334155;
    font-size: 1.1rem;
    line-height: 1.65;
    max-width: 960px;
}

.about-stats {
    margin-top: 1.75rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.about-stats article {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.about-stats span {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #4c1d95;
}

.about-section {
    background: #f8fafc;
    border-radius: 28px;
    padding: clamp(2rem, 4vw, 3rem);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.about-section header h2 {
    margin: 0.5rem 0 0;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    color: #0f172a;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.about-card {
    background: white;
    border-radius: 18px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    min-height: 180px;
}

.about-card h3 {
    margin: 0 0 0.5rem;
    color: #0f172a;
}

.about-card p {
    margin: 0;
    color: #475569;
    line-height: 1.5;
}

.about-card.compact {
    min-height: auto;
}

.about-section.split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    align-items: stretch;
}

.about-section.split ul {
    padding-left: 1.25rem;
    color: #475569;
    line-height: 1.6;
}

.about-map-placeholder {
    border-radius: 24px;
    border: 2px dashed rgba(15, 23, 42, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    color: #475569;
    background: white;
}

.about-timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.about-timeline article {
    border-left: 4px solid var(--primary-color);
    padding: 1rem 1rem 1rem 1.25rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.about-timeline span {
    font-weight: 700;
    color: var(--primary-color);
}

.about-leadership {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.about-leadership article {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.25rem;
    border-radius: 18px;
    background: white;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.about-leadership .role {
    margin: 0.2rem 0;
    color: #6366f1;
    font-weight: 600;
}

.about-section.callout {
    background: #0f172a;
    color: white;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    align-items: center;
    gap: 2rem;
}

.about-section.callout h2 {
    color: white;
}

.about-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.about-section.callout .btn-outline {
    border-color: rgba(255, 255, 255, 0.6);
    color: white;
}

.blog-page {
    padding: clamp(3rem, 6vw, 5rem) clamp(1.25rem, 6vw, 5rem) 4rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    background: #fff;
}

.blog-hero {
    background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(56,189,248,0.08));
    border-radius: 28px;
    padding: clamp(2rem, 4vw, 3rem);
    border: 1px solid rgba(99, 102, 241, 0.15);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

.blog-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: rgba(99,102,241,0.12);
    color: #4338ca;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.blog-hero h1 {
    margin: 1rem 0 0.5rem;
    font-size: clamp(2rem, 4vw, 2.8rem);
    color: #0f172a;
}

.blog-hero p {
    margin: 0;
    color: #334155;
    font-size: 1.05rem;
    line-height: 1.7;
    max-width: 900px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.blog-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    padding: 1.75rem;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.blog-card-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.blog-card h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.35rem;
}

.blog-card p {
    color: #475569;
    line-height: 1.6;
    margin: 0;
}

.blog-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.blog-card-tags span {
    padding: 0.35rem 0.85rem;
    background: #eef2ff;
    border-radius: 999px;
    font-size: 0.85rem;
    color: #4338ca;
    font-weight: 600;
}

.blog-card-link {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    color: #4338ca;
    text-decoration: none;
}

.blog-card-link::after {
    content: '→';
    font-size: 1rem;
}

.blog-empty {
    text-align: center;
    padding: 2rem;
    border-radius: 20px;
    border: 1px dashed rgba(15, 23, 42, 0.2);
    color: #475569;
}

.blog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.blog-page-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.blog-page-btn,
.blog-nav-btn {
    border: 1px solid rgba(15,23,42,0.2);
    background: white;
    border-radius: 10px;
    padding: 0.6rem 1rem;
    cursor: pointer;
    font-weight: 600;
    color: #0f172a;
    transition: all 0.2s ease;
}

.blog-page-btn.active,
.blog-page-btn:hover,
.blog-nav-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.blog-nav-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

.blog-post {
    padding: clamp(3rem, 6vw, 5rem) clamp(1.25rem, 6vw, 5rem);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: white;
}

.blog-post-header h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    color: #0f172a;
    margin: 0.5rem 0 0;
}

.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #475569;
    flex-wrap: wrap;
}

.blog-post-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    font-size: 1.05rem;
    line-height: 1.75;
    color: #334155;
    max-width: 900px;
}

.blog-post-body h3 {
    margin: 1.5rem 0 0.5rem;
    color: #0f172a;
}

.blog-post-body ul {
    padding-left: 1.25rem;
    margin: 0;
    color: #475569;
}

.blog-post-footer {
    margin-top: 1rem;
}
.payment-plan-grid {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    width: 100%;
    padding: 0;
}

.payment-plan-grid .pricing-card {
    height: 100%;
}

.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.plan-badge {
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    font-size: 0.75rem;
    color: var(--primary-color);
}

.plan-tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    background: var(--primary-color);
    border-radius: 999px;
    padding: 0.2rem 0.85rem;
}

.plan-price {
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
}

.plan-price .price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
}

.plan-frequency {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1rem;
}

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

.pricing-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;
}

.pricing-card li {
    margin-bottom: 0.6rem;
    color: var(--text-secondary);
    display: flex;
    gap: 0.5rem;
}

.pricing-card li::before {
    content: '•';
    color: var(--primary-color);
}

.btn-outline {
    border: 1px solid rgba(15,23,42,0.2);
    background: transparent;
    padding: 0.85rem 1.25rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.pricing-benefits {
    padding: 0 clamp(1rem, 6vw, 5rem) 3.5rem;
}

.benefit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    max-width: none;
    width: 100%;
}

.benefit-card {
    background: var(--surface);
    border-radius: 18px;
    padding: 1.5rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.benefit-card h4 {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
}

.benefit-card p {
    margin: 0;
    color: var(--text-secondary);
}

.pricing-faq {
    padding: 0 clamp(1rem, 6vw, 5rem) 4rem;
}

.pricing-faq-card {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem;
    background: #fff;
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 25px 60px rgba(15,23,42,0.08);
}

.pricing-faq-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.pricing-faq-card .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 200px;
}

@media (max-width: 768px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }
    
    .pricing-tabs-inner {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .pricing-hero-content {
        padding: 2rem 1.5rem;
    }
    
    .hero-tags {
        flex-direction: column;
    }
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Navbar on light background (home page) */
body[data-home="true"] .navbar {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.navbar-brand:hover {
    opacity: 0.8;
}

.navbar-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-item {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: var(--transition);
}

.nav-item:hover::after,
.nav-item.active::after {
    width: 100%;
}

.nav-item:hover,
.nav-item.active {
    color: var(--primary-color);
}

.nav-item.nav-cta,
.navbar-dropdown-toggle.nav-cta {
    padding: 0.6rem 1.4rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.25);
    border: none;
}

.nav-item.nav-cta:hover,
.navbar-dropdown-toggle.nav-cta:hover,
.navbar-dropdown.active .navbar-dropdown-toggle.nav-cta {
    transform: translateY(-1px);
    color: #ffffff;
    box-shadow: 0 18px 30px rgba(99, 102, 241, 0.28);
}

.navbar-dropdown-toggle.nav-cta::after {
    display: none;
}

.navbar-dropdown-toggle.nav-cta::before {
    color: rgba(255, 255, 255, 0.85);
}

/* Navbar Dropdown */
.navbar-dropdown {
    position: relative;
    display: inline-block;
}

.navbar-dropdown-toggle {
    background: none;
    border: none;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    padding: 0.5rem 0;
    font-size: inherit;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.navbar-dropdown-toggle::before {
    content: '▼';
    font-size: 0.7em;
    opacity: 0.7;
    margin-left: 0.25rem;
}

.navbar-dropdown-toggle::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: var(--transition);
}

.navbar-dropdown-toggle:hover::after,
.navbar-dropdown.active .navbar-dropdown-toggle::after {
    width: 100%;
}

.navbar-dropdown-toggle:hover,
.navbar-dropdown.active .navbar-dropdown-toggle {
    color: var(--primary-color);
}

.navbar-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.navbar-dropdown-menu.show {
    display: block;
}

/* Dropdown in navbar-left should align to the left */
.navbar-left .navbar-dropdown-menu {
    left: 0;
    right: auto;
}

.navbar-dropdown-item {
    display: block;
    padding: 0.75rem 1.25rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.95rem;
    border: none;
    width: 100%;
    text-align: left;
}

.navbar-dropdown-item:hover {
    background: var(--surface-hover);
    color: var(--primary-color);
}

.navbar-dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

/* Language Selector */
.lang-selector {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--surface-hover);
    border-radius: 20px;
    padding: 0.25rem;
}

.lang-btn {
    padding: 0.4rem 0.8rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--surface-hover);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 0.5rem;
}

.theme-toggle:hover {
    background: var(--primary-color);
    color: white;
}

.theme-toggle .theme-icon {
    transition: all 0.3s ease;
}

.theme-toggle .theme-icon.moon {
    display: none;
}

.theme-toggle .theme-icon.sun {
    display: block;
    color: #f59e0b;
}

[data-theme="dark"] .theme-toggle .theme-icon.moon {
    display: block;
    color: #a78bfa;
}

[data-theme="dark"] .theme-toggle .theme-icon.sun {
    display: none;
}

.lang-btn:hover {
    color: var(--text-primary);
}

.lang-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Mobile Menu Hamburger Button - Hidden on Desktop */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 2rem;
    height: 2rem;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 2rem;
    height: 0.2rem;
    background: var(--text-primary);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.mobile-menu-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Mobile Menu Container */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 320px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow-y: auto;
    transition: right 0.3s ease;
    padding: 5rem 0 2rem;
}

.mobile-menu.show {
    right: 0;
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 1.5rem;
}

.mobile-menu-section {
    margin-bottom: 1.5rem;
}

.mobile-menu-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
}

.mobile-menu-item {
    display: block;
    padding: 0.875rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.mobile-menu-item:hover,
.mobile-menu-item.active {
    background: var(--surface-hover);
    color: var(--primary-color);
}

.mobile-menu-item.mobile-cta {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    text-align: center;
    font-weight: 600;
    margin-top: 1rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.mobile-menu-item.mobile-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
    color: white;
}

.mobile-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 1rem 0;
}

/* Language selector in mobile menu */
.mobile-menu-content .lang-selector {
    justify-content: center;
    width: 100%;
}

/* Billing Page Styles */
.billing-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.billing-stat-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    text-align: center;
}

.billing-stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.billing-stat-label {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    opacity: 0.95;
}

.billing-stat-description {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 0.5rem;
}

/* Payment Page Styles */
.payment-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.payment-plan-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.payment-plan-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.15);
    transform: translateY(-2px);
}

.payment-plan-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #f0f2ff 0%, #faf5ff 100%);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.2);
}

.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.plan-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.plan-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.plan-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.plan-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.plan-badge.featured {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.custom-plan {
    border-style: dashed;
}

.custom-input-group {
    margin-top: 1rem;
}

.custom-input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.payment-widget {
    margin-top: 2rem;
    padding: 2rem;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.payment-summary {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.payment-summary h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    color: var(--text-secondary);
}

.summary-item.total {
    border-top: 2px solid var(--border-color);
    margin-top: 0.5rem;
    padding-top: 1rem;
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.summary-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.test-payment-box {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    border: 2px dashed var(--border-color);
}

.test-payment-box h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.test-card-info {
    margin: 1.5rem 0;
}

.test-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.test-card-number {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    font-family: 'Monaco', 'Menlo', monospace;
}

.test-card-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    opacity: 0.9;
}

.cloudpayments-box {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.cloudpayments-box h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.btn-large {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    margin-top: 1rem;
}

/* Transactions Table Styles */
.transactions-table {
    overflow-x: auto;
    margin-top: 1rem;
}

.transactions-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
}

.transactions-table thead {
    background: var(--surface);
}

.transactions-table tbody tr {
    transition: background-color 0.2s ease;
}

.transactions-table tbody tr:hover {
    background: var(--surface);
}

.transactions-table tbody tr:last-child {
    border-bottom: none;
}

@media (max-width: 768px) {
    .transactions-table {
        font-size: 0.9rem;
    }
    
    .transactions-table th,
    .transactions-table td {
        padding: 0.5rem !important;
    }
    
    .transactions-table th:nth-child(1),
    .transactions-table td:nth-child(1) {
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Buttons */
.btn {
    padding: 0.75rem 1.75rem;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    box-shadow: var(--shadow);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

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

.btn-secondary {
    background: var(--surface);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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

.nav-cta {
    padding: 0.6rem 1.4rem;
    font-size: 0.95rem;
    border-radius: 999px;
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 30px rgba(99, 102, 241, 0.28);
}

/* Container */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem 3rem;
    overflow-x: visible;
}

/* Full-width container for admin pages */
/* Default: keep max-width for regular pages - handled by specific selectors below */

/* Admin pages - full width */
#page-content .container:has(.admin-stats-grid),
#page-content .container:has(.admin-table-container),
#page-content .container:has(.admin-nav-menu) {
    max-width: 100%;
    padding: 2rem 1.5rem;
}

/* Fallback for browsers that don't support :has() */
body[data-admin="true"] .container,
.admin-container {
    max-width: 100%;
    padding: 2rem 1.5rem;
    width: 100%;
}

/* Ensure main-content doesn't limit admin pages */
body[data-admin="true"] .main-content {
    padding: 0;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

.upload-header-layout {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.upload-language-selector {
    min-width: 200px;
    flex-shrink: 0;
    margin-top: 0.25rem;
}

.upload-language-selector .form-check-select {
    margin-bottom: 0;
    padding: 0.5rem;
}

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

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--surface);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 10px;
    transition: var(--transition);
    cursor: pointer;
}

.form-check:hover {
    background: var(--surface-hover);
}

.form-check input[type="checkbox"] {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.form-check label {
    cursor: pointer;
    font-weight: 500;
}

/* Form check select - styled like checkboxes */
.form-check-select {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 10px;
    transition: var(--transition);
}

.form-check-select:hover {
    background: var(--surface-hover);
}

.form-check-label {
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 1rem;
}

.form-check-select-control {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
    background: var(--surface);
    font-family: inherit;
    cursor: pointer;
    color: var(--text-primary);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236366f1' d='M6 9L1 4l1.414-1.414L6 6.172l3.586-3.586L11 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.form-check-select-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-check-select-control:hover {
    border-color: var(--primary-color);
}

/* Upload Area */
.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: 20px;
    padding: 4rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
    position: relative;
    overflow: hidden;
}

.upload-area::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transform: rotate(45deg);
    transition: var(--transition);
    opacity: 0;
}

.upload-area:hover::before {
    opacity: 1;
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -50%; }
    100% { left: 150%; }
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, #f0e9ff 0%, #e9d5ff 100%);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.upload-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 4px 6px rgba(99, 102, 241, 0.2));
}

.upload-text {
    font-size: 1.25rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

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

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

.badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

.badge-queued {
    background: #dbeafe;
    color: #1e40af;
}

.badge-queued::before {
    background: #3b82f6;
}

.badge-running {
    background: #fef3c7;
    color: #92400e;
}

.badge-running::before {
    background: #f59e0b;
}

.badge-succeeded {
    background: #d1fae5;
    color: #065f46;
}

.badge-succeeded::before {
    background: #10b981;
}

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

.badge-failed::before {
    background: #ef4444;
}

.badge-canceled {
    background: #f3e8ff;
    color: #6b21a8;
}

.badge-canceled::before {
    background: #8b5cf6;
}

.badge-language {
    background: #e2e8f0;
    color: #475569;
}

.badge-language::before {
    display: none;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* Tables */
/* Table wrapper for responsive scrolling */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
    position: relative;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 600px; /* Minimum width to prevent too much compression */
    display: table;
}

.table th,
.table td {
    padding: 1.25rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--surface-hover);
    font-weight: 600;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: var(--surface-hover);
    transform: translateX(4px);
}

.table tbody tr:hover .btn-link {
    color: var(--primary-color);
}

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

.stat-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-value {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.stat-label {
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
}

/* Loading Spinner */
.spinner {
    border: 4px solid #f3f4f6;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alerts */
.alert {
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
}

.alert-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-left: 4px solid var(--error-color);
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
    margin: 0 0.75rem;
}

.google-signin-container {
    display: flex;
    justify-content: center;
    width: 100%;
}

.google-signin-container > div {
    width: 100%;
    max-width: 320px;
    display: flex;
    justify-content: center;
}

.google-signin-placeholder,
.google-signin-error {
    font-size: 0.9rem;
    color: #6b7280;
    text-align: center;
    width: 100%;
}

.google-signin-error {
    color: #dc2626;
}

.auth-section {
    min-height: calc(80vh - 64px);
    padding: 3.75rem 1.25rem;
    background: radial-gradient(circle at top left, rgba(99, 102, 241, 0.08), transparent 45%),
                radial-gradient(circle at bottom right, rgba(139, 92, 246, 0.08), transparent 40%),
                #f6f8ff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-grid {
    width: 100%;
    max-width: 1100px;
    display: grid;
    grid-template-columns: minmax(0, 48%) minmax(0, 1fr);
    gap: 2.4rem;
    align-items: stretch;
}

.auth-preview {
    background: linear-gradient(150deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 58, 138, 0.85) 60%, rgba(14, 165, 233, 0.85) 100%);
    color: #f8fbff;
    border-radius: 28px;
    padding: 2.4rem;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.35);
    position: relative;
    overflow: hidden;
}

.auth-preview::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.06), transparent 55%),
                radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.05), transparent 40%);
    pointer-events: none;
}

.auth-preview-register {
    background: linear-gradient(160deg, rgba(67, 56, 202, 0.95) 0%, rgba(124, 58, 237, 0.9) 55%, rgba(244, 114, 182, 0.85) 100%);
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    color: #e0e7ff;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
}

.auth-preview h1 {
    font-size: 2.4rem;
    line-height: 1.2;
    margin: 1.2rem 0 0.8rem;
}

.auth-lead {
    font-size: 1.05rem;
    line-height: 1.5;
    color: rgba(241, 245, 249, 0.95);
    max-width: 32rem;
}

.auth-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.4rem;
    margin: 1.05rem 0;
}

.auth-stat {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.auth-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
}

.auth-stat-label {
    font-size: 0.85rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.auth-trust {
    margin-top: 0.67rem;
}

.auth-trust h2,
.auth-highlight h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.38rem;
}

.auth-trust ul,
.auth-highlight ul {
    margin: 0;
    padding-left: 1.25rem;
    display: grid;
    gap: 0.19rem;
    line-height: 1.28;
    color: rgba(226, 232, 240, 0.9);
}

.auth-quote {
    margin-top: 1.24rem;
    padding: 1.14rem;
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.18);
    font-style: italic;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.auth-quote.alt {
    background: rgba(67, 56, 202, 0.35);
}

.auth-quote span {
    font-style: normal;
    font-size: 0.9rem;
    opacity: 0.8;
}

.auth-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 1.8rem 1.66rem;
    box-shadow: 0 25px 45px rgba(15, 23, 42, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.18);
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
}

.auth-card-header h2 {
    font-size: 2rem;
    margin: 0 0 0.38rem;
    color: var(--text-primary);
}

.auth-card-header p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.4;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.62rem;
}

.auth-form label {
    font-weight: 600;
    color: var(--text-secondary);
}

.auth-form .form-control {
    border: 1px solid rgba(148, 163, 184, 0.5);
    border-radius: 12px;
    padding: 0.67rem 0.76rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-form .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.18);
}

.auth-form-helper {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 0.17rem;
}

.auth-form-helper span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 0.67rem;
    font-size: 1rem;
    border-radius: 12px;
}

.auth-footer {
    text-align: center;
    display: grid;
    gap: 0.35rem;
    font-size: 0.95rem;
}

.auth-footer .btn-link {
    font-weight: 600;
}

.auth-footer .btn-link.subtle {
    font-weight: 500;
    color: var(--text-secondary);
}

.auth-pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1.05rem 0;
}

.auth-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #f1f5f9;
    font-size: 0.85rem;
    font-weight: 600;
}

.auth-highlight {
    margin-top: 0.67rem;
}

.auth-policies {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.38rem;
    line-height: 1.43;
}

.auth-policies a {
    color: var(--primary-color);
    text-decoration: underline;
}

.auth-section--tight {
    min-height: auto;
    padding-block: 2.4rem;
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border-left: 4px solid var(--info-color);
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 100px;
    position: relative;
    overflow: hidden;
}

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

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

/* Results */
/* Results page - wider container */
.results-container {
    max-width: 1600px;
    padding: 2rem 3rem;
}

#page-content .container:has(.output-box) {
    max-width: 1600px;
    padding: 2rem 3rem;
}

.output-box {
    background: var(--surface);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.output-box:hover {
    box-shadow: var(--shadow-md);
}

.output-box h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.output-icon-modern {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    flex-shrink: 0;
}

.output-content {
    background: linear-gradient(135deg, #fafbff 0%, #f8f9ff 100%);
    border-radius: 12px;
    padding: 0.5rem;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.4;
    border: 1px solid var(--border-color);
}

/* Specific styling for scene descriptions container */
#sceneDescription {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Scene box (segment) - clean minimal styles */
.segment {
    margin: 0 0 10px 0;
    padding: 6px 8px;
    background: var(--surface);
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
    box-sizing: border-box;
}

.segment:last-child {
    margin-bottom: 0;
}

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

/* Scene title */
.segment-header {
    margin: 0 0 4px 0;
    padding: 0;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.875rem;
    line-height: 1.1;
}

/* Scene description */
.segment > div:not(.segment-header) {
    margin: 0;
    padding: 0;
    font-size: 0.9rem;
    line-height: 1.3;
    color: var(--text-primary);
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.metadata-item {
    padding: 1.25rem;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.metadata-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.metadata-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.metadata-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Utility Classes */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.btn-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

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

.btn-link:hover::after {
    width: 100%;
}

.hidden { 
    display: none !important; 
}

.file-info {
    padding: 1rem 1.5rem;
    background: var(--surface-hover);
    border-radius: 12px;
    margin-top: 1rem;
    border: 1px solid var(--border-color);
}

.file-info.visible {
    display: block;
}

.options-section {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.option-group {
    flex: 1;
    min-width: 200px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding: 1.5rem;
    }
    
    .results-container {
        max-width: 100%;
        padding: 1.5rem;
    }
    
    .api-docs-container {
        max-width: 100%;
        padding: 1.5rem;
    }
    
    .card {
        padding: 2rem;
    }

    .auth-grid {
        grid-template-columns: 1fr;
        max-width: 720px;
    }

    .auth-preview {
        padding: 2.5rem;
        border-radius: 24px;
    }

    .auth-card {
        padding: 2.25rem 1.9rem;
        border-radius: 24px;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 1rem;
        overflow-x: visible;
    }
    
    .results-container {
        padding: 1rem;
        overflow-x: visible;
    }
    
    .api-docs-container {
        padding: 1rem;
        overflow-x: visible;
    }
    
    .card {
        overflow: visible;
    }
    
    /* Mobile Navigation */
    .navbar {
        padding: 1rem 1.5rem;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .navbar-brand {
        font-size: 1.5rem;
    }
    
    /* Hide desktop navigation on mobile */
    .navbar-left,
    .navbar-nav {
        display: none !important;
    }
    
    /* Show mobile menu toggle button */
    .mobile-menu-toggle {
        display: flex;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .card-title {
        font-size: 1.5rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
    
    .metadata-grid {
        grid-template-columns: 1fr;
    }
    
    .options-section > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    .upload-header-layout {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .upload-language-selector {
        min-width: auto;
        width: 100%;
    }
    
    .navbar-dropdown-menu {
        right: auto;
        left: 0;
        min-width: 180px;
    }
    
    .billing-stats {
        grid-template-columns: 1fr;
    }
    
    .card {
        overflow: visible;
        position: relative;
    }
    
    .table-wrapper {
        margin: 1rem -2rem;
        padding: 0 1rem;
        width: calc(100% + 4rem);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        font-size: 0.9rem;
        min-width: 500px;
        table-layout: fixed;
        width: 100%;
    }
    
    .table th:first-child,
    .table td:first-child {
        width: 60%;
    }
    
    .table th.date-cell,
    .table td.date-cell {
        width: 40%;
    }
    
    .table th,
    .table td {
        padding: 0.75rem 0.5rem;
    }
    
    .table th:first-child,
    .table td:first-child {
        position: sticky;
        left: 0;
        background: var(--surface);
        z-index: 5;
        box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
    }
    
    .table th:first-child {
        background: var(--surface-hover);
        z-index: 15;
    }
    
    /* Hide all columns except filename and date on mobile */
    .table th.language-cell,
    .table td.language-cell,
    .table th.status-cell,
    .table td.status-cell,
    .table th.action-cell,
    .table td.action-cell {
        display: none;
    }
    
    /* Style filename as rounded box with status color (matching badge design) */
    .filename-cell {
        padding: 0.5rem 0 !important;
    }
    
    .filename-link-mobile {
        display: inline-flex;
        align-items: center;
        padding: 0.5rem 1rem;
        border-radius: 100px;
        font-weight: 600;
        font-size: 0.85rem;
        text-decoration: none;
        color: #000000;
        transition: all 0.2s ease;
        width: 100%;
        box-sizing: border-box;
        cursor: pointer;
        text-transform: none;
    }
    
    .filename-link-mobile:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .filename-link-mobile:active {
        transform: translateY(0);
    }
    
    .filename-link-disabled {
        cursor: not-allowed;
        opacity: 0.8;
    }
    
    .filename-link-disabled:hover {
        transform: none;
        box-shadow: none;
    }
    
    /* Status colors for filename boxes (matching badge colors) */
    .filename-cell[data-status="succeeded"] .filename-link-mobile {
        background: #d1fae5;
        color: #000000;
    }
    
    .filename-cell[data-status="failed"] .filename-link-mobile {
        background: #fee2e2;
        color: #000000;
    }
    
    .filename-cell[data-status="queued"] .filename-link-mobile {
        background: #dbeafe;
        color: #000000;
    }
    
    .filename-cell[data-status="running"] .filename-link-mobile {
        background: #fef3c7;
        color: #000000;
    }
    
    .filename-cell[data-status="canceled"] .filename-link-mobile {
        background: #f3e8ff;
        color: #000000;
    }
    
    /* Ensure date cell is visible */
    .table th.date-cell,
    .table td.date-cell {
        display: table-cell;
    }
}

/* Desktop: filename links should be normal text with black color */
.filename-link-mobile {
    color: #000000;
    text-decoration: none;
    display: inline;
    padding: 0;
    border-radius: 0;
    width: auto;
    background: transparent;
    font-weight: inherit;
}

.filename-link-mobile:hover {
    text-decoration: underline;
    transform: none;
    box-shadow: none;
}

@media (max-width: 480px) {
    .main-content {
        padding: 1rem 0.5rem;
    }
    
    .card {
        padding: 1.5rem 0.5rem;
        overflow: visible;
        position: relative;
    }
    
    .table-wrapper {
        margin: 1rem -0.5rem;
        padding: 0 0.5rem;
        width: calc(100% + 1rem);
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table {
        min-width: 450px;
        font-size: 0.85rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
    }
    
    /* Hide all columns except filename and date on mobile */
    .table th.language-cell,
    .table td.language-cell,
    .table th.status-cell,
    .table td.status-cell,
    .table th.action-cell,
    .table td.action-cell {
        display: none;
    }
    
    /* Style filename as rounded box with status color (matching badge design) */
    .filename-cell {
        padding: 0.5rem 0 !important;
    }
    
    .filename-link-mobile {
        display: inline-flex;
        align-items: center;
        padding: 0.5rem 1rem;
        border-radius: 100px;
        font-weight: 600;
        font-size: 0.85rem;
        text-decoration: none;
        color: #000000;
        transition: all 0.2s ease;
        width: 100%;
        box-sizing: border-box;
        cursor: pointer;
        text-transform: none;
    }
    
    .filename-link-mobile:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .filename-link-mobile:active {
        transform: translateY(0);
    }
    
    .filename-link-disabled {
        cursor: not-allowed;
        opacity: 0.8;
    }
    
    .filename-link-disabled:hover {
        transform: none;
        box-shadow: none;
    }
    
    /* Status colors for filename boxes (matching badge colors) */
    .filename-cell[data-status="succeeded"] .filename-link-mobile {
        background: #d1fae5;
        color: #000000;
    }
    
    .filename-cell[data-status="failed"] .filename-link-mobile {
        background: #fee2e2;
        color: #000000;
    }
    
    .filename-cell[data-status="queued"] .filename-link-mobile {
        background: #dbeafe;
        color: #000000;
    }
    
    .filename-cell[data-status="running"] .filename-link-mobile {
        background: #fef3c7;
        color: #000000;
    }
    
    .filename-cell[data-status="canceled"] .filename-link-mobile {
        background: #f3e8ff;
        color: #000000;
    }
    
    /* Ensure date cell is visible */
    .table th.date-cell,
    .table td.date-cell {
        display: table-cell;
    }
    
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-value {
        font-size: 2.5rem;
    }
}

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

/* Selection colors */
::selection {
    background: var(--primary-color);
    color: white;
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    .navbar {
        display: none;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Modern Landing Page Styles */
.modern-hero {
    position: relative;
    padding: 8rem 0 6rem;
    overflow: hidden;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    margin-bottom: 0;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    z-index: 0;
}

.hero-gradient {
    position: absolute;
    top: -50%;
    left: 50%;
    transform: translateX(-50%);
    width: 1200px;
    height: 800px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: rgba(99, 102, 241, 0.15);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: rgba(139, 92, 246, 0.15);
    bottom: -150px;
    right: -150px;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
}

.hero-content-modern {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

.hero-title-modern {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.hero-subtitle-modern {
    font-size: clamp(1.125rem, 2vw, 1.25rem);
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-cta-modern {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 4rem;
}

.btn-modern {
    padding: 0.875rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid transparent;
}

.btn-primary-modern {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

.btn-primary-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    background: var(--primary-dark);
}

.btn-secondary-modern {
    background: white;
    color: var(--text-primary);
    border-color: var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.btn-secondary-modern:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-large-modern {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

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

/* Section Header */
.section-header-modern {
    text-align: center;
    margin-bottom: 4rem;
}

.section-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.section-title-modern {
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Features Section */
.features-section-modern {
    padding: 6rem 0;
    background: white;
}

.features-grid-modern {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 2rem;
}

.feature-card-modern {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.feature-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.feature-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.feature-card-modern:hover::before {
    transform: scaleX(1);
}

.feature-icon-modern {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.feature-card-modern:hover .feature-icon-modern,
.use-case-modern:hover .feature-icon-modern,
.segment-card-modern:hover .feature-icon-modern,
.metric-card-modern:hover .feature-icon-modern {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.feature-card-modern h3 {
    font-size: 1.375rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.feature-card-modern p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* How It Works */
.how-it-works-modern {
    padding: 6rem 0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.steps-modern {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.step-modern {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.step-modern:hover {
    transform: translateX(8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.step-number-modern {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-color);
    min-width: 80px;
    opacity: 0.3;
}

.step-content {
    flex: 1;
}

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

.step-content p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.step-arrow {
    font-size: 2rem;
    color: var(--primary-color);
    opacity: 0.3;
}

.step-modern:last-child .step-arrow {
    display: none;
}

/* Use Cases */
.use-cases-modern {
    padding: 6rem 0;
    background: white;
}

.use-cases-grid-modern {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 1.5rem;
}

.use-case-modern {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(139, 92, 246, 0.03) 100%);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.use-case-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
}


.use-case-modern h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.use-case-modern p {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
}

/* CTA Section */
.cta-modern {
    padding: 6rem 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border-top: 1px solid var(--border-color);
}

.cta-content-modern {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.cta-content-modern h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

/* Target Segments Section */
.target-segments-modern {
    padding: 6rem 0;
    background: #f8f9fa;
}

.segments-grid-modern {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 2rem;
}

.segment-card-modern {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.segment-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.segment-header-modern {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}


.segment-header-modern h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.segment-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
}

.segment-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.segment-why,
.segment-users,
.segment-features {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.segment-why h4,
.segment-users h4,
.segment-features h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.segment-why p,
.segment-users p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.segment-features ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.segment-features li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    padding-left: 1.5rem;
    position: relative;
}

.segment-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 700;
}

/* Buyer Personas Section */
.buyer-personas-modern {
    padding: 6rem 0;
    background: white;
}

.personas-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.persona-card-modern {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.persona-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
}

.persona-card-modern h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.persona-card-modern p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Success Metrics Section */
.success-metrics-modern {
    padding: 6rem 0;
    background: #f8f9fa;
}

.metrics-grid-modern {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 2rem;
}

.metric-card-modern {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.metric-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}


.metric-card-modern h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.metric-card-modern p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

.faq-modern {
    padding: 6rem 0;
    background: #ffffff;
}

.faq-list-modern {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: flex-start;
}

.faq-item-modern {
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 1.5rem 1.75rem;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.faq-item-modern[open] {
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 18px 32px rgba(99, 102, 241, 0.18);
    transform: translateY(-2px);
}

.faq-item-modern summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
}

.faq-item-modern summary::-webkit-details-marker {
    display: none;
}

.faq-item-modern h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.faq-item-modern[open] .faq-icon {
    transform: rotate(45deg);
}

.faq-item-modern p {
    margin-top: 1rem;
    font-size: 0.98rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.faq-item-modern p strong {
    color: var(--text-primary);
}

.seo-fallback {
    padding: 6rem 0 4rem;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.03) 0%, rgba(255, 255, 255, 1) 100%);
}

.seo-fallback .container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.seo-fallback-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}

.seo-fallback h1 {
    font-size: 2.75rem;
    line-height: 1.2;
    margin-top: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.seo-fallback-lead {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-secondary);
    max-width: 760px;
    margin-bottom: 2.25rem;
}

.seo-fallback-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
}

.btn-tertiary-modern {
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: white;
    color: var(--text-secondary);
}

.btn-tertiary-modern:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.seo-fallback-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.seo-fallback-grid article {
    background: white;
    border-radius: 16px;
    border: 1px solid rgba(203, 213, 225, 0.6);
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

.seo-fallback-grid h2 {
    font-size: 1.45rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.seo-fallback-grid ul {
    list-style: disc;
    margin-left: 1.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.98rem;
}

.seo-fallback-meta {
    background: rgba(99, 102, 241, 0.08);
    border-radius: 18px;
    padding: 2rem;
}

.seo-fallback-meta h2 {
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.seo-fallback-meta p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.seo-fallback-meta a {
    color: var(--primary-color);
    text-decoration: underline;
}

.seo-fallback-meta a:hover {
    color: var(--primary-dark);
}

.social-share-modern {
    padding: 6rem 0;
    background: #f8fafc;
}

.social-share-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.social-share-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.75rem;
    border-radius: 16px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
    color: var(--text-primary);
    background: white;
    border: 1px solid rgba(203, 213, 225, 0.6);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

.social-share-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 36px rgba(99, 102, 241, 0.22);
}

.social-share-card .social-icon {
    font-size: 1.75rem;
    font-weight: 700;
}

.social-share-card.linkedin {
    color: #0a66c2;
    border-color: rgba(10, 102, 194, 0.25);
}

.social-share-card.twitter {
    color: #111827;
    border-color: rgba(17, 24, 39, 0.25);
}

.social-share-card.facebook {
    color: #1877f2;
    border-color: rgba(24, 119, 242, 0.25);
}

.social-share-card.email {
    color: var(--text-secondary);
}

.cta-content-modern p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Landing Page Responsive */
@media (max-width: 1024px) {
    .steps-modern {
        gap: 1.5rem;
    }
    
    .step-modern {
        flex-direction: column;
        text-align: center;
    }
    
    .step-arrow {
        transform: rotate(90deg);
    }
    
    .hero-stats {
        gap: 2rem;
    }
    
    .use-cases-grid-modern {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .segments-grid-modern {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .personas-grid-modern {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .metrics-grid-modern {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }

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

    .seo-fallback-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .modern-hero {
        padding: 5rem 0 4rem;
    }
    
    .hero-title-modern {
        font-size: 2.5rem;
    }
    
    .hero-subtitle-modern {
        font-size: 1.125rem;
    }
    
    .section-title-modern {
        font-size: 2rem;
    }
    
    .features-grid-modern,
    .use-cases-grid-modern,
    .segments-grid-modern,
    .personas-grid-modern,
    .metrics-grid-modern {
        grid-template-columns: 1fr;
    }
    
    .hero-cta-modern {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn-modern {
        width: 100%;
        justify-content: center;
    }
    
    .segment-card-modern {
        padding: 1.5rem;
    }
    
    .persona-card-modern {
        padding: 1.5rem;
    }
    
    .metric-card-modern {
        padding: 1.5rem;
    }

    .faq-item-modern {
        padding: 1.25rem 1.5rem;
    }

    .seo-fallback h1 {
        font-size: 2.2rem;
    }

    .seo-fallback-links {
        flex-direction: column;
        align-items: stretch;
    }

    .seo-fallback-grid article {
        padding: 1.5rem;
    }
    
    .hero-stats {
        gap: 2rem;
        padding-top: 2rem;
    }
    
    .step-number-modern {
        min-width: 60px;
        font-size: 1.5rem;
    }

    .auth-section {
        padding: 3rem 1rem 4rem;
    }

    .auth-preview {
        order: 2;
    }

    .auth-card {
        padding: 2rem 1.6rem;
        order: 1;
    }

    .auth-preview h1 {
        font-size: 2rem;
    }

    .auth-stats {
        gap: 1.5rem;
    }

    .auth-pill-group {
        gap: 0.45rem;
    }

    .btn-full {
        padding: 0.9rem;
    }
}

/* OpenAPI/Swagger Style API Documentation */
.api-docs-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem 3rem;
}

/* API Header */
.api-header {
    background: var(--surface);
    color: var(--text-primary);
    border-radius: 16px;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
}

.api-header-content {
    max-width: 800px;
}

.api-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.api-description {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin: 0 0 1.5rem 0;
}

.api-meta {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.api-version {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
}

.api-base-url code {
    background: var(--surface-hover);
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* API Sections */
.api-section {
    background: var(--surface);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: var(--transition);
}

.api-section:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.api-section-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.api-server-info {
    display: grid;
    gap: 1rem;
}

.server-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.server-item code {
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.95rem;
}

/* Security Scheme */
.api-security-scheme {
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.security-type {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.security-badge {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
}

.token-display {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.token-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.token-value {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.token-value code {
    flex: 1;
    padding: 0.75rem;
    background: #f0f2ff;
    border-radius: 6px;
    font-size: 0.85rem;
    word-break: break-all;
    color: var(--primary-color);
}

.token-usage {
    padding: 0.75rem;
    background: #1e1e1e;
    border-radius: 6px;
    margin-top: 1rem;
}

.token-usage code {
    color: #a0a0a0;
    font-size: 0.9rem;
}

.security-warning {
    margin-top: 1rem;
    padding: 1rem;
    background: #fff3cd;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    color: #856404;
}

/* API Tags */
.api-tag {
    margin-bottom: 3rem;
}

.api-tag-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.api-tag-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

/* Endpoint Cards */
.endpoint-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
    transition: all 0.2s ease;
}

.endpoint-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.endpoint-header-main {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    cursor: pointer;
    background: #fafafa;
    transition: background 0.2s ease;
}

.endpoint-header-main:hover {
    background: #f0f0f0;
}

.endpoint-method-path {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    flex: 1;
}

.method-badge {
    padding: 0.35rem 0.85rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 60px;
    text-align: center;
}

.method-get { background: #10b981; color: white; }
.method-post { background: #3b82f6; color: white; }
.method-put { background: #f59e0b; color: white; }
.method-delete { background: #ef4444; color: white; }
.method-patch { background: #8b5cf6; color: white; }

.endpoint-path {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

.security-indicator {
    font-size: 0.9rem;
    opacity: 0.7;
}

.endpoint-summary {
    flex: 1;
    color: var(--text-primary);
    font-weight: 500;
    margin-left: 1rem;
}

.endpoint-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    transition: transform 0.2s ease;
}

.endpoint-content {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: white;
}

.endpoint-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.endpoint-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.endpoint-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.endpoint-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
    color: var(--text-primary);
}

/* Parameters Table */
.parameters-table {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.parameter-row {
    display: grid;
    grid-template-columns: 200px 1fr;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem;
    background: white;
}

.parameter-row:last-child {
    border-bottom: none;
}

.parameter-row:hover {
    background: #fafafa;
}

.parameter-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.parameter-name code {
    font-size: 0.95rem;
    color: var(--primary-color);
}

.required-badge {
    background: #ef4444;
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
}

.optional-badge {
    background: #94a3b8;
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    font-size: 0.7rem;
}

.parameter-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.parameter-in {
    display: inline-block;
    background: #e2e8f0;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 600;
    width: fit-content;
}

.parameter-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.parameter-type, .parameter-example {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.parameter-type code, .parameter-example code {
    background: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

/* Request Body */
.required-notice {
    display: inline-block;
    background: #ef4444;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.request-body-content {
    background: #f8f9fa;
    border-radius: 6px;
    padding: 1rem;
}

.content-type {
    margin-bottom: 1rem;
}

.content-type strong {
    color: var(--text-primary);
    font-size: 0.9rem;
}

.content-type code {
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.85rem;
}

.schema-info {
    margin-top: 1rem;
}

.schema-properties {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.schema-property {
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border-left: 3px solid var(--primary-color);
}

.schema-property code {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.type-badge {
    display: inline-block;
    background: #3b82f6;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.format-badge {
    display: inline-block;
    background: #10b981;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

.property-description {
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.property-example {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Example JSON */
.example-json {
    margin-top: 1rem;
    padding: 1rem;
    background: #1e1e1e;
    border-radius: 6px;
}

.example-json strong {
    color: #a0a0a0;
    font-size: 0.85rem;
    display: block;
    margin-bottom: 0.5rem;
}

.example-json pre {
    margin: 0;
    color: #d4d4d4;
    font-size: 0.85rem;
    line-height: 1.5;
    overflow-x: auto;
}

.example-json code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* Responses */
.responses-list {
    display: grid;
    gap: 1rem;
}

.response-item {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.response-status {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
}

.status-code {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.85rem;
    min-width: 50px;
    text-align: center;
}

.status-2xx { background: #10b981; color: white; }
.status-4xx { background: #ef4444; color: white; }
.status-5xx { background: #dc2626; color: white; }

.status-description {
    color: var(--text-primary);
    font-weight: 500;
}

.response-content {
    padding: 1rem;
    background: white;
}

.content-type-label {
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.content-type-label code {
    background: #f1f5f9;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
}

/* Try It Out */
.try-it-out {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.try-it-url {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.try-it-url code {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Code Examples */
.api-examples {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.example-tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
}

.example-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.example-tab:hover {
    background: #f0f0f0;
    color: var(--text-primary);
}

.example-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: white;
}

.example-pane {
    display: none;
    padding: 1.5rem;
}

.example-pane.active {
    display: block;
}

.example-pane pre {
    margin: 0;
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1.5rem;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.6;
}

.example-pane code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Responsive */
@media (max-width: 768px) {
    .api-header {
        padding: 2rem 1.5rem;
    }
    
    .api-title {
        font-size: 2rem;
    }
    
    .api-section {
        padding: 1.5rem;
    }
    
    .endpoint-method-path {
        min-width: auto;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .endpoint-header-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .parameter-row {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* Profile Page Styles */
.profile-content {
    padding: 2rem;
}

.profile-section {
    margin-bottom: 3rem;
}

.profile-section:last-child {
    margin-bottom: 0;
}

.profile-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1.5rem 0;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.profile-info {
    display: grid;
    gap: 1.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.info-item label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.form-actions .btn {
    min-width: 150px;
}

/* Responsive Profile */
@media (max-width: 768px) {
    .profile-content {
        padding: 1.5rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

/* Admin Styles */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

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

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.admin-nav-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.admin-nav-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.admin-nav-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    color: var(--primary-color);
}

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

.admin-nav-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.admin-nav-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.admin-table-container {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.admin-table thead {
    background: var(--background);
}

.admin-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.admin-table tbody tr:hover {
    background: var(--surface-hover);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

.admin-table code {
    background: var(--background);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: 'Courier New', monospace;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: white;
}

/* Responsive Admin */
@media (max-width: 768px) {
    .admin-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-nav-menu {
        grid-template-columns: 1fr;
    }
    
    .admin-table-container {
        overflow-x: scroll;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    /* Full width on mobile too */
    .admin-container {
        padding: 1rem;
    }
}

/* Pagination Styles */
.admin-pagination {
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.pagination-info {
    text-align: center;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-number {
    min-width: 40px;
    height: 40px;
    padding: 0.5rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-number:hover:not(.active):not(:disabled) {
    border-color: var(--primary-color);
    background: var(--surface-hover);
    transform: translateY(-2px);
}

.pagination-number.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 600;
}

.pagination-number:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-ellipsis {
    padding: 0 0.5rem;
    color: var(--text-secondary);
}

.pagination-btn {
    min-width: 100px;
}

@media (max-width: 768px) {
    .pagination-controls {
        flex-direction: column;
    }
    
    .pagination-numbers {
        order: 2;
    }
    
    .pagination-btn {
        order: 1;
        width: 100%;
    }
}

/* Contact Page */
.contact-page {
    padding: clamp(3rem, 7vw, 5rem) clamp(1.25rem, 6vw, 5rem) 4rem;
    background: radial-gradient(circle at top, rgba(99,102,241,0.12), transparent 55%),
                linear-gradient(180deg, rgba(248,250,252,1) 0%, rgba(241,245,249,1) 60%, rgba(248,250,252,1) 100%);
}

.contact-intro {
    text-align: center;
    max-width: 760px;
    margin: 0 auto 2.75rem;
}

.contact-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.95rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary-color, #4f46e5);
    background: rgba(99,102,241,0.12);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.contact-intro h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin: 1rem 0 0.75rem;
    color: #0f172a;
}

.contact-intro p {
    font-size: 1.1rem;
    color: var(--text-secondary, #475569);
    margin: 0;
}

.contact-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    align-items: stretch;
}

.contact-info-card,
.contact-form-card {
    background: #ffffff;
    border-radius: 30px;
    padding: clamp(1.75rem, 4vw, 2.5rem);
    border: 1px solid rgba(15,23,42,0.08);
    box-shadow: 0 35px 65px rgba(15,23,42,0.08);
}

.contact-info-card {
    border-top: 4px solid var(--primary-color, #4f46e5);
}

.contact-info-card h2,
.contact-form-card h2 {
    margin: 0 0 0.75rem;
    font-size: 1.45rem;
}

.contact-info-description,
.contact-form-description {
    margin: 0 0 1.5rem;
    color: var(--text-secondary, #475569);
    line-height: 1.6;
}

.contact-info-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.contact-info-list li {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(15,23,42,0.08);
}

.contact-info-list li:last-child {
    border-bottom: none;
}

.contact-info-list span {
    display: block;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary, #94a3b8);
    margin-bottom: 0.35rem;
}

.contact-info-list strong {
    font-size: 1.05rem;
    color: #0f172a;
}

.contact-info-list a {
    color: var(--primary-color, #4f46e5);
    text-decoration: none;
}

.contact-response-hint {
    margin-top: 1.5rem;
    padding: 0.85rem 1.1rem;
    border-radius: 16px;
    background: rgba(16,185,129,0.12);
    color: #065f46;
    font-weight: 600;
    font-size: 0.95rem;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.contact-form label {
    font-weight: 600;
    color: #0f172a;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    border-radius: 16px;
    border: 1px solid rgba(15,23,42,0.12);
    padding: 0.95rem 1.1rem;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: rgba(248,250,252,0.8);
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color, #4f46e5);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
    background: #ffffff;
}

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

.contact-form .contact-submit {
    margin-top: 0.5rem;
    width: 100%;
    padding: 0.95rem 1.25rem;
    font-size: 1.05rem;
    border-radius: 16px;
}

.contact-status {
    min-height: 1.5rem;
    margin-top: 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.contact-status.success {
    color: #0f9d58;
}

.contact-status.error {
    color: #ef4444;
}

.contact-disclaimer {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary, #64748b);
}

@media (max-width: 768px) {
    .contact-info-card,
    .contact-form-card {
        border-radius: 24px;
    }

    .contact-form .contact-submit {
        font-size: 1rem;
    }
}

/* Admin User Edit Form Styles */
.admin-user-page-layout {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.admin-user-sidebar {
    width: 250px;
    flex-shrink: 0;
}

.admin-user-menu {
    background: white;
    border-radius: 12px;
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 2rem;
}

.admin-menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.admin-menu-item:hover {
    background: var(--surface-hover);
    border-left-color: var(--primary-color);
}

.admin-menu-item.active {
    background: rgba(99, 102, 241, 0.1);
    border-left-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
}

.menu-icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.menu-text {
    flex: 1;
}

.admin-user-content {
    flex: 1;
    min-width: 0;
}

.user-section {
    display: none;
}

.user-section.active {
    display: block;
}

.admin-user-edit-container {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.admin-user-form {
    max-width: 800px;
    margin: 0 auto;
}

.admin-user-form .form-group {
    margin-bottom: 1.5rem;
}

.admin-user-form .form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.admin-user-form .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--transition);
}

.admin-user-form .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.admin-user-form .form-control:disabled {
    background: var(--background);
    cursor: not-allowed;
}

.admin-user-form .form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.admin-user-form .form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
    flex-wrap: wrap;
}

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

.btn-small {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn.icon-only {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    font-size: 1rem;
    border-radius: 999px;
}

.btn.icon-only span {
    line-height: 1;
    font-weight: 600;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-info {
    background: #3b82f6;
    color: white;
}

.btn-info:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

.token-display {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--background);
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

.token-display code {
    flex: 1;
    word-break: break-all;
    font-size: 0.875rem;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
}

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

@media (max-width: 768px) {
    .admin-user-page-layout {
        flex-direction: column;
        gap: 1rem;
    }
    
    .admin-user-sidebar {
        width: 100%;
    }
    
    .admin-user-menu {
        position: static;
        display: flex;
        overflow-x: auto;
        padding: 0.5rem;
    }
    
    .admin-menu-item {
        flex-direction: column;
        padding: 1rem;
        min-width: 100px;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    
    .admin-menu-item:hover,
    .admin-menu-item.active {
        border-left: none;
        border-bottom-color: var(--primary-color);
    }
    
    .menu-text {
        font-size: 0.875rem;
        text-align: center;
    }
    
    .admin-user-form .form-actions {
        flex-direction: column;
    }
    
    .admin-user-form .form-actions .btn {
        width: 100%;
    }
    
    .token-display {
        flex-direction: column;
    }
    
    .token-display code {
        width: 100%;
    }
}

/* ============================================
   TIMESTAMP FINE-TUNING WAVEFORM STYLES
   ============================================ */

#waveformContainer {
    position: relative;
}

#waveformContainer canvas {
    display: block;
    width: 100%;
}

.segment-item {
    transition: all 0.3s ease;
}

.segment-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.segment-item input[type="number"] {
    text-align: center;
}

/* Peaks.js custom styling */
.peaks-overview-container,
.peaks-zoomview-container {
    font-family: 'Inter', sans-serif;
}

/* ============================================
   DUBAI 2.0 PAGE STYLES
   ============================================ */

.dubai-2-page {
    padding: 2rem 0;
}

/* Dubai 2.0 Fullscreen Layout */
.dubai2-fullscreen {
    height: calc(100vh - 60px); /* Subtract navbar height */
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dubai2-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem 1.5rem;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Progress Bar */
.dubai2-progress-bar {
    flex-shrink: 0;
    margin-bottom: 1rem;
}

.dubai2-progress-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.dubai2-progress-line {
    position: relative;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.dubai2-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.5s ease;
    border-radius: 2px;
}

.dubai2-progress-steps {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.dubai2-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 80px;
    max-width: 120px;
    position: relative;
}

.dubai2-progress-step-circle {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    transition: var(--transition);
    border: 2px solid var(--border-color);
}

.dubai2-progress-step.active .dubai2-progress-step-circle {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transform: scale(1.2);
}

.dubai2-progress-step.completed .dubai2-progress-step-circle {
    background: var(--success-color);
    color: white;
    border-color: var(--success-color);
    width: 16px;
    height: 16px;
}

.dubai2-progress-step.completed .dubai2-progress-step-circle::after {
    content: '✓';
    font-size: 10px;
    line-height: 1;
}

.dubai2-progress-step-label {
    font-size: 0.75rem;
    text-align: center;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.2;
    transition: var(--transition);
}

.dubai2-progress-step.active .dubai2-progress-step-label {
    color: var(--primary-color);
    font-weight: 600;
}

.dubai2-progress-step.completed .dubai2-progress-step-label {
    color: var(--success-color);
}

/* Clickable steps - hover effects */
.dubai2-progress-step.clickable:hover .dubai2-progress-step-circle {
    transform: scale(1.3);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.dubai2-progress-step.clickable:hover .dubai2-progress-step-label {
    color: var(--primary-color);
    font-weight: 600;
}

.dubai2-progress-step.completed.clickable:hover .dubai2-progress-step-circle {
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

.dubai2-progress-step.completed.clickable:hover .dubai2-progress-step-label {
    color: var(--success-color);
}

/* Progress Header with Toggle */
.dubai2-progress-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.dubai2-progress-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.15s ease;
}

.dubai2-progress-toggle:hover {
    background: #e2e8f0;
    color: var(--text-primary);
}

[data-theme="dark"] .dubai2-progress-toggle {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .dubai2-progress-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Collapsed Progress Bar */
.dubai2-progress-collapsed {
    background: white;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

[data-theme="dark"] .dubai2-progress-collapsed {
    background: var(--surface);
}

.dubai2-progress-collapsed-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.dubai2-progress-collapsed-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
    transition: width 0.3s ease;
}

.dubai2-progress-collapsed-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dubai2-progress-collapsed-step {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.dubai2-progress-collapsed-step::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Step Content */
.dubai2-step-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    min-height: 0; /* Important for flex child scrolling */
}

[data-theme="dark"] .dubai2-step-content {
    background: var(--surface);
}

.dubai2-step-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1.5rem;
    overflow: hidden;
}

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

.dubai2-step-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.dubai2-header-actions-slot {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    margin-right: 0.75rem;
}

.dubai2-header-actions-slot:empty {
    display: none;
}

.dubai2-header-buttons {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.dubai2-header-actions-slot select {
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    font-size: 0.8rem;
    color: var(--text-primary);
    cursor: pointer;
    min-width: 100px;
}

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

.dubai2-header-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    background: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai2-header-action-btn:hover {
    background: var(--primary-color);
    color: white;
}

.dubai2-header-action-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.dubai2-header-action-btn svg {
    width: 14px;
    height: 14px;
}

.dubai2-header-continue-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai2-header-continue-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.dubai2-header-continue-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.dubai2-header-continue-btn.hidden {
    display: none;
}

/* Save button in header */
.dubai2-header-save-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: white;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai2-header-save-btn:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.dubai2-header-save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.dubai2-header-save-btn.saving {
    color: var(--primary-color);
    border-color: var(--primary-color);
    animation: pulse 1s ease-in-out infinite;
}

.dubai2-header-save-btn.saved {
    color: #22c55e;
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.dubai2-header-save-btn.error {
    color: #ef4444;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

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

.dubai2-header-continue-btn .btn-spinner {
    width: 14px;
    height: 14px;
    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); }
}

.dubai2-step-component {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0; /* Important for flex child scrolling */
}

.dubai2-step-form {
    max-width: 800px;
    margin: 0 auto;
}

.dubai2-step-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.dubai2-step-actions .btn {
    min-width: 120px;
}

/* Track Selection */
.track-item:hover {
    background: var(--bg-hover) !important;
    border-color: var(--primary-color) !important;
}

.track-item.selected {
    border-color: var(--primary-color) !important;
    background: rgba(var(--primary-rgb), 0.05) !important;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: capitalize;
}

.status-completed, .status-ready {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.status-processing, .status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.status-failed {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.status-uploaded {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 3rem;
}

.loading-state .spinner {
    margin: 0 auto 1rem auto;
}

.loading-state p {
    color: var(--text-secondary);
}

/* Error State */
.error-state {
    text-align: center;
    padding: 3rem;
}

.error-state .error-message {
    color: var(--error-color, #ef4444);
    margin-bottom: 1rem;
}

/* Upload Box */
.upload-box {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    border: 2px dashed var(--border-color);
    text-align: center;
    transition: var(--transition);
}

.upload-box:hover {
    border-color: var(--primary-color);
    background: var(--surface-hover);
}

/* Responsive */
@media (max-width: 768px) {
    .dubai2-progress-steps {
        justify-content: flex-start;
    }
    
    .dubai2-progress-step {
        min-width: 60px;
        max-width: 80px;
    }
    
    .dubai2-progress-step-label {
        font-size: 0.65rem;
    }
    
    .dubai2-step-wrapper {
        padding: 1.5rem;
    }
    
    .dubai2-step-actions {
        flex-direction: column;
    }
    
    .dubai2-step-actions .btn {
        width: 100%;
    }
}

/* Step 7: Markup Styles with Peaks.js Waveform */
.markup-container-full {
    max-width: 1400px;
    margin: 0 auto;
}

/* Waveform Section */
.markup-waveform-section {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.markup-waveform-container {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.markup-waveform-container #zoomview-container {
    height: 200px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.markup-waveform-container #overview-container {
    height: 100px;
    background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%);
    border-top: 1px solid var(--border-color);
}

.markup-waveform-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10;
}

.markup-waveform-loading p {
    margin-top: 1rem;
    color: var(--text-secondary);
}

.markup-waveform-error {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
}

/* Audio Controls */
.markup-waveform-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
    margin-bottom: 0.75rem;
}

.markup-waveform-row .markup-waveform-section {
    flex: 1;
    min-width: 0;
}

.markup-audio-controls-side {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
}

.markup-zoom-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 12px;
    padding: 4px;
}

.markup-zoom-level {
    font-size: 10px;
    font-weight: 600;
    color: var(--primary-color);
    min-width: 28px;
    text-align: center;
    padding: 2px 0;
}

.markup-icon-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-color);
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.markup-icon-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
}

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

.markup-icon-btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.markup-icon-btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.markup-time-display-mini {
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    white-space: nowrap;
    text-align: center;
    padding: 0.25rem;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 4px;
    min-width: 40px;
}

/* Legacy - keep for compatibility */
.markup-audio-controls {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.markup-audio-controls .btn {
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    min-height: unset;
}

.markup-time-display {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    background: var(--surface-hover);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
}

/* Segments Section */
.markup-segments-section {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.markup-segments-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-bottom: 1px solid var(--border-color);
}

.markup-segments-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.markup-segments-list {
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
}

.markup-segments-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.markup-empty {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

/* Segment Item */
.markup-segment-item {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.2s ease;
}

.markup-segment-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.markup-segment-item.new {
    border-color: #22c55e;
    background: #f0fdf4;
}

.markup-segment-item.changed {
    background: #fff9e6;
}

.markup-segment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.markup-segment-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.markup-segment-speaker {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.markup-segment-number {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.markup-segment-badge {
    background: #22c55e;
    color: white;
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.markup-segment-actions {
    display: flex;
    gap: 0.5rem;
}

.markup-segment-actions .btn-danger {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.markup-segment-actions .btn-danger:hover {
    background: #fecaca;
}

/* Segment Text */
.markup-segment-text-container {
    margin-bottom: 0.75rem;
}

.markup-segment-text-container label {
    font-size: 0.85rem;
    font-weight: 500;
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
}

.markup-segment-text-container textarea {
    width: 100%;
    min-height: 60px;
    padding: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    resize: vertical;
    background: white;
    font-family: inherit;
}

.markup-segment-text-container textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

/* Segment Times */
.markup-segment-times {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.markup-segment-time-field label {
    font-size: 0.85rem;
    font-weight: 500;
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
}

.markup-segment-time-field input {
    width: 100%;
    padding: 0.5rem;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
}

.markup-segment-time-field input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.markup-segment-time-field input.readonly {
    background: #f5f5f5;
    cursor: default;
}

.markup-segment-footer {
    margin-top: 0.5rem;
    display: flex;
    justify-content: flex-end;
}

/* New Compact Segment Row Design */
.segment-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    transition: all 0.15s ease;
}

.segment-row:hover {
    border-color: var(--primary-color);
    box-shadow: 0 1px 4px rgba(99, 102, 241, 0.1);
}

.segment-row.new {
    border-color: #22c55e;
    background: linear-gradient(to right, #f0fdf4, white);
}

.segment-row.changed {
    background: linear-gradient(to right, #fffbeb, white);
}

[data-theme="dark"] .segment-row {
    background: var(--surface);
}

[data-theme="dark"] .segment-row.new {
    background: linear-gradient(to right, rgba(34, 197, 94, 0.1), var(--surface));
}

[data-theme="dark"] .segment-row.changed {
    background: linear-gradient(to right, rgba(245, 158, 11, 0.1), var(--surface));
}

.segment-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.segment-row-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.segment-row-index {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
    flex-shrink: 0;
}

.segment-row-speaker {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.segment-row-badge {
    background: #22c55e;
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.segment-row-actions {
    display: flex;
    gap: 0.25rem;
}

.segment-action-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.15s ease;
}

.segment-action-btn.play {
    background: #e0e7ff;
    color: #4f46e5;
}

.segment-action-btn.play:hover {
    background: #c7d2fe;
}

.segment-action-btn.reset {
    background: #fef3c7;
    color: #d97706;
}

.segment-action-btn.reset:hover {
    background: #fde68a;
}

.segment-action-btn.delete {
    background: #fee2e2;
    color: #dc2626;
    font-size: 0.9rem;
    font-weight: 300;
}

.segment-action-btn.delete:hover {
    background: #fecaca;
}

.segment-row-body {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.segment-row-text {
    flex: 1;
    min-width: 0;
    min-height: 36px;
    max-height: 50px;
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
    line-height: 1.35;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    resize: none;
    background: #f8fafc;
    color: var(--text-primary);
    transition: border-color 0.15s ease;
}

.segment-row-text:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
}

[data-theme="dark"] .segment-row-text {
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .segment-row-text:focus {
    background: rgba(0, 0, 0, 0.3);
}

.segment-row-times {
    flex-shrink: 0;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.segment-time-group {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.segment-time-group label {
    font-size: 0.6rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: center;
}

.segment-time-group input {
    width: 78px;
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: white;
    color: var(--text-primary);
    text-align: center;
}

.segment-time-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

[data-theme="dark"] .segment-time-group input {
    background: rgba(0, 0, 0, 0.2);
}

.segment-time-group.duration {
    align-items: center;
}

.segment-duration-value {
    font-size: 0.8rem;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    color: var(--text-secondary);
    padding: 0.4rem 0.5rem;
    background: #f1f5f9;
    border-radius: 4px;
    min-width: 60px;
    text-align: center;
}

[data-theme="dark"] .segment-duration-value {
    background: rgba(0, 0, 0, 0.15);
}

/* Segment Modal */
.segment-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.segment-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    margin: 1rem;
    animation: slideUp 0.2s ease;
}

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

[data-theme="dark"] .segment-modal {
    background: var(--surface);
}

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

.segment-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.segment-modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text-secondary);
    transition: all 0.15s ease;
}

.segment-modal-close:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

[data-theme="dark"] .segment-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.segment-modal-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.segment-modal-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.segment-modal-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.segment-modal-field label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.segment-modal-field input,
.segment-modal-field textarea {
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
    color: var(--text-primary);
    transition: border-color 0.15s ease;
}

.segment-modal-field input:focus,
.segment-modal-field textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

[data-theme="dark"] .segment-modal-field input,
[data-theme="dark"] .segment-modal-field textarea {
    background: rgba(0, 0, 0, 0.2);
}

.segment-modal-field textarea {
    resize: vertical;
    min-height: 70px;
}

.segment-modal-hint {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
}

.segment-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
}

[data-theme="dark"] .segment-modal-footer {
    background: rgba(0, 0, 0, 0.1);
}

/* Actions */
.markup-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .markup-waveform-container #zoomview-container {
        height: 150px;
    }
    
    .markup-waveform-container #overview-container {
        height: 80px;
    }
    
    .markup-audio-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .markup-segment-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .markup-segment-times {
        grid-template-columns: 1fr;
    }
    
    .markup-actions {
        flex-direction: column;
    }
    
    .markup-actions .btn {
        width: 100%;
    }
    
    /* Compact segment row responsive */
    .segment-row-body {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .segment-row-text {
        flex: 1;
    }
    
    .segment-row-times {
        flex: 1;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
    
    .segment-time-group input {
        width: 70px;
    }
}

/* ===== Step 7 Markup - View Toggle ===== */
.markup-view-toggle {
    display: inline-flex;
    gap: 4px;
    margin-left: 16px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
}

.markup-view-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.markup-view-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

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

.markup-view-btn svg {
    width: 16px;
    height: 16px;
}

/* ===== Step 7 Markup - Detailed View ===== */
.markup-detailed-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0;
}

.markup-detailed-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.markup-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.markup-nav-btn:hover:not(.disabled) {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.markup-nav-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.markup-nav-btn svg {
    width: 20px;
    height: 20px;
}

.markup-detailed-counter {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.markup-detailed-index {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

.markup-detailed-of {
    color: var(--text-secondary);
    font-weight: 400;
}

.markup-detailed-total {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.markup-detailed-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}

.markup-detailed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 16px;
}

[data-theme="dark"] .markup-detailed-header {
    background: linear-gradient(180deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.05) 100%);
}

.markup-detailed-speaker {
    display: flex;
    align-items: center;
    gap: 10px;
}

.markup-detailed-speaker-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.markup-detailed-speaker-input {
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    color: var(--text-primary);
    min-width: 140px;
}

.markup-detailed-speaker-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

[data-theme="dark"] .markup-detailed-speaker-input {
    background: rgba(0,0,0,0.2);
}

.markup-detailed-times {
    display: flex;
    gap: 16px;
    align-items: center;
}

.markup-detailed-time-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.markup-detailed-time-group label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.markup-detailed-time-group input {
    width: 100px;
    padding: 8px 10px;
    font-size: 14px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    color: var(--text-primary);
    text-align: center;
}

.markup-detailed-time-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

[data-theme="dark"] .markup-detailed-time-group input {
    background: rgba(0,0,0,0.2);
}

.markup-detailed-time-group.duration {
    align-items: center;
}

.markup-detailed-duration {
    font-size: 14px;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-weight: 600;
    color: var(--primary-color);
    padding: 8px 12px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 6px;
}

.markup-detailed-waveform {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .markup-detailed-waveform {
    background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.2) 100%);
}

.markup-detailed-waveform-inner {
    position: relative;
}

.markup-detailed-waveform-inner #detailed-zoomview-container {
    border-bottom: 1px solid var(--border-color);
}

/* Make WaveSurfer region borders thin for precision */
.markup-detailed-waveform-inner [data-id*="handle"] {
    border-left: 2px solid rgba(59, 130, 246, 1) !important;
    border-right: 2px solid rgba(59, 130, 246, 1) !important;
    cursor: ew-resize !important;
}

.markup-detailed-waveform-inner [data-id="split-handle"] {
    border-left: 2px solid rgba(239, 68, 68, 1) !important;
    border-right: 2px solid rgba(239, 68, 68, 1) !important;
}

.markup-detailed-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: white;
    border-top: 1px solid var(--border-color);
}

[data-theme="dark"] .markup-detailed-controls {
    background: var(--surface);
}

.markup-detailed-play-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all 0.15s ease;
}

.markup-detailed-play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.markup-detailed-time-display {
    flex: 1;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 14px;
    color: var(--text-primary);
}

.markup-detailed-zoom {
    display: flex;
    align-items: center;
    gap: 8px;
}

.markup-detailed-zoom .markup-icon-btn {
    background: var(--surface-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.markup-detailed-zoom .markup-icon-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.markup-detailed-zoom #detailedZoomLevel {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    color: var(--primary-color);
    min-width: 32px;
    text-align: center;
    font-weight: 600;
}

.markup-detailed-text-section {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

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

.markup-detailed-textarea {
    width: 100%;
    min-height: 120px;
    padding: 14px;
    font-size: 15px;
    line-height: 1.6;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--text-primary);
    resize: vertical;
    font-family: inherit;
}

.markup-detailed-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .markup-detailed-textarea {
    background: rgba(0,0,0,0.2);
}

[data-theme="dark"] .markup-detailed-textarea:focus {
    background: rgba(0,0,0,0.3);
}

.markup-detailed-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    background: #f8fafc;
    border-top: 1px solid var(--border-color);
}

[data-theme="dark"] .markup-detailed-actions {
    background: rgba(0,0,0,0.1);
}

.markup-detailed-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.markup-detailed-actions .btn svg {
    width: 16px;
    height: 16px;
}

.markup-detailed-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
}

/* Editor Mode Toolbar */
.markup-editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .markup-editor-toolbar {
    background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.1) 100%);
}

.markup-mode-buttons {
    display: flex;
    gap: 6px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
}

[data-theme="dark"] .markup-mode-buttons {
    background: var(--surface);
}

.markup-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.markup-mode-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

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

.markup-mode-btn svg {
    width: 16px;
    height: 16px;
}

.markup-expand-buttons {
    display: flex;
    gap: 8px;
}

.markup-expand-btn {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.markup-expand-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

[data-theme="dark"] .markup-expand-btn {
    background: var(--surface);
}

.markup-mode-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    margin: 0 16px;
}

.markup-mode-actions .btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.markup-scrub-hint {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

.markup-detailed-delete-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.markup-detailed-delete-btn:hover {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

.markup-detailed-delete-btn svg {
    width: 18px;
    height: 18px;
}

/* Responsive for detailed view */
@media (max-width: 768px) {
    .markup-detailed-nav {
        flex-direction: column;
        gap: 16px;
    }
    
    .markup-nav-btn {
        width: 100%;
        justify-content: center;
    }
    
    .markup-detailed-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .markup-detailed-times {
        width: 100%;
        justify-content: space-between;
    }
    
    .markup-detailed-actions {
        flex-direction: column;
    }
    
    .markup-detailed-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ======================================== */
/* Dubai 3.0 Styles                         */
/* ======================================== */

.dubai3-fullscreen {
    height: calc(100vh - 60px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dubai3-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1rem 1.5rem;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
}

[data-theme="dark"] .dubai3-layout {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #334155 100%);
}

/* Progress Bar Styles */
.dubai3-progress-bar {
    flex-shrink: 0;
    margin-bottom: 1rem;
}

.dubai3-progress-collapsed {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
    border: 1px solid rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    padding: 0.5rem 1rem;
}

.dubai3-progress-collapsed-bar {
    height: 3px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 2px;
    margin-bottom: 0.5rem;
}

.dubai3-progress-collapsed-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.dubai3-progress-collapsed-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.dubai3-progress-steps-mini {
    display: flex;
    gap: 0.5rem;
}

.dubai3-mini-step {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
}

.dubai3-mini-step.active {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

.dubai3-mini-step.completed {
    border-color: #10b981;
    background: #10b981;
}

.dubai3-mini-step.completed .dubai3-mini-icon {
    filter: brightness(0) invert(1);
}

.dubai3-mini-step.clickable:hover {
    border-color: #6366f1;
    cursor: pointer;
    transform: scale(1.05);
}

.dubai3-progress-collapsed-step {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.dubai3-progress-toggle {
    background: transparent;
    border: none;
    padding: 0.25rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.dubai3-progress-toggle:hover {
    color: var(--primary-color);
}

/* Expanded Progress */
.dubai3-progress-expanded {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1rem 1.5rem;
}

.dubai3-progress-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.dubai3-progress-line {
    height: 4px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 2px;
    margin-bottom: 1rem;
}

.dubai3-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.dubai3-progress-steps {
    display: flex;
    justify-content: space-between;
}

.dubai3-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    cursor: default;
}

.dubai3-progress-step.clickable {
    cursor: pointer;
}

.dubai3-progress-step-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface);
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.dubai3-progress-step.active .dubai3-progress-step-circle {
    border-color: #6366f1;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.dubai3-progress-step.completed .dubai3-progress-step-circle {
    border-color: #10b981;
    background: #10b981;
}

.dubai3-progress-step.completed .dubai3-step-icon {
    filter: brightness(0) invert(1);
}

.dubai3-progress-step-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
}

.dubai3-progress-step.active .dubai3-progress-step-label {
    color: #6366f1;
    font-weight: 600;
}

/* Step Content */
.dubai3-step-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dubai3-step-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--surface);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.dubai3-step-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(168, 85, 247, 0.03) 100%);
}

.dubai3-step-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dubai3-step-icon-large {
    font-size: 1.5rem;
}

.dubai3-header-actions-slot {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-start;
}

/* Header Settings Spoilers */
.dubai3-header-settings {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dubai3-header-settings-item {
    position: relative;
}

.dubai3-header-settings-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.dubai3-header-settings-toggle svg:first-child {
    color: var(--primary-color);
    flex-shrink: 0;
}

.dubai3-header-settings-item.tts .dubai3-header-settings-toggle svg:first-child {
    color: var(--secondary-color);
}

.dubai3-header-settings-arrow {
    margin-left: 0.25rem;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.dubai3-header-settings-item.expanded .dubai3-header-settings-arrow {
    transform: rotate(180deg);
}

.dubai3-header-settings-toggle:hover {
    border-color: var(--primary-color);
    background: var(--surface-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.dubai3-header-settings-item.tts .dubai3-header-settings-toggle:hover {
    border-color: var(--secondary-color);
}

.dubai3-header-settings-item.expanded .dubai3-header-settings-toggle {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.dubai3-header-settings-item.tts.expanded .dubai3-header-settings-toggle {
    border-color: var(--secondary-color);
    background: rgba(139, 92, 246, 0.05);
}

.dubai3-header-settings-content {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 0;
    min-width: 320px;
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 1.25rem;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    pointer-events: none;
}

.dubai3-header-settings-item.expanded .dubai3-header-settings-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: all;
}

.dubai3-header-settings-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.dubai3-header-setting label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dubai3-header-setting select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.dubai3-header-setting select:hover {
    border-color: var(--border-hover);
}

.dubai3-header-setting select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.dubai3-header-setting-checkbox {
    margin: 0.75rem 0;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.dubai3-header-setting-checkbox .dubai3-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.dubai3-header-setting-checkbox .dubai3-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #6366f1;
    cursor: pointer;
}

.dubai3-header-settings-action-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.dubai3-header-settings-action-btn.translate {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.dubai3-header-settings-action-btn.translate:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.dubai3-header-settings-action-btn.tts {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #c084fc 100%);
    color: white;
}

.dubai3-header-settings-action-btn.tts:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.dubai3-header-settings-action-btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
    transform: none;
}

.dubai3-header-settings-action-btn.translate.done {
    background: linear-gradient(135deg, #10b981, #059669);
}

.dubai3-header-settings-action-btn.tts.done {
    background: linear-gradient(135deg, #10b981, #059669);
}

.dubai3-header-settings-action-btn .spinning {
    animation: spin 1s linear infinite;
}

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

.dubai3-header-buttons {
    display: flex;
    gap: 0.5rem;
}

.dubai3-header-save-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.dubai3-header-save-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
}

.dubai3-header-save-btn.saving {
    animation: pulse 1s ease-in-out infinite;
}

.dubai3-header-save-btn.saved {
    border-color: #10b981;
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.dubai3-header-save-btn.error {
    border-color: #ef4444;
    color: #ef4444;
}

.dubai3-header-continue-btn {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.dubai3-header-continue-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.dubai3-header-continue-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.dubai3-step-component {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

/* Loading State */
.dubai3-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    gap: 1rem;
}

.dubai3-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(99, 102, 241, 0.2);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.dubai3-spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* View Toggle */
.dubai3-view-toggle {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    background: rgba(0, 0, 0, 0.04);
    padding: 0.2rem;
    border-radius: 6px;
    margin-left: 0.75rem;
}

/* View toggle in Dubai 4 header */
.dubai4-step-header .dubai3-view-toggle {
    margin-left: auto;
    margin-right: 0.5rem;
}

.dubai3-collapse-toggle {
    display: flex;
    align-items: center;
    gap: 0.1rem;
    margin-left: 0.35rem;
    padding-left: 0.35rem;
    border-left: 1px solid rgba(99, 102, 241, 0.15);
}

.dubai3-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    background: transparent;
    border-radius: 4px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.dubai3-collapse-btn svg {
    width: 12px;
    height: 12px;
}

.dubai3-collapse-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.dubai3-collapse-btn.active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

/* Waveform mode toggle (Original vs TTS Final) */
.dubai3-waveform-mode-toggle {
    display: flex;
    align-items: center;
    gap: 0.1rem;
    margin-left: 0.35rem;
    padding-left: 0.35rem;
    border-left: 1px solid rgba(99, 102, 241, 0.15);
}

.dubai3-waveform-mode-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.4rem;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 4px;
    background: transparent;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.dubai3-waveform-mode-btn svg {
    width: 12px;
    height: 12px;
}

.dubai3-waveform-mode-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.dubai3-waveform-mode-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* TTS mode button with distinct green color when active */
#waveformModeTtsBtn.active {
    background: #22c55e;
    border-color: #22c55e;
    color: white;
}

.dubai3-view-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    border: none;
    background: transparent;
    border-radius: 5px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.dubai3-view-btn svg {
    width: 14px;
    height: 14px;
}

.dubai3-view-btn-label {
    display: inline;
}

.dubai3-view-btn:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-primary);
}

.dubai3-view-btn.active {
    background: var(--primary-color);
    color: white;
    font-weight: 500;
}

/* Step 1: Project Create */
.dubai3-step1-container {
    max-width: 700px;
    margin: 0 auto;
}

.dubai3-form-section {
    margin-bottom: 1.5rem;
}

.dubai3-form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

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

.dubai3-form-group-large {
    flex: 2;
}

.dubai3-form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.dubai3-form-group label .required {
    color: #ef4444;
}

.dubai3-input,
.dubai3-select,
.dubai3-textarea {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    background: var(--surface);
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

.dubai3-input:focus,
.dubai3-select:focus,
.dubai3-textarea:focus {
    outline: none;
    border-color: #6366f1;
}

/* Upload Area */
.dubai3-upload-section {
    margin-top: 1.5rem;
}

.dubai3-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.02) 0%, rgba(168, 85, 247, 0.02) 100%);
}

.dubai3-upload-area:hover,
.dubai3-upload-area.dragover {
    border-color: #6366f1;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
}

.dubai3-upload-icon {
    color: #6366f1;
    margin-bottom: 1rem;
}

.dubai3-upload-text {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.dubai3-upload-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.dubai3-file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(34, 197, 94, 0.08) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
}

.dubai3-file-icon {
    font-size: 2rem;
}

.dubai3-file-details {
    flex: 1;
}

.dubai3-file-name {
    font-weight: 600;
    color: var(--text-primary);
}

.dubai3-file-size {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.dubai3-file-remove {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    font-size: 1.25rem;
    cursor: pointer;
}

.dubai3-upload-progress {
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.dubai3-upload-progress-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.dubai3-progress-bar-container {
    height: 6px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 3px;
}

.dubai3-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #a855f7);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.dubai3-error-message {
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    color: #ef4444;
    font-size: 0.9rem;
}

/* Step 2: Preprocessing */
.dubai3-preprocessing-container {
    max-width: 700px;
    margin: 0 auto;
}

.dubai3-phase-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.dubai3-phase-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 24px;
    transition: all 0.2s ease;
}

.dubai3-phase-item.active {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

.dubai3-phase-item.completed {
    border-color: #10b981;
    background: #10b981;
    color: white;
}

.dubai3-phase-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

.dubai3-phase-item.active .dubai3-phase-number {
    background: #6366f1;
    color: white;
}

.dubai3-phase-item.completed .dubai3-phase-number {
    background: white;
    color: #10b981;
}

.dubai3-phase-label {
    font-size: 0.85rem;
    font-weight: 500;
}

.dubai3-phase-connector {
    width: 24px;
    height: 2px;
    background: var(--border-color);
}

.dubai3-phase-content {
    margin-top: 1rem;
}

/* Track Selection */
.dubai3-track-selection {
    margin-top: 1rem;
}

.dubai3-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.dubai3-track-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dubai3-track-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai3-track-item:hover {
    border-color: rgba(99, 102, 241, 0.4);
}

.dubai3-track-item.selected {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
}

.dubai3-track-radio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dubai3-track-item.selected .dubai3-track-radio {
    border-color: #6366f1;
}

.dubai3-track-radio-inner {
    width: 10px;
    height: 10px;
    background: #6366f1;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.dubai3-track-item.selected .dubai3-track-radio-inner {
    opacity: 1;
}

.dubai3-track-info {
    flex: 1;
}

.dubai3-track-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.dubai3-track-name {
    font-weight: 600;
    color: var(--text-primary);
}

.dubai3-track-lang {
    font-size: 0.7rem;
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    padding: 0.125rem 0.4rem;
    border-radius: 4px;
    font-weight: 600;
}

.dubai3-track-stats {
    display: flex;
    gap: 1rem;
}

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

/* Model Selection */
.dubai3-model-section {
    margin-top: 1.5rem;
}

.dubai3-section-subtitle {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.dubai3-model-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.dubai3-model-option:hover {
    border-color: rgba(99, 102, 241, 0.4);
}

.dubai3-model-option.selected {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
}

.dubai3-model-option input {
    display: none;
}

.dubai3-model-radio {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
}

.dubai3-model-option.selected .dubai3-model-radio {
    border-color: #6366f1;
    background: #6366f1;
    box-shadow: inset 0 0 0 3px var(--surface);
}

.dubai3-model-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.dubai3-model-badge {
    color: #f59e0b;
}

/* Progress Cards */
.dubai3-progress-section {
    margin-top: 1.5rem;
}

.dubai3-progress-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    color: var(--text-primary);
}

.dubai3-result-section {
    margin-top: 1.5rem;
}

.dubai3-result-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 10px;
}

.dubai3-result-card.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(34, 197, 94, 0.08) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.dubai3-result-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #10b981;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.dubai3-stem-results,
.dubai3-asr-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

.dubai3-stem-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.dubai3-stem-icon {
    font-size: 1.25rem;
}

.dubai3-stem-label {
    font-weight: 500;
    color: var(--text-primary);
}

.dubai3-stat-item {
    text-align: center;
    padding: 1rem;
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.dubai3-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dubai3-stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.dubai3-error-section {
    margin-top: 1.5rem;
}

.dubai3-error-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    color: #ef4444;
}

.dubai3-error-icon {
    font-size: 1.25rem;
}

/* ASR Settings */
.dubai3-asr-section {
    margin-top: 1rem;
}

.dubai3-selected-track-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.08) 0%, rgba(219, 39, 119, 0.08) 100%);
    border: 1px solid rgba(236, 72, 153, 0.2);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.dubai3-card-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ec4899, #db2777);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.dubai3-card-info {
    flex: 1;
}

.dubai3-card-title {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
}

.dubai3-card-subtitle {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.dubai3-card-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.dubai3-card-badge.success {
    background: #10b981;
    color: white;
}

.dubai3-asr-settings {
    margin-top: 1rem;
}

.dubai3-settings-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.dubai3-setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 150px;
}

.dubai3-setting-group label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Complete Phase */
.dubai3-complete-section {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.dubai3-complete-card {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(34, 197, 94, 0.08) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 16px;
    max-width: 400px;
}

.dubai3-complete-icon {
    width: 64px;
    height: 64px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1rem;
}

.dubai3-complete-card h3 {
    color: #10b981;
    margin-bottom: 0.5rem;
}

.dubai3-complete-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.dubai3-complete-stats {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Step 3: Studio */
.dubai3-studio-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 1rem;
}

/* Old waveform styles removed - see improved styles below */

.dubai3-waveform-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    gap: 0.5rem;
}

/* Old zoom/time styles removed - see improved styles below */

/* Segments Section */
.dubai3-segments-section {
    flex: 1;
    overflow-y: auto;
}

.dubai3-segments-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Old segment row styles removed - see improved styles below */

.dubai3-studio-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.dubai3-save-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai3-save-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
}

/* Step 4: Rendition */
.dubai3-rendition-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 1rem;
    padding: 0.5rem;
}

/* Split Settings Panels */
.dubai3-settings-row-split {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
}

.dubai3-settings-panel-half {
    background: linear-gradient(135deg, var(--surface) 0%, rgba(99, 102, 241, 0.02) 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.dubai3-settings-panel-half.tts {
    background: linear-gradient(135deg, var(--surface) 0%, rgba(168, 85, 247, 0.02) 100%);
    border-color: rgba(168, 85, 247, 0.15);
}

.dubai3-settings-panel-half:hover {
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
}

.dubai3-settings-panel-half.tts:hover {
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.1);
}

.dubai3-settings-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border: none;
    background: transparent;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.dubai3-settings-toggle svg:first-child {
    color: #6366f1;
}

.dubai3-settings-panel-half.tts .dubai3-settings-toggle svg:first-child {
    color: #a855f7;
}

.dubai3-settings-toggle:hover {
    background: rgba(99, 102, 241, 0.05);
}

.dubai3-settings-panel-half.tts .dubai3-settings-toggle:hover {
    background: rgba(168, 85, 247, 0.05);
}

.dubai3-settings-arrow {
    margin-left: auto;
    transition: transform 0.25s ease;
    opacity: 0.6;
}

.dubai3-settings-panel-half.expanded .dubai3-settings-arrow {
    transform: rotate(180deg);
    opacity: 1;
}

.dubai3-settings-content {
    display: none;
    padding: 1.25rem;
    border-top: 1px solid rgba(99, 102, 241, 0.1);
    background: rgba(99, 102, 241, 0.03);
}

.dubai3-settings-panel-half.tts .dubai3-settings-content {
    border-top-color: rgba(168, 85, 247, 0.1);
    background: rgba(168, 85, 247, 0.03);
}

.dubai3-settings-panel-half.expanded .dubai3-settings-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dubai3-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.dubai3-setting {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.dubai3-setting label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.dubai3-setting select {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai3-setting select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.dubai3-settings-panel-half.tts .dubai3-setting select:focus {
    border-color: #a855f7;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

.dubai3-settings-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    border: none;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.dubai3-settings-action-btn.translate {
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.dubai3-settings-action-btn.translate:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.dubai3-settings-action-btn.tts {
    background: linear-gradient(135deg, #a855f7 0%, #c084fc 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
}

.dubai3-settings-action-btn.tts:hover {
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
    transform: translateY(-1px);
}

/* Legacy single panel (for backwards compatibility) */
.dubai3-settings-panel {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.dubai3-settings-panel.expanded .dubai3-settings-content {
    display: block;
}

/* Rendition Headers V2 */
.dubai3-rendition-headers-v2 {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(168, 85, 247, 0.04) 100%);
    border-radius: 12px;
    margin-bottom: 0.5rem;
}

.dubai3-rendition-headers-v2 .dubai3-header-col {
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 6px;
}

.dubai3-col-text { 
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.dubai3-col-tts-section { 
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

/* Rendition List */
.dubai3-rendition-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
}

/* Virtual Scrolling Container */
.dubai3-virtual-scroll-container {
    position: relative;
    width: 100%;
    padding: 0;
    margin: 0;
}

.dubai3-virtual-scroll-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 0;
    margin: 0;
}

.dubai3-virtual-row {
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    line-height: 0;
}

/* Ensure virtual rows have proper layout */
.dubai3-virtual-row > .dubai3-rendition-row-v2,
.dubai3-virtual-row > .dubai3-rendition-row-collapsed {
    margin: 0;
    border-radius: 0;
}

/* Collapsed rows - zero spacing, table-like look */
.dubai3-virtual-row:first-child > .dubai3-rendition-row-collapsed {
    border-top: 1px solid var(--border-color);
}

/* Collapsed Row View - Table-like Compact Layout */
/* Columns: ☑ | num | speaker | time | original | ➔ | translated | versions | actions | scores | play */
/* Groups: [metadata] | [content] | [TTS controls] | [status/playback] */
.dubai3-rendition-row-collapsed {
    display: grid;
    grid-template-columns: 18px 38px 70px 130px minmax(150px, 3fr) 22px minmax(150px, 3fr) 170px 66px 85px 95px;
    align-items: center;
    gap: 8px;
    padding: 3px 8px;
    margin: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0;
    transition: background 0.1s ease;
    height: 28px;
    line-height: 1.1;
    font-size: 0.7rem;
    overflow: hidden;
}

.dubai3-rendition-row-collapsed > * {
    min-width: 0;
}

.dubai3-rendition-row-collapsed:hover {
    background: var(--surface-hover);
}

.dubai3-rendition-row-collapsed.has-final-tts {
    background: rgba(16, 185, 129, 0.03);
    border-bottom-color: rgba(16, 185, 129, 0.15);
}

.dubai3-rendition-row-collapsed.has-final-tts:hover {
    background: rgba(16, 185, 129, 0.06);
}

.dubai3-rendition-row-collapsed.has-tts-no-final {
    background: rgba(239, 68, 68, 0.02);
    border-bottom-color: rgba(239, 68, 68, 0.1);
}

.dubai3-rendition-row-collapsed.has-tts-no-final:hover {
    background: rgba(239, 68, 68, 0.04);
}

.dubai3-rendition-row-collapsed .dubai3-segment-num {
    font-weight: 700;
    color: var(--secondary-color);
    font-size: 0.7rem;
    line-height: 1;
    text-align: center;
}

.dubai3-rendition-row-collapsed .dubai3-segment-checkbox {
    width: 13px;
    height: 13px;
    margin: 0;
}

.dubai3-collapsed-speaker {
    font-size: 0.68rem;
    color: #6366f1;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
}

.dubai3-collapsed-time {
    font-size: 0.63rem;
    font-family: 'Monaco', 'Courier New', monospace;
    color: var(--text-secondary);
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
}

.dubai3-collapsed-text {
    font-size: 0.7rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1;
    min-width: 0;
    max-width: 100%;
}

.dubai3-collapsed-text.original {
    padding-left: 12px; /* Extra space after time column without shifting layout */
}

.dubai3-collapsed-text.translated {
    color: #6366f1;
}

/* Dubai 4 Studio - Collapsed view polish */
.dubai4-layout.dubai4-studio-mode .dubai3-rendition-row-collapsed {
    /* Reduce translated text column (7th) to match original text (5th) - both 1.5fr */
    grid-template-columns: 18px 38px 70px 130px minmax(100px, 1.5fr) 22px minmax(100px, 1.5fr) 170px 66px 85px 95px;
    gap: 6px;
    padding: 4px 10px;
    min-height: 30px;
    height: auto;
    line-height: 1.4;
    background: var(--surface);
    overflow: visible;
}

.dubai4-layout.dubai4-studio-mode .dubai3-rendition-row-collapsed:hover {
    background: var(--surface-hover);
}

.dubai4-layout.dubai4-studio-mode .dubai3-collapsed-text {
    font-size: 0.72rem;
    overflow: visible;
    line-height: 1.4;
}

/* Visual group separators for Dubai 4 Studio */
.dubai4-layout.dubai4-studio-mode .dubai3-collapsed-text.original {
    padding-left: 10px;
    border-left: 1px solid var(--border-color);
}

/* Move actions and scores left to be close to versions */
.dubai4-layout.dubai4-studio-mode .dubai3-collapsed-actions {
    margin-left: -230px;
}

.dubai4-layout.dubai4-studio-mode .dubai3-collapsed-scores {
    margin-left: -210px; /* Less negative than actions to create gap after final button */
}

/* Play buttons positioning in Dubai 4 Studio */
.dubai4-layout.dubai4-studio-mode .dubai3-collapsed-play {
    margin-left: -20px;
}

/* Version slots positioning in Dubai 4 Studio */
.dubai4-layout.dubai4-studio-mode .dubai3-collapsed-versions {
    margin-left: -250px;
    overflow: visible;
}

.dubai4-layout.dubai4-studio-mode .dubai3-collapsed-slot {
    width: 14px;
    height: 14px;
    font-size: 0.5rem;
}

/* Translate button alignment in Dubai 4 Studio - pulled left toward original text */
.dubai4-layout.dubai4-studio-mode .dubai3-collapsed-translate-btn {
    margin-left: -200px;
    margin-right: 6px;
}

/* Translated text alignment in Dubai 4 Studio - follows translate button */
.dubai4-layout.dubai4-studio-mode .dubai3-collapsed-text.translated {
    margin-left: -130px;
}

.dubai3-collapsed-translate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: none;
    background: rgba(99, 102, 241, 0.08);
    color: #6366f1;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    flex-shrink: 0;
}

.dubai3-collapsed-translate-btn:hover {
    background: rgba(99, 102, 241, 0.2);
}

.dubai3-collapsed-translate-btn svg {
    width: 11px;
    height: 11px;
}

.dubai3-collapsed-versions {
    display: flex;
    align-items: center;
    gap: 2px;
    justify-content: flex-start;
    overflow: visible;
    padding: 2px 0;
    margin-left: 12px; /* Extra space before TTS controls group */
}

.dubai3-collapsed-slot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 600;
    line-height: 1;
}

.dubai3-collapsed-slot.empty {
    background: #fff;
    border: 1px solid #a78bfa;
    color: #a78bfa;
}

.dubai3-collapsed-slot.has-version {
    background: #6366f1;
    border: 1px solid #6366f1;
    color: #fff;
}

.dubai3-collapsed-slot.active {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
}

.dubai3-collapsed-slot.final {
    background: linear-gradient(135deg, #22c55e, #10b981);
    border-color: #22c55e;
    color: #fff;
}

.dubai3-collapsed-slot:hover {
    transform: scale(1.1);
}

.dubai3-collapsed-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    justify-content: flex-start;
    overflow: hidden;
    flex-shrink: 0;
}

.dubai3-collapsed-gen-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: none;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #c084fc 100%);
    color: white;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.dubai3-collapsed-gen-btn svg {
    width: 10px;
    height: 10px;
}

.dubai3-collapsed-gen-btn:hover {
    transform: scale(1.05);
}

/* TTS button state: has TTS (green) */
.dubai3-collapsed-gen-btn.done {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}

/* TTS button state: processing (orange) */
.dubai3-collapsed-gen-btn.processing {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    animation: pulse-generate 1.5s ease-in-out infinite;
}

/* TTS button state: error (red) */
.dubai3-collapsed-gen-btn.error {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
}

.dubai3-collapsed-edit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    background: transparent;
    color: #6366f1;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.dubai3-collapsed-edit-btn svg {
    width: 10px;
    height: 10px;
}

.dubai3-collapsed-edit-btn:hover:not(.disabled) {
    background: rgba(99, 102, 241, 0.1);
    border-color: #6366f1;
}

.dubai3-collapsed-edit-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.dubai3-collapsed-final-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: transparent;
    color: #ef4444;
    border-radius: 3px;
    font-size: 0.55rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.dubai3-collapsed-final-btn.is-final {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    border-color: transparent;
    color: white;
}

.dubai3-collapsed-final-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.dubai3-collapsed-scores {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    overflow: hidden;
    flex-shrink: 0;
    margin-left: 12px; /* Extra space before status/playback group */
}

.dubai3-collapsed-score {
    font-size: 0.58rem;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 2px;
    flex-shrink: 0;
}

.dubai3-collapsed-score.energy {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.dubai3-collapsed-score.pitch {
    color: #f97316;
    background: rgba(249, 115, 22, 0.1);
}

.dubai3-collapsed-play {
    display: flex;
    align-items: center;
    gap: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

.dubai3-collapsed-play-btn {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px 5px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 3px;
    font-size: 0.58rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.dubai3-collapsed-play-btn svg {
    width: 9px;
    height: 9px;
}

.dubai3-collapsed-play-btn.source {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.dubai3-collapsed-play-btn.source:hover {
    background: rgba(139, 92, 246, 0.1);
}

.dubai3-collapsed-play-btn.tts {
    border-color: #10b981;
    color: #10b981;
}

.dubai3-collapsed-play-btn.tts:hover:not(.disabled) {
    background: rgba(16, 185, 129, 0.1);
}

.dubai3-collapsed-play-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* Remove TTS button in collapsed view - hidden by default */
.dubai3-collapsed-remove-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1px solid #ef4444;
    background: transparent;
    color: #ef4444;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    opacity: 0;
    visibility: hidden;
    margin-left: 7px; /* 10px gap total (3px from container gap + 7px) */
}

.dubai3-collapsed-remove-btn svg {
    width: 10px;
    height: 10px;
}

.dubai3-collapsed-remove-btn:hover:not(.disabled) {
    background: rgba(239, 68, 68, 0.1);
}

.dubai3-collapsed-remove-btn.disabled {
    opacity: 0;
    cursor: not-allowed;
}

/* Show remove button on row hover */
.dubai3-rendition-row-collapsed:hover .dubai3-collapsed-remove-btn:not(.disabled) {
    opacity: 1;
    visibility: visible;
}

/* New Rendition Row V2 */
.dubai3-rendition-row-v2 {
    display: grid;
    grid-template-columns: 1fr 320px 4px 2fr;
    gap: 0.35rem;
    background: linear-gradient(135deg, var(--surface) 0%, rgba(99, 102, 241, 0.02) 100%);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.35rem 0.5rem;
    transition: all 0.2s ease;
    align-items: stretch;
    height: 125px;
    min-height: 125px;
    max-height: 125px;
    overflow: hidden;
    box-sizing: border-box;
}

/* Original column - hidden by default */
.dubai3-original-column {
    display: none;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
}

.dubai3-original-text-content {
    flex: 1;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-secondary);
    overflow-y: auto;
    padding: 0.5rem;
    background: rgba(99, 102, 241, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

/* Editable fields in original column */
.dubai3-original-column .dubai3-segment-header-v2 {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.dubai3-segment-speaker-edit {
    padding: 0.2rem 0.4rem;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 600;
    width: 100px;
    min-width: 0;
    transition: all 0.2s ease;
    cursor: text;
}

.dubai3-segment-speaker-edit:hover {
    background: rgba(99, 102, 241, 0.05);
    border-color: var(--border-color);
}

.dubai3-segment-speaker-edit:focus {
    outline: none;
    background: var(--surface);
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.dubai3-segment-time-edit {
    padding: 0.2rem 0.25rem;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-family: 'Monaco', 'Courier New', monospace;
    width: 85px;
    min-width: 0;
    transition: all 0.2s ease;
    cursor: text;
}

.dubai3-segment-time-edit:hover {
    background: rgba(99, 102, 241, 0.05);
    border-color: var(--border-color);
}

.dubai3-segment-time-edit:focus {
    outline: none;
    background: var(--surface);
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

.dubai3-time-separator {
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 500;
    margin: 0 -0.1rem;
}

.dubai3-original-text-editable {
    flex: 1;
    width: 100%;
    min-height: 0;
    padding: 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.8rem;
    line-height: 1.3;
    resize: none;
    font-family: inherit;
    overflow-y: auto;
    box-sizing: border-box;
}

.dubai3-original-text-editable:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.dubai3-orig-translate-btn {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.dubai3-orig-translate-btn:hover {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.dubai3-orig-translate-btn:active {
    background: rgba(168, 85, 247, 0.2);
    transform: scale(0.95);
}

/* Delete Segment Button */
.dubai3-delete-segment-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    opacity: 0.5;
}

.dubai3-delete-segment-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    opacity: 1;
}

.dubai3-delete-segment-btn:active {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(0.95);
}

[data-theme="dark"] .dubai3-delete-segment-btn:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Hidden delete button - only visible on row hover */
.dubai3-delete-segment-btn.dubai3-hidden-btn {
    opacity: 0;
    width: 18px;
    height: 18px;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.dubai3-segment-header-v2:hover .dubai3-delete-segment-btn.dubai3-hidden-btn {
    opacity: 0.6;
    pointer-events: auto;
}

.dubai3-segment-header-v2:hover .dubai3-delete-segment-btn.dubai3-hidden-btn:hover {
    opacity: 1;
}

/* Save original text button - green checkmark like translation save */
.dubai3-save-original-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    color: #10b981;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    opacity: 0.7;
    flex-shrink: 0;
}

.dubai3-save-original-btn:hover {
    opacity: 1;
    background: rgba(16, 185, 129, 0.1);
}

.dubai3-save-original-btn.saving {
    color: #f59e0b;
    opacity: 1;
    pointer-events: none;
}

.dubai3-save-original-btn.saving svg {
    animation: spin 1s linear infinite;
}

.dubai3-save-original-btn.saved {
    color: #10b981;
    opacity: 1;
    background: rgba(16, 185, 129, 0.15);
}

.dubai3-save-original-btn.error {
    color: #ef4444;
    opacity: 1;
}

[data-theme="dark"] .dubai3-save-original-btn:hover {
    background: rgba(16, 185, 129, 0.15);
}

/* Segment Checkbox for Merge */
.dubai3-segment-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
    border: 2px solid var(--border-color, #cbd5e1);
    border-radius: 4px;
    background: transparent;
    transition: all 0.15s ease;
    position: relative;
}

.dubai3-segment-checkbox:hover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
}

.dubai3-segment-checkbox:checked {
    background: #6366f1;
    border-color: #6366f1;
}

.dubai3-segment-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.dubai3-segment-checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .dubai3-segment-checkbox {
    border-color: #475569;
}

[data-theme="dark"] .dubai3-segment-checkbox:hover {
    border-color: #818cf8;
    background: rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .dubai3-segment-checkbox:checked {
    background: #818cf8;
    border-color: #818cf8;
}

/* Sync Button - styled like settings buttons */
.dubai3-sync-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: var(--shadow-sm);
}

.dubai3-sync-btn svg {
    color: #10b981;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.dubai3-sync-btn:hover {
    border-color: #10b981;
    background: var(--surface-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.dubai3-sync-btn:hover svg {
    transform: rotate(180deg);
}

.dubai3-sync-btn.syncing {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    pointer-events: none;
}

.dubai3-sync-btn.syncing svg {
    animation: sync-spin 1s linear infinite;
}

.dubai3-sync-btn.synced {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.dubai3-sync-btn .sync-status {
    font-size: 0.75rem;
    opacity: 0.8;
}

@keyframes sync-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

[data-theme="dark"] .dubai3-sync-btn {
    border-color: #475569;
    background: #334155;
}

[data-theme="dark"] .dubai3-sync-btn:hover {
    border-color: #34d399;
    background: rgba(52, 211, 153, 0.1);
}

[data-theme="dark"] .dubai3-sync-btn svg {
    color: #34d399;
}

/* Dubai 4 Studio mode - compact sync button */
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-sync-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border: none;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 500;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    box-shadow: none;
    transform: none;
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-sync-btn:hover {
    background: #10b981;
    color: white;
    transform: none;
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-sync-btn.syncing {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-sync-btn.synced {
    background: #10b981;
    color: white;
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-sync-btn svg {
    width: 14px;
    height: 14px;
    color: inherit;
}

/* Select All Button */
.dubai3-select-all-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid #6366f1;
    background: transparent;
    color: #6366f1;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dubai3-select-all-btn:hover {
    background: #6366f1;
    color: white;
}

.dubai3-select-all-btn:active {
    transform: scale(0.98);
}

.dubai3-select-all-btn.all-selected {
    border-color: #10b981;
    color: #10b981;
}

.dubai3-select-all-btn.all-selected:hover {
    background: #10b981;
    color: white;
}

[data-theme="dark"] .dubai3-select-all-btn {
    border-color: #818cf8;
    color: #818cf8;
}

[data-theme="dark"] .dubai3-select-all-btn:hover {
    background: #818cf8;
    color: #1e293b;
}

[data-theme="dark"] .dubai3-select-all-btn.all-selected {
    border-color: #34d399;
    color: #34d399;
}

[data-theme="dark"] .dubai3-select-all-btn.all-selected:hover {
    background: #34d399;
    color: #1e293b;
}

/* Merge Button */
.dubai3-merge-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid #f59e0b;
    background: transparent;
    color: #f59e0b;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dubai3-merge-btn:hover {
    background: #f59e0b;
    color: white;
}

.dubai3-merge-btn:active {
    transform: scale(0.98);
}

[data-theme="dark"] .dubai3-merge-btn {
    border-color: #fbbf24;
    color: #fbbf24;
}

[data-theme="dark"] .dubai3-merge-btn:hover {
    background: #fbbf24;
    color: #1e293b;
}

/* Batch TTS Button */
.dubai3-batch-tts-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid #8b5cf6;
    background: transparent;
    color: #8b5cf6;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dubai3-batch-tts-btn:hover {
    background: #8b5cf6;
    color: white;
}

.dubai3-batch-tts-btn:active {
    transform: scale(0.98);
}

[data-theme="dark"] .dubai3-batch-tts-btn {
    border-color: #a78bfa;
    color: #a78bfa;
}

[data-theme="dark"] .dubai3-batch-tts-btn:hover {
    background: #a78bfa;
    color: #1e293b;
}

/* Batch Final Button */
.dubai3-batch-final-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid #f59e0b;
    background: transparent;
    color: #f59e0b;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dubai3-batch-final-btn:hover {
    background: #f59e0b;
    color: white;
}

.dubai3-batch-final-btn:active {
    transform: scale(0.98);
}

[data-theme="dark"] .dubai3-batch-final-btn {
    border-color: #fbbf24;
    color: #fbbf24;
}

[data-theme="dark"] .dubai3-batch-final-btn:hover {
    background: #fbbf24;
    color: #1e293b;
}

/* Delete Selected Button */
.dubai3-delete-selected-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid #ef4444;
    background: transparent;
    color: #ef4444;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.dubai3-delete-selected-btn:hover {
    background: #ef4444;
    color: white;
}

.dubai3-delete-selected-btn:active {
    transform: scale(0.98);
}

[data-theme="dark"] .dubai3-delete-selected-btn {
    border-color: #f87171;
    color: #f87171;
}

[data-theme="dark"] .dubai3-delete-selected-btn:hover {
    background: #f87171;
    color: #1e293b;
}

/* Show original mode - custom proportions */
/* Original 30% | Translated 25% | TTS (320px fixed) | Graphs 30% (15% + 15%) */
.dubai3-rendition-list.show-original .dubai3-rendition-row-v2 {
    grid-template-columns: 30fr 25fr 320px 30fr;
    gap: 0.35rem;
}

.dubai3-rendition-list.show-original .dubai3-original-column {
    display: flex;
}

.dubai3-rendition-list.show-original .dubai3-segment-header-v2.hide-when-original {
    display: none;
}

/* Completely remove resizer from layout in show-original mode */
.dubai3-rendition-list.show-original .dubai3-resize-handle {
    display: none !important;
}

/* When original is shown, graphs stack takes 2fr and splits 50/50 */
.dubai3-rendition-list.show-original .dubai3-graphs-stack {
    display: flex !important;
    flex-direction: row;
    gap: 0.5rem;
}

.dubai3-rendition-list.show-original .dubai3-graph-box {
    flex: 1;
    min-width: 0;
}

.dubai3-rendition-row-v2:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

/* Row state: Has final TTS - light transparent green */
.dubai3-rendition-row-v2.has-final-tts {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.03) 100%);
    border-color: rgba(16, 185, 129, 0.25);
}

.dubai3-rendition-row-v2.has-final-tts:hover {
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.12);
}

/* Row state: Has TTS but no final - light transparent red */
.dubai3-rendition-row-v2.has-tts-no-final {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.06) 0%, rgba(239, 68, 68, 0.02) 100%);
    border-color: rgba(239, 68, 68, 0.2);
}

.dubai3-rendition-row-v2.has-tts-no-final:hover {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.1);
}

/* ==========================================
   Dubai 3.0 Rendition - Detailed View
   ========================================== */

.dubai3-detailed-view {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1rem;
}

/* Navigation Header - Compact */
.dubai3-detailed-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0.75rem;
    background: linear-gradient(135deg, var(--surface) 0%, rgba(139, 92, 246, 0.03) 100%);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.dubai3-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.5rem;
    border: 1px solid var(--secondary-color);
    background: transparent;
    color: var(--secondary-color);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai3-nav-btn:hover:not(:disabled) {
    background: rgba(139, 92, 246, 0.08);
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.15);
}

.dubai3-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.dubai3-nav-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.dubai3-nav-segment-num {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dubai3-nav-speaker {
    font-size: 0.75rem;
    color: var(--secondary-color);
    font-weight: 500;
    padding: 0.15rem 0.4rem;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 4px;
}

.dubai3-nav-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

/* Main Content */
.dubai3-detailed-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
}

/* Text Section */
.dubai3-detailed-text-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dubai3-detailed-text-box {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.dubai3-detailed-text-box label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dubai3-detailed-original-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
    padding: 0.75rem;
    background: rgba(99, 102, 241, 0.05);
    border-left: 3px solid rgba(99, 102, 241, 0.5);
    border-radius: 4px;
}

.dubai3-detailed-translated-text {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--background);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
}

.dubai3-detailed-translated-text:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.dubai3-detailed-text-box .dubai3-translate-btn {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--secondary-color);
    background: transparent;
    color: var(--secondary-color);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai3-detailed-text-box .dubai3-translate-btn:hover {
    background: rgba(139, 92, 246, 0.1);
}

/* Audio Section */
.dubai3-detailed-audio-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Waveform Box */
.dubai3-detailed-waveform-box {
    padding: 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.dubai3-detailed-waveform-box.tts {
    border-color: rgba(16, 185, 129, 0.3);
}

.dubai3-detailed-waveform-box.no-audio {
    opacity: 0.6;
}

.dubai3-detailed-waveform-box label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.dubai3-waveform-container {
    background: transparent;
    border-radius: 8px;
    min-height: 80px;
    overflow: hidden;
}

.dubai3-no-waveform {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
}

.dubai3-waveform-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
}

.dubai3-waveform-play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #c084fc 100%);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai3-waveform-play-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.dubai3-waveform-play-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.dubai3-waveform-time {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

/* TTS Controls */
.dubai3-detailed-tts-controls {
    padding: 1rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 10px;
}

.dubai3-detailed-tts-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dubai3-detailed-generate-group {
    display: flex;
    align-items: stretch;
    flex: 1;
}

.dubai3-detailed-versions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dubai3-detailed-versions label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.dubai3-version-buttons.detailed {
    display: flex;
    gap: 0.35rem;
}

/* Trim Controls */
.dubai3-trim-controls {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 8px;
}

.dubai3-trim-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.dubai3-trim-inputs {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.dubai3-trim-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dubai3-trim-input label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.dubai3-trim-input input {
    width: 80px;
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border-color);
    background: var(--background);
    color: var(--text-primary);
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', monospace;
}

.dubai3-trim-input input:focus {
    outline: none;
    border-color: var(--secondary-color);
}

.dubai3-trim-input span {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.dubai3-trim-actions {
    display: flex;
    gap: 0.75rem;
}

.dubai3-trim-apply-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #c084fc 100%);
    color: white;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai3-trim-apply-btn:hover:not(:disabled) {
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

.dubai3-trim-apply-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.dubai3-trim-reset-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai3-trim-reset-btn:hover {
    border-color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

/* Prosody Graphs - matches list view style */
.dubai3-detailed-graphs {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    align-items: stretch;
    height: 140px;
}

.dubai3-detailed-graph-box {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.dubai3-detailed-graph-box label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.dubai3-detailed-graph-box canvas {
    width: 100%;
    flex: 1;
    min-height: 0;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: block;
}

body.dark-mode .dubai3-detailed-graph-box canvas {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Loading spinner for trim button */
.dubai3-trim-apply-btn .loading-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Clickable segment number */
.dubai3-segment-num.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai3-segment-num.clickable:hover {
    color: var(--secondary-color);
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 1200px) {
    .dubai3-detailed-content {
        grid-template-columns: 1fr;
    }
    
    .dubai3-detailed-graphs {
        grid-template-columns: 1fr;
    }
}

/* Resize Handle */
.dubai3-resize-handle {
    width: 4px;
    cursor: ew-resize;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
    border-radius: 2px;
    position: relative;
    transition: background 0.2s ease;
    flex-shrink: 0;
    user-select: none;
    touch-action: none;
    z-index: 10;
}

.dubai3-resize-handle:hover {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.4) 0%, rgba(168, 85, 247, 0.4) 100%);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
}

.dubai3-resize-handle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 40px;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.3) 0%, rgba(168, 85, 247, 0.3) 100%);
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.dubai3-resize-handle:hover::before {
    opacity: 1;
}

body.dark-mode .dubai3-resize-handle {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.25) 0%, rgba(168, 85, 247, 0.25) 100%);
}

body.dark-mode .dubai3-resize-handle:hover {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.5) 0%, rgba(168, 85, 247, 0.5) 100%);
}

/* Text Section */
.dubai3-rendition-text-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.dubai3-segment-header-v2 {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
    height: 32px;
    min-height: 32px;
    max-height: 32px;
    padding: 2px 0;
    box-sizing: border-box;
}

.dubai3-segment-header-v2 .dubai3-segment-num {
    font-weight: 700;
    color: #6366f1;
    font-size: 0.75rem;
    margin-right: 0.15rem;
}

.dubai3-segment-header-v2 .dubai3-segment-checkbox {
    margin-right: 0.4rem;
}

.dubai3-segment-header-v2 .dubai3-segment-speaker {
    padding: 0.15rem 0.4rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
}

.dubai3-segment-header-v2 .dubai3-segment-time {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
}

.dubai3-header-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
}

.dubai3-header-actions .dubai3-status {
    font-size: 0.7rem;
    color: #10b981;
}

.dubai3-orig-toggle,
.dubai3-header-actions .dubai3-translate-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 0;
}

.dubai3-orig-toggle:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: #6366f1;
    color: #6366f1;
}

.dubai3-header-actions .dubai3-translate-btn:hover {
    background: #a855f7;
    border-color: #a855f7;
    color: white;
}

.dubai3-orig-toggle.expanded svg {
    transform: rotate(180deg);
}

/* Original Text (Collapsible) */
.dubai3-original-text {
    padding: 0.75rem;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 8px;
    border-left: 3px solid #6366f1;
    transition: all 0.3s ease;
}

.dubai3-original-text.collapsed {
    display: none;
}

.dubai3-original-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #6366f1;
    text-transform: uppercase;
    margin-bottom: 0.35rem;
}

.dubai3-original-content {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Original Text Textarea (shown when collapsed) */
.dubai3-original-textarea {
    min-height: 3rem;
    padding: 0.4rem;
    border: 1px solid var(--border-color);
    border-left: 3px solid #6366f1;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.05);
    color: var(--text-primary);
    font-size: 0.8rem;
    line-height: 1.3;
    resize: none;
    font-family: inherit;
    overflow-y: auto;
    box-sizing: border-box;
}

.dubai3-original-textarea.collapsed {
    display: none;
}

.dubai3-original-textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Translated Section */
.dubai3-translated-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    width: 100%;
    overflow: hidden;
    min-height: 0;
    box-sizing: border-box;
    gap: 0;
}

.dubai3-translated-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 0;
    min-height: 26px;
    height: 26px;
    flex-shrink: 0;
    padding: 2px 0;
    box-sizing: border-box;
}

/* Ensure both original and translated textareas align */
.dubai3-original-column .dubai3-segment-header-v2 {
    height: 26px;
    min-height: 26px;
    max-height: 26px;
}

.dubai3-save-translation-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    color: #10b981;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    opacity: 0.7;
}

.dubai3-save-translation-btn:hover {
    opacity: 1;
    background: rgba(16, 185, 129, 0.1);
}

.dubai3-save-translation-btn.saving {
    color: #f59e0b;
    opacity: 1;
    pointer-events: none;
}

.dubai3-save-translation-btn.saving svg {
    animation: spin 1s linear infinite;
}

.dubai3-save-translation-btn.saved {
    color: #10b981;
    opacity: 1;
    background: rgba(16, 185, 129, 0.15);
}

.dubai3-save-translation-btn.error {
    color: #ef4444;
    opacity: 1;
}

/* AI+ Retime Button */
.dubai3-retime-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.4rem;
    border: 1px solid #8b5cf6;
    border-radius: 4px;
    font-size: 0.65rem;
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-right: 0.35rem;
}

.dubai3-retime-btn:hover:not(:disabled) {
    background: rgba(139, 92, 246, 0.2);
    border-color: #7c3aed;
    color: #7c3aed;
}

.dubai3-retime-btn:disabled,
.dubai3-retime-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: var(--border-color);
    background: transparent;
    color: var(--text-muted);
}

.dubai3-retime-btn.processing {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
    color: #f59e0b;
    animation: pulse 1.5s infinite;
}

.dubai3-retime-btn.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #10b981;
}

[data-theme="dark"] .dubai3-retime-btn {
    background: rgba(139, 92, 246, 0.2);
    border-color: #a78bfa;
    color: #a78bfa;
}

[data-theme="dark"] .dubai3-retime-btn:hover:not(:disabled) {
    background: rgba(139, 92, 246, 0.3);
    border-color: #c4b5fd;
    color: #c4b5fd;
}

[data-theme="dark"] .dubai3-retime-btn:disabled,
[data-theme="dark"] .dubai3-retime-btn.disabled {
    opacity: 0.35;
    border-color: #475569;
    background: transparent;
    color: #64748b;
}

[data-theme="dark"] .dubai3-retime-btn.processing {
    background: rgba(245, 158, 11, 0.2);
    border-color: #fbbf24;
    color: #fbbf24;
}

[data-theme="dark"] .dubai3-retime-btn.success {
    background: rgba(16, 185, 129, 0.2);
    border-color: #34d399;
    color: #34d399;
}

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

.dubai3-translated-textarea {
    flex: 1;
    width: 100%;
    min-height: 0;
    padding: 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.8rem;
    line-height: 1.3;
    resize: none;
    font-family: inherit;
    overflow-y: auto;
    box-sizing: border-box;
}

.dubai3-translated-textarea:focus {
    outline: none;
    border-color: #a855f7;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

/* TTS Section - see updated rule below with grid layout */

.dubai3-tts-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dubai3-play-original-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--secondary-color);
    background: transparent;
    color: var(--secondary-color);
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    justify-content: center;
    height: 24px;
}

.dubai3-play-original-btn:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    background: rgba(139, 92, 246, 0.1);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
}

/* Play button loading state */
.dubai3-play-original-btn.loading,
.dubai3-play-tts-btn.loading {
    opacity: 0.8;
    cursor: wait;
}

.dubai3-play-original-btn.loading {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    background: rgba(139, 92, 246, 0.15);
}

.dubai3-play-tts-btn.loading {
    border-color: #10b981;
    color: #10b981;
    background: rgba(16, 185, 129, 0.15);
}

/* Play button playing state */
.dubai3-play-original-btn.playing {
    border-color: var(--secondary-color);
    color: white;
    background: var(--secondary-color);
}

.dubai3-play-tts-btn.playing {
    border-color: #10b981;
    color: white;
    background: #10b981;
}

/* Loading icon animation */
.dubai3-loading-icon {
    animation: spin 1s linear infinite;
}

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

/* Generate Button Group */
.dubai3-generate-group {
    display: flex;
    align-items: stretch;
    flex: 1;
    gap: 0;
}

.dubai3-generate-tts-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.5rem;
    border: none;
    background: transparent;
    color: white;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s ease, background 0.6s ease;
    box-shadow: 0 2px 5px rgba(139, 92, 246, 0.25);
    flex: 1;
    justify-content: center;
    height: 24px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    outline: none;
}

.dubai3-generate-tts-btn:focus {
    outline: none;
}

/* Overlay for smooth gradient transitions */
.dubai3-generate-tts-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--secondary-color) 0%, #c084fc 100%);
    opacity: 1;
    transition: opacity 0.5s ease;
    z-index: -1;
}

.dubai3-generate-tts-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
}

.dubai3-generate-tts-btn:hover {
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
    transform: translateY(-1px);
}

.dubai3-generate-tts-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.dubai3-generate-tts-btn.processing {
    box-shadow: 0 2px 5px rgba(245, 158, 11, 0.25);
    animation: pulse-generate 1.5s ease-in-out infinite;
}

.dubai3-generate-tts-btn.processing::before {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
}

.dubai3-generate-tts-btn.processing::after {
    opacity: 0;
}

.dubai3-generate-tts-btn.done {
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.dubai3-generate-tts-btn.done::before {
    opacity: 0;
}

.dubai3-generate-tts-btn.done::after {
    opacity: 1;
}

.dubai3-generate-tts-btn.error {
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.25);
}

.dubai3-generate-tts-btn.error::before {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
}

.dubai3-generate-tts-btn.error::after {
    opacity: 0;
}

@keyframes pulse-generate {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Generate + AI+ Button Group */
.dubai3-generate-btn-group {
    display: flex;
    gap: 0;
    flex: 1;
}

.dubai3-generate-btn-group .dubai3-generate-tts-btn {
    border-radius: 5px 0 0 5px;
    flex: 1;
}

.dubai3-ai-plus-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.4rem;
    border: none;
    background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
    color: white;
    border-radius: 0 5px 5px 0;
    font-size: 0.65rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(14, 165, 233, 0.25);
    height: 24px;
    min-width: 32px;
    position: relative;
    overflow: hidden;
}

.dubai3-ai-plus-btn:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.35);
    transform: translateY(-1px);
}

.dubai3-ai-plus-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.dubai3-ai-plus-btn.processing {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    box-shadow: 0 2px 5px rgba(245, 158, 11, 0.25);
    animation: pulse-generate 1.5s ease-in-out infinite;
}

.dubai3-ai-plus-btn.done {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.dubai3-ai-plus-btn.error {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.25);
}

.dubai3-ai-btn-text {
    font-weight: 700;
    white-space: nowrap;
}

.dubai3-gen-icon {
    flex-shrink: 0;
}

.dubai3-gen-btn-text {
    font-weight: 600;
    white-space: nowrap;
}

/* Model Dropdown - Standalone Style */
.dubai3-gen-model-select {
    flex: 1;
    height: 24px;
    padding: 0 0.25rem;
    padding-right: 14px;
    border: 1px solid var(--secondary-color);
    background: transparent;
    color: var(--secondary-color);
    border-radius: 5px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    text-align: center;
    text-indent: -2px;
    /* Custom arrow icon */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238b5cf6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 3px center;
}

.dubai3-gen-model-select:hover {
    background-color: rgba(139, 92, 246, 0.1);
    border-color: var(--secondary-color);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

.dubai3-gen-model-select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15), 0 2px 8px rgba(139, 92, 246, 0.2);
}

.dubai3-gen-model-select option {
    background: var(--surface);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.5rem;
}

.dubai3-gen-model-select option:checked {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(192, 132, 252, 0.1) 100%);
    color: var(--secondary-color);
}

.dubai3-tts-header .dubai3-tts-status {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Version Buttons */
.dubai3-version-buttons {
    display: flex;
    gap: 0.25rem;
}

.dubai3-version-btn {
    width: 22px;
    height: 22px;
    border: 2px solid var(--secondary-color);
    background: white;
    color: var(--text-secondary);
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 600;
    cursor: pointer;
    opacity: 1;
    transition: all 0.2s ease;
}

/* Empty slots - white with purple frame */
.dubai3-version-btn.empty-slot {
    background: white;
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    opacity: 0.7;
}

.dubai3-version-btn.empty-slot:hover {
    opacity: 1;
    background: rgba(139, 92, 246, 0.08);
    box-shadow: 0 1px 4px rgba(139, 92, 246, 0.2);
}

/* Empty slot selected as target - highlighted */
.dubai3-version-btn.empty-slot.slot-target {
    opacity: 1;
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25);
}

/* Made but inactive TTS renditions - light purple */
.dubai3-version-btn.has-version {
    opacity: 1;
    cursor: pointer;
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.15);
    color: var(--secondary-color);
}

/* Version "more" indicator for condensed slot display */
.dubai3-version-more {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed var(--secondary-color);
    background: transparent;
    color: var(--secondary-color);
    border-radius: 4px;
    font-size: 0.55rem;
    font-weight: 600;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.dubai3-version-more:hover {
    opacity: 1;
    background: rgba(139, 92, 246, 0.08);
}

.dubai3-version-btn.has-version:hover {
    border-color: var(--secondary-color);
    background: rgba(139, 92, 246, 0.25);
}

/* Has version and selected as target - ring around */
.dubai3-version-btn.has-version.slot-target {
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.35);
}

/* Active TTS rendition - solid purple */
.dubai3-version-btn.selected {
    background: linear-gradient(135deg, var(--secondary-color) 0%, #c084fc 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.3);
}

/* Final marker - green ring */
.dubai3-version-btn.final {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

/* Final and selected - green gradient */
.dubai3-version-btn.final.selected {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

/* Final but NOT selected - light green background */
.dubai3-version-btn.final:not(.selected) {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #10b981;
}

/* Playback Buttons - Inline */
.dubai3-play-tts-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid #10b981;
    background: transparent;
    color: #10b981;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.2s ease;
    flex: 1;
    justify-content: center;
    height: 24px;
}

.dubai3-play-tts-btn:hover:not(.disabled) {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.dubai3-play-tts-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* Edit TTS button - Blue/Indigo */
.dubai3-edit-tts-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid #6366f1;
    background: transparent;
    color: #6366f1;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    height: 24px;
    flex: 1;
}

.dubai3-edit-tts-btn:hover:not(.disabled) {
    background: rgba(99, 102, 241, 0.1);
    border-color: #6366f1;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.dubai3-edit-tts-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* Remove TTS button - Orange */
.dubai3-remove-tts-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid #f59e0b;
    background: transparent;
    color: #f59e0b;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    height: 24px;
    flex: 1;
}

.dubai3-remove-tts-btn:hover:not(.disabled) {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.dubai3-remove-tts-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: var(--border-color);
    color: var(--text-secondary);
}

/* Final button - Red when not set */
.dubai3-mark-final-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    border: 1px solid rgba(239, 68, 68, 0.4);
    background: transparent;
    color: #ef4444;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    height: 24px;
    flex: 1;
}

.dubai3-mark-final-btn:hover:not(.disabled) {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

/* Final button - Green when set */
.dubai3-mark-final-btn.is-final {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.dubai3-mark-final-btn.is-final:hover:not(.disabled) {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.45);
}

.dubai3-mark-final-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* TTS Section */
.dubai3-rendition-tts-section {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.4rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(99, 102, 241, 0.03) 100%);
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.15);
    transition: all 0.2s ease;
    width: 100%;
    max-width: 320px;
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.dubai3-rendition-tts-section:hover {
    border-color: rgba(16, 185, 129, 0.25);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.08);
}

/* Row 1: Model - Edit - Remove - Final */
.dubai3-tts-row-1 {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding-bottom: 0.2rem;
    border-bottom: 1px solid rgba(16, 185, 129, 0.1);
    justify-content: stretch;
    flex-shrink: 0;
    height: 28px;
    min-height: 28px;
}

/* Row 2: Version Buttons */
.dubai3-tts-row-2 {
    display: flex;
    align-items: center;
    padding: 0.2rem 0;
    border-bottom: 1px solid rgba(16, 185, 129, 0.1);
    flex-shrink: 0;
    height: 28px;
    min-height: 28px;
}

.dubai3-tts-row-2 .dubai3-version-buttons {
    width: 100%;
    justify-content: space-between;
}

/* Row 3: Generate - Play Source - Play TTS */
.dubai3-tts-row-3 {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding-top: 0.2rem;
    flex-shrink: 0;
    justify-content: stretch;
    height: 28px;
    min-height: 28px;
}

/* Graphs Stack - SIDE BY SIDE */
.dubai3-graphs-stack {
    display: flex;
    flex-direction: row;
    gap: 0.75rem;
    align-items: stretch;
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.dubai3-graph-box {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* Graph Column - Energy on top, Pitch below (each 50% height) */
.dubai3-graph-column {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    height: 100%;
    gap: 0.25rem;
    overflow: hidden;
    box-sizing: border-box;
}

.dubai3-graph-column .dubai3-graph-box {
    flex: 1;
    height: 50%;
    min-height: 0;
}

.dubai3-graph-box canvas.dubai3-graph-canvas {
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: block;
}

body.dark-mode .dubai3-graph-box canvas.dubai3-graph-canvas {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Responsive Layout */
@media (max-width: 1400px) {
    .dubai3-rendition-row-v2 {
        grid-template-columns: 1fr 300px 4px 1.5fr;
    }
}

@media (max-width: 1024px) {
    .dubai3-rendition-row-v2 {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        height: auto;
        min-height: auto;
        max-height: none;
    }
    
    .dubai3-resize-handle {
        display: none;
    }
    
    .dubai3-rendition-tts-section {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }
    
    .dubai3-graphs-stack {
        min-height: 120px;
    }
}

/* Legacy support */
.dubai3-rendition-row {
    display: grid;
    grid-template-columns: 1fr 1fr 120px 180px 180px;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--surface) 0%, rgba(99, 102, 241, 0.01) 100%);
    border: 1px solid var(--border-color);
    border-left: 3px solid #6366f1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    border-radius: 10px;
    padding: 0.75rem;
    align-items: stretch;
}

.dubai3-col {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.dubai3-segment-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    flex-wrap: wrap;
}

.dubai3-segment-num {
    font-weight: 600;
    color: #6366f1;
}

.dubai3-segment-speaker {
    color: var(--text-primary);
    font-weight: 500;
}

.dubai3-segment-time {
    color: var(--text-secondary);
    font-family: monospace;
}

.dubai3-text-area {
    flex: 1;
    min-height: 60px;
    resize: none;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.85rem;
    background: var(--surface);
    color: var(--text-primary);
    font-family: inherit;
}

.dubai3-translate-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dubai3-mini-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.dubai3-mini-btn:hover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
}

.dubai3-status {
    font-size: 0.75rem;
    color: #10b981;
}

/* Playback */
.dubai3-playback-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: center;
}

.dubai3-playback-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.dubai3-playback-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    width: 25px;
}

.dubai3-play-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #10b981;
    background: transparent;
    color: #10b981;
    cursor: pointer;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dubai3-play-btn:hover {
    background: #10b981;
    color: white;
}

.dubai3-play-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.dubai3-tts-status {
    font-size: 0.7rem;
    color: #10b981;
}

/* Graphs */
.dubai3-graph-container {
    height: 60px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 6px;
    overflow: hidden;
}

.dubai3-graph-canvas {
    width: 100%;
    height: 100%;
}

.dubai3-rendition-footer {
    display: flex;
    justify-content: flex-end;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

/* Step 5: Render */
.dubai3-render-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0.5rem;
}

.dubai3-render-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.dubai3-summary-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.06) 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    transition: all 0.25s ease;
}

.dubai3-summary-card:hover {
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.12);
    transform: translateY(-2px);
}

.dubai3-summary-value {
    font-size: 2.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dubai3-summary-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dubai3-summary-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.1) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.75rem;
    color: #6366f1;
}

.dubai3-render-languages h3 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(99, 102, 241, 0.1);
}

.dubai3-render-languages h3 svg {
    color: #6366f1;
}

/* Empty State */
.dubai3-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.03) 100%);
    border: 1px dashed rgba(99, 102, 241, 0.2);
    border-radius: 16px;
}

.dubai3-empty-icon {
    color: #6366f1;
    opacity: 0.4;
    margin-bottom: 1.5rem;
}

.dubai3-empty-state h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.dubai3-empty-state p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 400px;
}

.dubai3-language-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.dubai3-language-card {
    background: linear-gradient(135deg, var(--surface) 0%, rgba(99, 102, 241, 0.02) 100%);
    border: 1px solid var(--border-color);
    border-left: 4px solid #6366f1;
    border-radius: 14px;
    padding: 1.5rem;
    transition: all 0.25s ease;
}

.dubai3-language-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
    border-color: rgba(99, 102, 241, 0.3);
}

.dubai3-lang-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.dubai3-lang-info h4 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dubai3-lang-info h4 span.dubai3-lang-code {
    font-weight: 400;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-left: 0.25rem;
}

.dubai3-lang-flag {
    font-size: 1.3rem;
    margin-right: 0.5rem;
    vertical-align: middle;
}

.dubai3-ready-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(34, 197, 94, 0.1) 100%);
    color: #10b981;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 20px;
    margin-left: 0.75rem;
}

.dubai3-language-card.ready {
    border-left-color: #10b981;
}

.dubai3-render-btn.ready {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.dubai3-render-btn.ready:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.dubai3-stat-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.dubai3-stat-label svg {
    opacity: 0.7;
}

.dubai3-render-btn {
    padding: 0.7rem 1.5rem;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.dubai3-render-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

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

.dubai3-render-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.dubai3-lang-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dubai3-lang-stat {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.dubai3-stat-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 4px;
    overflow: hidden;
}

[data-theme="dark"] .dubai3-stat-bar {
    background: rgba(255, 255, 255, 0.1);
}

.dubai3-stat-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.dubai3-stat-fill.translation {
    background: linear-gradient(90deg, #6366f1 0%, #a855f7 100%);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.dubai3-stat-fill.tts {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.dubai3-stat-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.dubai3-stat-info span:first-child {
    font-weight: 700;
    color: var(--text-primary);
}

.dubai3-render-options {
    display: flex;
    gap: 2rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(99, 102, 241, 0.1);
}

.dubai3-checkbox {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
}

.dubai3-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #6366f1;
    cursor: pointer;
}

.dubai3-format-select {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.dubai3-format-select select {
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai3-format-select select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.dubai3-render-progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.25rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.05) 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 10px;
    color: var(--text-primary);
    font-weight: 600;
}

.dubai3-render-result {
    margin-top: 2rem;
    border-radius: 16px;
    overflow: hidden;
}

.dubai3-result-success {
    text-align: center;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(34, 197, 94, 0.08) 100%);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 16px;
    padding: 2.5rem;
}

.dubai3-result-success .dubai3-result-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1.25rem;
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
}

.dubai3-result-success h3 {
    color: #10b981;
    margin-bottom: 0.5rem;
}

.dubai3-job-id {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 1rem 0;
}

.dubai3-job-id code {
    background: rgba(0, 0, 0, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.dubai3-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 2rem;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
    margin-top: 1rem;
}

.dubai3-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.45);
}

.dubai3-job-id {
    margin: 1rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.dubai3-job-id code {
    background: rgba(99, 102, 241, 0.1);
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    font-size: 0.8rem;
    color: #6366f1;
}

.dubai3-info {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 0.75rem;
}

.dubai3-result-error {
    text-align: center;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(239, 68, 68, 0.06) 100%);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 16px;
    padding: 2.5rem;
}

.dubai3-result-error .dubai3-result-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1.25rem;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.35);
}

.dubai3-result-error h3 {
    color: #ef4444;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.dubai3-result-error p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Dark Mode - Rendition & Render */
[data-theme="dark"] .dubai3-settings-panel-half {
    background: linear-gradient(135deg, var(--surface) 0%, rgba(99, 102, 241, 0.05) 100%);
}

[data-theme="dark"] .dubai3-settings-panel-half.tts {
    background: linear-gradient(135deg, var(--surface) 0%, rgba(168, 85, 247, 0.05) 100%);
}

[data-theme="dark"] .dubai3-settings-content {
    background: rgba(99, 102, 241, 0.06);
}

[data-theme="dark"] .dubai3-settings-panel-half.tts .dubai3-settings-content {
    background: rgba(168, 85, 247, 0.06);
}

[data-theme="dark"] .dubai3-rendition-headers {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.08) 100%);
}

[data-theme="dark"] .dubai3-rendition-row {
    background: linear-gradient(135deg, var(--surface) 0%, rgba(99, 102, 241, 0.03) 100%);
}

[data-theme="dark"] .dubai3-language-card {
    background: linear-gradient(135deg, var(--surface) 0%, rgba(99, 102, 241, 0.04) 100%);
}

[data-theme="dark"] .dubai3-summary-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(168, 85, 247, 0.1) 100%);
}

/* Responsive - Rendition & Render */
@media (max-width: 1024px) {
    .dubai3-rendition-headers,
    .dubai3-rendition-row {
        grid-template-columns: 1fr 1fr 100px;
    }
    
    .dubai3-col-energy,
    .dubai3-col-pitch,
    .dubai3-rendition-row .dubai3-col:nth-child(4),
    .dubai3-rendition-row .dubai3-col:nth-child(5) {
        display: none;
    }
}

@media (max-width: 768px) {
    .dubai3-settings-row-split {
        grid-template-columns: 1fr;
    }
    
    .dubai3-rendition-headers,
    .dubai3-rendition-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .dubai3-rendition-headers {
        display: none;
    }
    
    .dubai3-rendition-row {
        padding: 1rem;
    }
    
    .dubai3-col-playback {
        flex-direction: row;
        justify-content: flex-start;
    }
    
    .dubai3-render-summary {
        grid-template-columns: 1fr;
    }
    
    .dubai3-render-options {
        flex-direction: column;
        gap: 1rem;
    }
    
    .dubai3-lang-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .dubai3-render-btn {
        width: 100%;
    }
}

/* Nav item new badge */
.nav-item-new {
    position: relative;
}

.nav-item-new::after {
    content: 'NEW';
    position: absolute;
    top: -6px;
    right: -8px;
    font-size: 0.5rem;
    font-weight: 700;
    padding: 0.1rem 0.25rem;
    background: linear-gradient(135deg, #ec4899, #f97316);
    color: white;
    border-radius: 3px;
}

/* Empty State */
.dubai3-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.dubai3-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.dubai3-empty-state p {
    color: var(--text-secondary);
}

.dubai3-empty-segments {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 1024px) {
    .dubai3-rendition-headers,
    .dubai3-rendition-row {
        grid-template-columns: 1fr 1fr 80px;
    }
    
    .dubai3-col-energy,
    .dubai3-col-pitch,
    .dubai3-col.dubai3-col-energy,
    .dubai3-col.dubai3-col-pitch {
        display: none;
    }
}

@media (max-width: 768px) {
    .dubai3-layout {
        padding: 0.75rem;
    }
    
    .dubai3-step-component {
        padding: 1rem;
    }
    
    .dubai3-form-row {
        flex-direction: column;
    }
    
    .dubai3-phase-nav {
        flex-wrap: wrap;
    }
    
    .dubai3-segment-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .dubai3-segment-times-compact {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        margin-top: 0.25rem;
    }
    
    .dubai3-rendition-headers,
    .dubai3-rendition-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .dubai3-col-playback {
        flex-direction: row;
        justify-content: flex-start;
    }
}

/* Dubai 3.0 - Detailed View Styles */
.dubai3-detailed-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 1rem;
    padding: 0.5rem;
}

.dubai3-detailed-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.4rem 0.75rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.03) 100%);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 8px;
    backdrop-filter: blur(8px);
}

.dubai3-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(99, 102, 241, 0.2);
    background: linear-gradient(135deg, var(--surface) 0%, rgba(99, 102, 241, 0.03) 100%);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: none;
}

.dubai3-nav-btn svg {
    width: 14px;
    height: 14px;
    opacity: 0.7;
    transition: all 0.2s ease;
}

.dubai3-nav-btn:hover:not(.disabled) {
    border-color: #6366f1;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.05) 100%);
    color: #6366f1;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
    transform: translateY(-1px);
}

.dubai3-nav-btn:hover:not(.disabled) svg {
    opacity: 1;
}

.dubai3-nav-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: var(--surface);
}

.dubai3-nav-counter {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 10px;
}

.dubai3-segment-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    overflow-y: auto;
}

.dubai3-editor-header {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.dubai3-editor-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 100px;
}

.dubai3-editor-field label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dubai3-editor-field input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--surface);
    color: var(--text-primary);
    font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
    min-width: 110px;
}

.dubai3-editor-field input:focus {
    outline: none;
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
}

.dubai3-duration-display {
    padding: 0.5rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 6px;
    font-weight: 600;
    color: #6366f1;
}

.dubai3-segment-waveform {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.dubai3-detailed-waveform {
    height: 120px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

[data-theme="dark"] .dubai3-detailed-waveform {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
}

.dubai3-segment-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dubai3-play-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    border: 2px solid #10b981;
    background: transparent;
    color: #10b981;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai3-play-btn:hover {
    background: #10b981;
    color: white;
}

.dubai3-text-editor {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-height: 150px;
}

.dubai3-text-editor label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dubai3-detailed-textarea {
    flex: 1;
    min-height: 100px;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.6;
    background: var(--surface);
    color: var(--text-primary);
    font-family: inherit;
    resize: none;
}

.dubai3-detailed-textarea:focus {
    outline: none;
    border-color: #6366f1;
}

/* Dubai 3.0 - Detailed View Card */
.dubai3-detailed-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    background: linear-gradient(180deg, var(--surface) 0%, rgba(99, 102, 241, 0.02) 100%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    overflow-y: auto;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .dubai3-detailed-card {
    background: linear-gradient(180deg, var(--surface) 0%, rgba(99, 102, 241, 0.03) 100%);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.dubai3-detailed-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.dubai3-detailed-speaker {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dubai3-detailed-speaker-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dubai3-detailed-speaker-input {
    padding: 0.5rem 0.9rem;
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, transparent 100%);
    color: var(--text-primary);
    min-width: 140px;
    transition: all 0.2s ease;
}

.dubai3-detailed-speaker-input:focus {
    outline: none;
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.dubai3-detailed-times {
    display: flex;
    gap: 1rem;
    margin-left: auto;
}

.dubai3-detailed-time-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.dubai3-detailed-time-group label {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.dubai3-detailed-time-group input {
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
    background: var(--surface);
    color: var(--text-primary);
    min-width: 115px;
    transition: all 0.2s ease;
}

.dubai3-detailed-time-group input:focus {
    outline: none;
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.dubai3-detailed-time-group.duration {
    align-items: flex-end;
}

.dubai3-detailed-duration {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.1) 100%);
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #6366f1;
    font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
}

/* Editor Toolbar */
.dubai3-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.05) 100%);
    border: 1px solid rgba(99, 102, 241, 0.12);
    border-radius: 12px;
}

.dubai3-mode-buttons {
    display: flex;
    gap: 0.5rem;
}

.dubai3-mode-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(99, 102, 241, 0.15);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.dubai3-mode-btn svg {
    opacity: 0.6;
}

.dubai3-mode-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.dubai3-mode-btn:hover svg {
    opacity: 1;
}

.dubai3-mode-btn.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.dubai3-mode-btn.active svg {
    opacity: 1;
}

.dubai3-expand-buttons {
    display: flex;
    gap: 0.5rem;
}

.dubai3-expand-btn {
    padding: 0.55rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.25);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, transparent 100%);
    color: #10b981;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
}

.dubai3-expand-btn:hover {
    border-color: #10b981;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
    transform: translateY(-1px);
}

/* Waveform Section */
.dubai3-detailed-waveform-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dubai3-detailed-waveform-inner {
    height: 200px;
    background: linear-gradient(180deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] .dubai3-detailed-waveform-inner {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

.dubai3-detailed-controls {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.04) 0%, transparent 100%);
    border-radius: 10px;
}

.dubai3-detailed-play-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid transparent;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.dubai3-detailed-play-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.45);
}

.dubai3-detailed-play-btn:active {
    transform: scale(0.95);
}

.dubai3-detailed-time-display {
    font-size: 0.95rem;
    font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
    color: var(--text-secondary);
    background: rgba(99, 102, 241, 0.08);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
}

.dubai3-mode-actions {
    flex: 1;
    display: flex;
    justify-content: center;
}

.dubai3-action-btn {
    padding: 0.6rem 1.5rem;
    border-radius: 10px;
    border: none;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.dubai3-action-btn.primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

.dubai3-action-btn.primary:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.dubai3-scrub-hint {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
    padding: 0.4rem 0.8rem;
    background: rgba(99, 102, 241, 0.06);
    border-radius: 6px;
}

.dubai3-detailed-delete-btn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, 0.25);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05) 0%, transparent 100%);
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    margin-left: auto;
}

.dubai3-detailed-delete-btn:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}

/* Text Section */
.dubai3-detailed-text-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 140px;
}

.dubai3-detailed-text-section label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dubai3-detailed-textarea {
    flex: 1;
    min-height: 120px;
    padding: 1.25rem;
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 12px;
    font-size: 1.05rem;
    line-height: 1.7;
    background: linear-gradient(180deg, var(--surface) 0%, rgba(99, 102, 241, 0.02) 100%);
    color: var(--text-primary);
    font-family: inherit;
    resize: none;
    transition: all 0.2s ease;
}

.dubai3-detailed-textarea:focus {
    outline: none;
    border-color: #6366f1;
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.dubai3-detailed-textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* Navigation enhancements */
.dubai3-nav-index {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dubai3-nav-of {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.dubai3-nav-total {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Segment Selector (10 segments per page) */
.dubai3-segment-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.dubai3-page-info {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dubai3-segment-buttons {
    display: flex;
    gap: 0.35rem;
}

.dubai3-segment-selector-btn {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai3-segment-selector-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
}

.dubai3-segment-selector-btn.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

/* Nav button positioning */
.dubai3-nav-btn.prev {
    margin-right: auto;
}

.dubai3-nav-btn.next {
    margin-left: auto;
}

/* Responsive segment selector */
@media (max-width: 768px) {
    .dubai3-segment-selector-btn {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .dubai3-segment-buttons {
        gap: 0.25rem;
    }
}

/* Detailed View - Dark Mode Refinements */
[data-theme="dark"] .dubai3-detailed-nav {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(168, 85, 247, 0.08) 100%);
    border-color: rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .dubai3-nav-btn {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.9) 0%, rgba(51, 65, 85, 0.5) 100%);
    border-color: rgba(99, 102, 241, 0.25);
}

[data-theme="dark"] .dubai3-editor-toolbar {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(168, 85, 247, 0.08) 100%);
    border-color: rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .dubai3-mode-btn {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .dubai3-detailed-speaker-input {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(99, 102, 241, 0.25);
}

[data-theme="dark"] .dubai3-detailed-time-display {
    background: rgba(99, 102, 241, 0.15);
}

[data-theme="dark"] .dubai3-detailed-controls {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(30, 41, 59, 0.5) 100%);
}

/* Detailed View - Responsive */
@media (max-width: 768px) {
    .dubai3-detailed-nav {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.35rem 0.5rem;
    }
    
    .dubai3-nav-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .dubai3-nav-info {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.4rem;
    }
    
    .dubai3-detailed-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dubai3-detailed-times {
        margin-left: 0;
        width: 100%;
        flex-wrap: wrap;
    }
    
    .dubai3-editor-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .dubai3-mode-buttons {
        justify-content: center;
    }
    
    .dubai3-expand-buttons {
        justify-content: center;
    }
    
    .dubai3-detailed-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .dubai3-detailed-waveform-inner {
        height: 150px;
    }
}

/* Dubai 3.0 - Improved Segment Rows */
.dubai3-segment-row {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
    transition: all 0.2s ease;
    border-left: 3px solid var(--segment-color, #6366f1);
    cursor: pointer;
}

.dubai3-segment-row:hover {
    border-color: var(--segment-color, #6366f1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    background: var(--surface-hover, rgba(99, 102, 241, 0.02));
}

.dubai3-segment-row.highlighted {
    border-color: var(--segment-color, #6366f1);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, transparent 100%);
}

.dubai3-segment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .dubai3-segment-header {
    background: rgba(255, 255, 255, 0.02);
}

.dubai3-segment-index {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: white;
    flex-shrink: 0;
}

.dubai3-segment-detail-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.dubai3-segment-detail-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: #6366f1;
    color: #6366f1;
}

.dubai3-segment-detail-btn svg {
    width: 14px;
    height: 14px;
}

.dubai3-segment-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.dubai3-speaker-input {
    width: 100px;
    padding: 0.25rem 0.5rem;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    background: transparent;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.dubai3-speaker-input:hover,
.dubai3-speaker-input:focus {
    border-color: var(--border-color);
    background: var(--surface);
    outline: none;
}

.dubai3-segment-duration {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.05);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
}

.dubai3-segment-delete-btn {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s ease;
}

.dubai3-segment-row:hover .dubai3-segment-delete-btn {
    opacity: 1;
}

.dubai3-segment-delete-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.dubai3-segment-times-compact {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dubai3-time-input-compact {
    width: 95px;
    padding: 0.25rem 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
    background: var(--surface);
    color: var(--text-primary);
    text-align: center;
}

.dubai3-time-input-compact:focus {
    outline: none;
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
}

.dubai3-time-sep {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.dubai3-segment-body {
    padding: 0.25rem 0.5rem 0.35rem;
}

.dubai3-segment-text-input {
    width: 100%;
    padding: 0.35rem 0.5rem;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.3;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    resize: none;
    transition: all 0.2s ease;
    min-height: 0;
    height: auto;
    overflow: hidden;
    field-sizing: content; /* Modern browsers */
}

.dubai3-segment-text-input:hover {
    border-color: var(--border-color);
    background: rgba(0, 0, 0, 0.02);
}

.dubai3-segment-text-input:focus {
    border-color: #6366f1;
    background: #ffffff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .dubai3-segment-text-input:hover {
    background: rgba(255, 255, 255, 0.02);
}

[data-theme="dark"] .dubai3-segment-text-input:focus {
    background: #1e1e2e;
    border-color: #6366f1;
}

.dubai3-segment-play-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid var(--segment-color, #6366f1);
    background: transparent;
    color: var(--segment-color, #6366f1);
    cursor: pointer;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.dubai3-segment-play-btn:hover {
    background: var(--segment-color, #6366f1);
    color: white;
}

/* Segments List Container */
.dubai3-segments-section {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.dubai3-segments-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Waveform improvements */
.dubai3-waveform-section {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
    margin-bottom: 1rem;
}

/* Left: Playback Controls */
.dubai3-playback-controls {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    min-width: 60px;
}

/* Right: Zoom & Other Controls */
.dubai3-waveform-controls-right {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    min-width: 60px;
}

.dubai3-waveform-wrapper {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    min-height: 180px;
    display: flex;
    flex-direction: column;
}

.dubai3-zoomview {
    flex: 1;
    min-height: 120px;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.02) 0%, rgba(99, 102, 241, 0.05) 100%);
}

.dubai3-overview {
    height: 60px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.03);
    border-top: 1px solid var(--border-color);
}

[data-theme="dark"] .dubai3-zoomview {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.05) 0%, rgba(99, 102, 241, 0.1) 100%);
}

[data-theme="dark"] .dubai3-overview {
    background: rgba(255, 255, 255, 0.03);
}

/* Hide default Peaks.js point marker gray boxes - only show our custom thin lines */
.dubai3-zoomview .konvajs-content .point-marker-handle,
.dubai3-overview .konvajs-content .point-marker-handle,
.dubai3-zoomview canvas + div,
.dubai3-overview canvas + div {
    /* Target default marker elements */
}

/* Make sure only our custom markers are visible */
.dubai3-zoomview .konvajs-content,
.dubai3-overview .konvajs-content {
    pointer-events: auto;
}

.dubai3-waveform-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
}

.dubai3-waveform-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #6366f1;
    background: transparent;
    color: #6366f1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.dubai3-waveform-btn:hover {
    background: #6366f1;
    color: white;
}

.dubai3-add-segment-btn {
    border-color: #10b981;
    color: #10b981;
}

.dubai3-add-segment-btn:hover {
    background: #10b981;
    color: white;
}

/* Create Segment Modal */
.dubai3-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.dubai3-modal-content {
    background: var(--surface, #ffffff);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-width: 400px;
    max-width: 500px;
    width: 90%;
    border: 1px solid var(--border-color, #e2e8f0);
    animation: modalSlideIn 0.2s ease;
}

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

.dubai3-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color, #e2e8f0);
}

.dubai3-modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
}

.dubai3-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary, #64748b);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.dubai3-modal-close:hover {
    background: var(--surface-hover, #f1f5f9);
    color: var(--text-primary, #1e293b);
}

.dubai3-modal-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dubai3-modal-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dubai3-modal-field label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary, #64748b);
}

.dubai3-modal-input {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--surface, #ffffff);
    color: var(--text-primary, #1e293b);
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.2s ease;
}

.dubai3-modal-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.dubai3-modal-textarea {
    padding: 0.8rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--surface, #ffffff);
    color: var(--text-primary, #1e293b);
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.dubai3-modal-textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.dubai3-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color, #e2e8f0);
    background: var(--surface-secondary, #f8fafc);
    border-radius: 0 0 12px 12px;
}

.dubai3-modal-btn {
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.dubai3-modal-btn.cancel {
    background: var(--surface, #ffffff);
    color: var(--text-secondary, #64748b);
    border: 1px solid var(--border-color, #e2e8f0);
}

.dubai3-modal-btn.cancel:hover {
    background: var(--surface-hover, #f1f5f9);
}

.dubai3-modal-btn.save {
    background: #10b981;
    color: white;
}

.dubai3-modal-btn.save:hover {
    background: #059669;
}

[data-theme="dark"] .dubai3-modal-content {
    background: var(--surface, #1e293b);
    border-color: var(--border-color, #334155);
}

[data-theme="dark"] .dubai3-modal-input,
[data-theme="dark"] .dubai3-modal-textarea {
    background: var(--surface-secondary, #0f172a);
    border-color: var(--border-color, #334155);
}

[data-theme="dark"] .dubai3-modal-footer {
    background: var(--surface-secondary, #0f172a);
}

.dubai3-zoom-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.dubai3-zoom-btn {
    width: 29px;
    height: 29px;
    border-radius: 5px;
    border: 2px solid #6366f1;
    background: transparent;
    color: #6366f1;
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.dubai3-zoom-btn:hover {
    background: #6366f1;
    color: white;
}

.dubai3-zoom-btn:hover svg {
    stroke: white;
}

/* Zoom Reset Button */
.dubai3-zoom-reset-btn svg {
    width: 12px;
    height: 12px;
}

/* Skip Buttons (-5, +5) */
.dubai3-skip-btn {
    width: 29px !important;
    height: 29px !important;
    font-size: 0.65rem !important;
    font-weight: 600;
    border-radius: 5px !important;
}

.dubai3-skip-btn span {
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
}

/* Playback controls - smaller buttons */
.dubai3-playback-controls .dubai3-waveform-btn {
    width: 32px;
    height: 32px;
}

.dubai3-playback-controls .dubai3-waveform-btn svg {
    width: 12px;
    height: 12px;
}

.dubai3-playback-controls .dubai3-time-display {
    font-size: 0.6rem;
    margin-top: 0.25rem;
}

/* Right controls - smaller buttons */
.dubai3-waveform-controls-right .dubai3-waveform-btn {
    width: 32px;
    height: 32px;
}

.dubai3-waveform-controls-right .dubai3-waveform-btn svg {
    width: 12px;
    height: 12px;
}

.dubai3-zoom-level {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.dubai3-time-display {
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    color: var(--text-secondary);
    text-align: center;
}

/* Dubai 3.0 - Add Segment Button */
.dubai3-add-segment-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px dashed #6366f1;
    background: transparent;
    color: #6366f1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.dubai3-add-segment-btn:hover {
    background: #6366f1;
    color: white;
    border-style: solid;
}

/* Dubai 3.0 - Popup Styles */
.dubai3-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.dubai3-popup {
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 450px;
    overflow: hidden;
}

.dubai3-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
}

.dubai3-popup-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dubai3-popup-close {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dubai3-popup-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.dubai3-popup-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dubai3-popup-row {
    display: flex;
    gap: 1rem;
}

.dubai3-popup-row .dubai3-popup-field {
    flex: 1;
}

.dubai3-popup-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.dubai3-popup-field label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dubai3-popup-field input,
.dubai3-popup-field textarea {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    background: var(--surface);
    color: var(--text-primary);
    font-family: inherit;
}

.dubai3-popup-field input:focus,
.dubai3-popup-field textarea:focus {
    outline: none;
    border-color: #6366f1;
}

.dubai3-popup-field input[type="text"] {
    font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
}

.dubai3-popup-field textarea {
    resize: none;
    min-height: 60px;
}

.dubai3-popup-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .dubai3-popup-footer {
    background: rgba(255, 255, 255, 0.02);
}

.dubai3-popup-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.dubai3-popup-btn.secondary:hover {
    background: rgba(0, 0, 0, 0.05);
}

.dubai3-popup-btn.primary {
    border: none;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

.dubai3-popup-btn.primary:hover {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transform: translateY(-1px);
}

/* ==========================================
   TTS Waveform Editor Component
   View/Trim/Cut/Expand modes
   ========================================== */

/* Original Audio Play Button Row */
.dubai3-original-play-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(139, 92, 246, 0.03) 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.dubai3-original-play-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(99, 102, 241, 0.3);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
    color: #6366f1;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai3-original-play-btn:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.1) 100%);
    border-color: #6366f1;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.dubai3-original-play-btn svg {
    width: 14px;
    height: 14px;
}

.dubai3-original-time {
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
}

.tts-editor {
    padding: 1rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.03) 0%, rgba(139, 92, 246, 0.03) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
}

/* No background box variant */
.tts-editor.no-box {
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

/* Controls bar at the bottom */
.tts-editor-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: var(--bg-secondary, #f8fafc);
    border-radius: 8px;
}

[data-theme="dark"] .tts-editor-controls-bar,
body.dark-mode .tts-editor-controls-bar {
    background: rgba(255, 255, 255, 0.05);
}

.tts-editor.no-box .tts-editor-controls-bar .tts-editor-actions {
    margin-left: auto;
}

.tts-editor.no-box .tts-editor-controls-bar .tts-editor-actions[style*="none"] {
    display: none !important;
}

.tts-editor.no-box .tts-editor-controls-bar .tts-editor-actions:not([style*="none"]) {
    display: flex;
}

.tts-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.tts-editor-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.tts-editor-playback {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tts-editor-play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
}

.tts-editor-play-btn:hover:not(:disabled) {
    transform: scale(1.08);
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4);
}

.tts-editor-play-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tts-editor-time {
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
}

/* Mode Selector */
.tts-editor-modes {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.tts-editor-mode-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tts-editor-mode-btn:hover {
    border-color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

.tts-editor-mode-btn.active {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.tts-editor-mode-btn.trim.active {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.tts-editor-mode-btn.cut.active {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.tts-editor-mode-btn.expand.active {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

/* Help Text */
.tts-editor-help {
    padding: 0.6rem 0.85rem;
    margin-bottom: 0.75rem;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Waveform Container */
.tts-editor-waveform-wrap {
    position: relative;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    min-height: 100px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

[data-theme="dark"] .tts-editor-waveform-wrap,
body.dark-mode .tts-editor-waveform-wrap {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tts-editor-waveform {
    width: 100%;
    min-height: 100px;
}

.tts-editor-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-secondary);
    font-size: 0.85rem;
    z-index: 10;
}

body.dark-mode .tts-editor-loading,
[data-theme="dark"] .tts-editor-loading {
    background: rgba(0, 0, 0, 0.3);
}

.tts-editor-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(16, 185, 129, 0.2);
    border-top-color: #10b981;
    border-radius: 50%;
    animation: tts-spin 0.8s linear infinite;
}

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

/* Action Buttons */
.tts-editor-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.tts-editor-apply-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.3);
}

.tts-editor-apply-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(16, 185, 129, 0.4);
}

.tts-editor-apply-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.tts-editor-apply-btn.processing {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
}

.tts-editor-cancel-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tts-editor-cancel-btn:hover {
    border-color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

/* WaveSurfer region handle styling overrides */
.tts-editor-waveform wavesurfer-region {
    transition: opacity 0.15s ease;
}

.tts-editor-waveform wavesurfer-region:hover {
    opacity: 0.9;
}

/* Responsive */
@media (max-width: 768px) {
    .tts-editor-modes {
        gap: 0.35rem;
    }
    
    .tts-editor-mode-btn {
        padding: 0.4rem 0.65rem;
        font-size: 0.75rem;
    }
    
    .tts-editor-actions {
        flex-direction: column;
    }
    
    .tts-editor-apply-btn,
    .tts-editor-cancel-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ======================================
   DUBAI 4.0 STYLES
   ====================================== */

/* Full-screen layout */
.dubai4-fullscreen {
    min-height: calc(100vh - 60px);
    background: var(--background);
}

.dubai4-layout {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 60px);
}

/* Compact Icon Navigation Bar */
.dubai4-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    gap: 1rem;
}

.dubai4-nav-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dubai4-nav-actions-slot {
    display: flex;
    align-items: center;
}

.dubai4-nav-render-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 0.5rem;
    padding: 3px;
    background: var(--surface-alt, rgba(0, 0, 0, 0.03));
    border-radius: 8px;
}

.dubai4-nav-render-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.dubai4-nav-render-btn:hover {
    color: var(--text-color);
}

.dubai4-nav-render-btn.active {
    background: var(--surface);
    color: var(--primary-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.dubai4-nav-render-btn svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.dubai4-nav-render-btn:hover svg,
.dubai4-nav-render-btn.active svg {
    opacity: 1;
}

[data-theme="dark"] .dubai4-nav-render-actions {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .dubai4-nav-render-btn.active {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.dubai4-nav-steps {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dubai4-nav-step {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-light);
    font-size: 0.8rem;
    font-weight: 500;
}

.dubai4-nav-step:hover:not(.disabled) {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.dubai4-nav-step.active {
    background: var(--primary-color);
    color: white;
}

.dubai4-nav-step.completed {
    color: var(--success-color);
}

.dubai4-nav-step.completed .dubai4-nav-icon {
    position: relative;
}

.dubai4-nav-step.completed .dubai4-nav-icon::after {
    content: '✓';
    position: absolute;
    bottom: -2px;
    right: -4px;
    font-size: 0.6rem;
    color: var(--success-color);
}

.dubai4-nav-step.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dubai4-nav-icon {
    font-size: 1rem;
}

.dubai4-nav-label {
    display: none;
}

@media (min-width: 768px) {
    .dubai4-nav-label {
        display: inline;
    }
}

.dubai4-nav-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dubai4-nav-project-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dubai4-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    background: var(--surface);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.dubai4-nav-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.dubai4-save-btn.saving {
    color: var(--warning-color);
}

.dubai4-save-btn.saved {
    color: var(--success-color);
}

.dubai4-save-btn.error {
    color: var(--error-color);
}

/* Step Content */
.dubai4-step-content {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.dubai4-step-wrapper {
    max-width: 1400px;
    margin: 0 auto;
}

/* Full-width mode for File Manager and Studio */
.dubai4-step-wrapper.dubai4-full-width {
    max-width: 100%;
    padding: 0 1rem;
}

/* Fullscreen mode */
.dubai4-fullscreen-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9999 !important;
    background: var(--background) !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

.dubai4-fullscreen-mode .dubai4-nav-bar {
    display: none !important;
}

.dubai4-fullscreen-mode .dubai4-step-content {
    padding: 0 !important;
    height: 100vh !important;
    overflow: hidden !important;
}

.dubai4-fullscreen-mode .dubai4-step-wrapper {
    max-width: 100% !important;
    padding: 0 !important;
    height: 100% !important;
    margin: 0 !important;
}

/* Fullscreen button */
.dubai4-fullscreen-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 0.75rem;
}

.dubai4-fullscreen-btn:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.dubai4-fullscreen-btn svg {
    width: 16px;
    height: 16px;
}

/* Exit fullscreen button (shown only in fullscreen mode) */
.dubai4-exit-fullscreen-btn {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.875rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
}

.dubai4-fullscreen-mode .dubai4-exit-fullscreen-btn {
    display: none; /* Hidden - use ESC key to exit fullscreen */
}

.dubai4-exit-fullscreen-btn:hover {
    background: var(--surface-hover);
    border-color: var(--primary-color);
}

.dubai4-step-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    margin: 0.5rem;
    border: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.04) 0%, rgba(168, 85, 247, 0.04) 100%);
    border-radius: 10px;
}

.dubai4-step-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dubai4-step-icon-large {
    display: none; /* Hide step icons from title */
}

.dubai4-header-actions-slot {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    justify-content: flex-start;
    padding-left: 1rem;
}

.dubai4-header-render-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    background: var(--surface-alt, rgba(0, 0, 0, 0.03));
    border-radius: 8px;
}

.dubai4-header-render-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.dubai4-header-render-btn:hover {
    color: var(--text-color);
}

.dubai4-header-render-btn.active {
    background: var(--surface);
    color: var(--primary-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.dubai4-header-render-btn svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.dubai4-header-render-btn:hover svg,
.dubai4-header-render-btn.active svg {
    opacity: 1;
}

[data-theme="dark"] .dubai4-header-render-actions {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .dubai4-header-render-btn.active {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.dubai4-header-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.dubai4-header-continue-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.dubai4-header-continue-btn:hover:not(:disabled) {
    filter: brightness(1.1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.dubai4-header-continue-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.dubai4-header-continue-btn:focus {
    outline: none;
}

.dubai4-header-continue-btn:focus-visible {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.5);
}

.dubai4-header-continue-btn.hidden {
    display: none;
}

/* Loading State */
.dubai4-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    gap: 1rem;
    color: var(--text-secondary);
}

.dubai4-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: dubai4-spin 0.8s linear infinite;
}

.dubai4-spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: dubai4-spin 0.8s linear infinite;
}

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

/* Form Elements */
.dubai4-form-section {
    margin-bottom: 1.5rem;
}

.dubai4-form-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.dubai4-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 200px;
}

.dubai4-form-group-large {
    flex: 2;
}

.dubai4-form-group label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.dubai4-form-group label .required {
    color: var(--error-color);
}

.dubai4-input,
.dubai4-select,
.dubai4-textarea {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8rem;
    background: var(--surface);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.dubai4-input:focus,
.dubai4-select:focus,
.dubai4-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.dubai4-select-small {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

/* Upload Area */
.dubai4-upload-section {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.2s ease;
}

.dubai4-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    padding: 2rem;
}

.dubai4-upload-area:hover,
.dubai4-upload-area.dragover {
    background: rgba(99, 102, 241, 0.05);
}

.dubai4-upload-icon {
    color: var(--text-light);
}

.dubai4-upload-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.dubai4-upload-hint {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* File Info */
.dubai4-file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--surface-hover);
    border-radius: 8px;
}

.dubai4-file-icon {
    font-size: 2rem;
}

.dubai4-file-details {
    flex: 1;
}

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

.dubai4-file-size {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.dubai4-file-remove {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--error-color);
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Progress Bar */
.dubai4-upload-progress {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dubai4-upload-progress-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dubai4-progress-bar-container {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.dubai4-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Error Message */
.dubai4-error-message {
    padding: 0.75rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error-color);
    border-radius: 8px;
    color: var(--error-color);
    font-size: 0.9rem;
}

/* Preprocessing Styles */
.dubai4-preprocessing-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 0;
}

.dubai4-phase-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0.5rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(168, 85, 247, 0.03) 100%);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.dubai4-phase-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
    background: transparent;
    position: relative;
}

.dubai4-phase-item:hover:not(.active) {
    background: rgba(99, 102, 241, 0.05);
}

.dubai4-phase-item.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.dubai4-phase-item.completed {
    color: var(--success-color);
}

.dubai4-phase-item.completed .dubai4-phase-number {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.dubai4-phase-number {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary-color);
    transition: all 0.2s ease;
}

.dubai4-phase-item.active .dubai4-phase-number {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.dubai4-phase-label {
    font-size: 0.75rem;
    letter-spacing: 0.01em;
}

.dubai4-phase-connector {
    width: 24px;
    height: 2px;
    background: linear-gradient(90deg, var(--border-color) 0%, rgba(99, 102, 241, 0.3) 100%);
    border-radius: 1px;
    margin: 0 0.25rem;
}

.dubai4-phase-item.completed + .dubai4-phase-connector {
    background: linear-gradient(90deg, var(--success-color) 0%, rgba(16, 185, 129, 0.3) 100%);
}

.dubai4-phase-content {
    padding: 0.5rem;
}

/* Track Selection */
.dubai4-track-selection {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dubai4-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dubai4-track-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.dubai4-track-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.02) 0%, rgba(168, 85, 247, 0.02) 100%);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai4-track-item:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
}

.dubai4-track-item.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.08) 100%);
    box-shadow: 0 2px 12px rgba(99, 102, 241, 0.15);
}

.dubai4-track-radio {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.dubai4-track-item:hover .dubai4-track-radio {
    border-color: var(--primary-color);
}

.dubai4-track-item.selected .dubai4-track-radio {
    border-color: var(--primary-color);
    background: var(--primary-color);
}

.dubai4-track-radio-inner {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.dubai4-track-item.selected .dubai4-track-radio-inner {
    opacity: 1;
}

.dubai4-track-info {
    flex: 1;
    min-width: 0;
}

.dubai4-track-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.dubai4-track-name {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.dubai4-track-lang {
    font-size: 0.65rem;
    padding: 0.1rem 0.4rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 4px;
    color: var(--primary-color);
    font-weight: 500;
}

.dubai4-track-stats {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dubai4-track-stat {
    font-size: 0.7rem;
    color: var(--text-secondary);
    padding: 0.1rem 0.35rem;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 3px;
}

/* Selected Track Card */
.dubai4-selected-track-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(168, 85, 247, 0.03) 100%);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.dubai4-card-icon {
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 8px;
}

.dubai4-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.dubai4-card-title {
    font-weight: 500;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.dubai4-card-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.dubai4-card-badge {
    padding: 0.2rem 0.6rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--primary-color);
}

.dubai4-card-badge.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

/* Vocal Settings Card (ASR Phase) */
.dubai4-vocal-settings-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(168, 85, 247, 0.03) 100%);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
}

.dubai4-vocal-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.dubai4-vocal-settings {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.dubai4-vocal-settings .dubai4-setting-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.dubai4-vocal-settings .dubai4-setting-group label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-weight: 500;
}

[data-theme="dark"] .dubai4-vocal-settings-card {
    background: linear-gradient(135deg, #1e293b 0%, rgba(99, 102, 241, 0.05) 100%);
}

/* Model Selection */
.dubai4-model-section {
    margin-bottom: 1rem;
}

.dubai4-section-subtitle {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.dubai4-model-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
}

.dubai4-model-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
}

.dubai4-model-option:hover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.03);
}

.dubai4-model-option.selected {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.06);
    box-shadow: 0 1px 4px rgba(99, 102, 241, 0.1);
}

.dubai4-model-option input {
    display: none;
}

.dubai4-model-radio {
    width: 14px;
    height: 14px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

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

.dubai4-model-option.selected .dubai4-model-radio {
    border-color: var(--primary-color);
    background: var(--primary-color);
    box-shadow: inset 0 0 0 2px var(--surface);
}

.dubai4-model-name {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.dubai4-model-badge {
    color: #f59e0b;
    font-size: 0.75rem;
}

/* ASR Settings */
.dubai4-asr-settings {
    margin-bottom: 1rem;
}

.dubai4-settings-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

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

.dubai4-setting-group label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-weight: 500;
}

/* Feature Notice */
.dubai4-feature-notice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06) 0%, rgba(168, 85, 247, 0.06) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 6px;
    margin-bottom: 1rem;
}

.dubai4-feature-icon {
    font-size: 1rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 6px;
}

.dubai4-feature-text {
    flex: 1;
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.dubai4-feature-text strong {
    color: var(--primary-color);
}

/* Progress and Result Sections */
.dubai4-progress-section {
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.03) 0%, rgba(168, 85, 247, 0.03) 100%);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 0.75rem;
}

.dubai4-progress-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.dubai4-result-section {
    margin-top: 0.75rem;
}

.dubai4-result-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.85rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

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

.dubai4-result-icon {
    font-size: 1rem;
}

.dubai4-asr-stats,
.dubai4-complete-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.75rem;
    justify-content: center;
}

.dubai4-stat-item {
    text-align: center;
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 6px;
}

.dubai4-stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dubai4-stat-label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Complete Section */
.dubai4-complete-section {
    display: flex;
    justify-content: center;
    padding: 1rem;
}

.dubai4-complete-card {
    text-align: center;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.03) 0%, rgba(99, 102, 241, 0.03) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 10px;
    max-width: 400px;
}

.dubai4-complete-icon {
    font-size: 2rem;
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 50%;
    color: var(--success-color);
    margin-bottom: 0.75rem;
}

.dubai4-complete-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.35rem;
    color: var(--text-primary);
}

.dubai4-complete-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.dubai4-seq-info {
    margin-top: 0.75rem;
}

.dubai4-seq-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary-color);
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* File Manager Styles */
.dubai4-filemanager-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dubai4-fm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dubai4-fm-title-section h3 {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.dubai4-fm-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.dubai4-fm-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.dubai4-fm-badge.coming-soon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.dubai4-fm-tree-container {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    min-height: 300px;
}

.dubai4-fm-tree-node {
    user-select: none;
}

.dubai4-fm-tree-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.dubai4-fm-tree-item:hover {
    background: var(--surface-hover);
}

.dubai4-fm-tree-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
}

.dubai4-fm-tree-toggle.expanded {
    transform: rotate(90deg);
}

.dubai4-fm-tree-toggle-placeholder {
    width: 16px;
}

.dubai4-fm-tree-icon {
    font-size: 1rem;
}

.dubai4-fm-tree-label {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.dubai4-fm-tree-count {
    font-size: 0.8rem;
    color: var(--text-light);
}

.dubai4-fm-tree-seq {
    font-size: 0.75rem;
    padding: 0.1rem 0.4rem;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-weight: 600;
}

.dubai4-fm-tree-children {
    padding-left: 0.5rem;
}

.dubai4-fm-info-panel {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
}

.dubai4-fm-info-icon {
    font-size: 1.5rem;
}

.dubai4-fm-info-text strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.dubai4-fm-info-text p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Studio Styles */
.dubai4-studio-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.dubai4-studio-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    text-align: center;
}

.dubai4-studio-empty .dubai4-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.dubai4-studio-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    gap: 1rem;
    flex-wrap: wrap;
}

.dubai4-toolbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dubai4-segment-count {
    font-weight: 500;
    color: var(--text-secondary);
}

.dubai4-toolbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.dubai4-toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dubai4-toolbar-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.dubai4-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    user-select: none;
}

.dubai4-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.dubai4-btn-secondary {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.dubai4-btn-secondary:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.dubai4-btn-secondary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.dubai4-btn-secondary.dubai4-btn-done {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.dubai4-btn-secondary.dubai4-btn-done:hover {
    background: #059669;
    border-color: #059669;
    color: white;
}

.dubai4-btn-primary {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    background: var(--primary-color);
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: filter 0.15s ease, box-shadow 0.15s ease;
}

.dubai4-btn-primary:hover {
    filter: brightness(1.1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Studio Table */
.dubai4-studio-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.dubai4-studio-table {
    width: 100%;
    border-collapse: collapse;
}

.dubai4-studio-table th {
    padding: 0.75rem 1rem;
    background: var(--surface-hover);
    text-align: left;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.dubai4-studio-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.dubai4-col-seq {
    width: 50px;
    text-align: center;
}

.dubai4-col-speaker {
    width: 100px;
}

.dubai4-col-tts {
    width: 60px;
    text-align: center;
}

.dubai4-seq-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
}

.dubai4-speaker-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background: var(--surface-hover);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.dubai4-text-cell {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.dubai4-translation-input {
    width: 100%;
    min-height: 60px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    resize: vertical;
    background: var(--surface);
    color: var(--text-primary);
}

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

/* Translation header with AI+ button */
.dubai4-translation-header {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 0.35rem;
}

.dubai4-list-retime-btn {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid #8b5cf6;
    border-radius: 4px;
    font-size: 0.7rem;
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai4-list-retime-btn:hover:not(:disabled) {
    background: rgba(139, 92, 246, 0.2);
    border-color: #7c3aed;
    color: #7c3aed;
}

.dubai4-list-retime-btn:disabled,
.dubai4-list-retime-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    border-color: var(--border-color);
    background: transparent;
    color: var(--text-muted);
}

.dubai4-list-retime-btn.processing {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
    color: #f59e0b;
    animation: pulse 1.5s infinite;
}

.dubai4-list-retime-btn.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #10b981;
}

[data-theme="dark"] .dubai4-list-retime-btn {
    background: rgba(139, 92, 246, 0.2);
    border-color: #a78bfa;
    color: #a78bfa;
}

[data-theme="dark"] .dubai4-list-retime-btn:hover:not(:disabled) {
    background: rgba(139, 92, 246, 0.3);
    border-color: #c4b5fd;
    color: #c4b5fd;
}

[data-theme="dark"] .dubai4-list-retime-btn:disabled,
[data-theme="dark"] .dubai4-list-retime-btn.disabled {
    opacity: 0.4;
    border-color: #475569;
    background: transparent;
    color: #64748b;
}

[data-theme="dark"] .dubai4-list-retime-btn.processing {
    background: rgba(245, 158, 11, 0.2);
    border-color: #fbbf24;
    color: #fbbf24;
}

[data-theme="dark"] .dubai4-list-retime-btn.success {
    background: rgba(16, 185, 129, 0.2);
    border-color: #34d399;
    color: #34d399;
}

.dubai4-play-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--success-color);
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
}

.dubai4-tts-pending {
    color: var(--text-light);
}

/* Render Styles */
.dubai4-render-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.dubai4-render-substeps {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dubai4-substep {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: var(--text-light);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.dubai4-substep:hover {
    background: var(--hover-bg);
}

.dubai4-substep.active {
    background: var(--primary-color);
    color: white;
}

.dubai4-substep.completed {
    color: var(--success-color);
}

.dubai4-substep-num {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
}

.dubai4-substep.active .dubai4-substep-num {
    background: rgba(255, 255, 255, 0.2);
}

.dubai4-substep-connector {
    width: 60px;
    height: 2px;
    background: var(--border-color);
}

.dubai4-substep-connector.completed {
    background: var(--success-color);
}

/* Render Summary - Compact inline stats */
.dubai4-render-summary {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.dubai4-summary-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem;
    background: var(--surface);
    border-radius: 8px;
}

.dubai4-summary-icon {
    font-size: 1.1rem;
    opacity: 0.8;
}

.dubai4-summary-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dubai4-summary-label {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Render Languages Section */
.dubai4-render-languages h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.dubai4-render-languages h3 svg {
    opacity: 0.6;
}

.dubai4-language-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Language Card - Clean two-row design */
.dubai4-language-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    background: var(--surface);
    border-radius: 8px;
    transition: background 0.15s ease;
}

.dubai4-language-card:hover {
    background: var(--surface-hover, rgba(0, 0, 0, 0.02));
}

.dubai4-language-card.ready {
    background: rgba(16, 185, 129, 0.03);
}

.dubai4-lang-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.dubai4-lang-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dubai4-lang-info h4 {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    font-weight: 500;
    margin: 0;
}

.dubai4-lang-flag {
    font-size: 1.1rem;
}

.dubai4-lang-code {
    font-size: 0.7rem;
    color: var(--text-light);
    font-weight: 400;
    text-transform: uppercase;
}

.dubai4-ready-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.4rem;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* Progress Stats - Two bars side by side */
.dubai4-lang-stats {
    display: flex;
    gap: 1.5rem;
}

.dubai4-lang-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.dubai4-stat-label {
    font-size: 0.7rem;
    color: var(--text-light);
    white-space: nowrap;
    min-width: 65px;
}

.dubai4-stat-bar {
    flex: 1;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    min-width: 60px;
}

.dubai4-stat-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.dubai4-stat-fill.translation {
    background: var(--info-color);
}

.dubai4-stat-fill.tts {
    background: var(--success-color);
}

.dubai4-stat-info {
    font-size: 0.7rem;
    color: var(--text-light);
    min-width: 35px;
    text-align: right;
}

/* Render Button - Clean minimal */
.dubai4-render-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.8rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.15s ease;
    white-space: nowrap;
}

.dubai4-render-btn:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.dubai4-render-btn.ready {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.dubai4-render-btn.ready:hover {
    filter: brightness(1.1);
}

.dubai4-render-btn svg {
    width: 14px;
    height: 14px;
}

/* Render Options - Compact inline */
.dubai4-render-options {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-top: 0.5rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.dubai4-checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
}

.dubai4-checkbox input {
    width: 14px;
    height: 14px;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.dubai4-format-select {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.dubai4-format-select label {
    color: var(--text-secondary);
}

.dubai4-format-select select {
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--background);
    color: var(--text-color);
}

.dubai4-instrumental-select select {
    min-width: 160px;
}

/* Render Progress */
.dubai4-render-progress {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--surface);
    border-radius: 6px;
    margin-top: 0.5rem;
    color: var(--text-light);
    font-size: 0.8rem;
}

/* Render Result */
.dubai4-render-result {
    margin-top: 1rem;
}

.dubai4-result-success,
.dubai4-result-error {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.dubai4-result-success {
    background: rgba(16, 185, 129, 0.05);
}

.dubai4-result-error {
    background: rgba(239, 68, 68, 0.05);
}

.dubai4-result-success .dubai4-result-icon {
    color: var(--success-color);
    font-size: 1.25rem;
}

.dubai4-result-error .dubai4-result-icon {
    color: var(--error-color);
    font-size: 1.25rem;
}

.dubai4-result-success h3,
.dubai4-result-error h3 {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
}

.dubai4-result-success p,
.dubai4-result-error p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.dubai4-job-id {
    font-size: 0.75rem;
    color: var(--text-light);
    margin: 0;
}

.dubai4-job-id code {
    background: var(--surface);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
}

.dubai4-result-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

/* Video Section */
.dubai4-video-status {
    margin-bottom: 1rem;
}

.dubai4-status-card {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    border-radius: 6px;
}

.dubai4-status-card.success {
    background: rgba(16, 185, 129, 0.05);
}

.dubai4-status-icon {
    font-size: 1rem;
    color: var(--success-color);
}

.dubai4-status-info h4 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.dubai4-status-info p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-light);
}

.dubai4-video-section {
    padding: 1rem;
    background: var(--surface);
    border-radius: 8px;
}

.dubai4-video-section h3 {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.dubai4-video-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.dubai4-option-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
}

.dubai4-option-group label:not(.dubai4-checkbox) {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.dubai4-select {
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background: var(--background);
    color: var(--text-color);
}

.dubai4-video-actions {
    display: flex;
    gap: 0.5rem;
}

/* Video Actions Bar */
.dubai4-video-actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--surface-alt, rgba(0, 0, 0, 0.02));
    border-radius: 8px;
    margin-top: 1rem;
    gap: 1rem;
}

.dubai4-video-actions-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dubai4-video-actions-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dubai4-selected-count {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
}

.dubai4-track-header {
    margin-bottom: 0.75rem;
}

.dubai4-track-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
}

.dubai4-track-hint {
    font-size: 0.75rem;
    color: var(--text-light);
    margin: 0;
}

.dubai4-track-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.dubai4-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai4-btn-icon:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

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

.dubai4-btn-icon.loading svg {
    animation: dubai4-spin 1s linear infinite;
}

@keyframes dubai4-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive video actions */
@media (max-width: 600px) {
    .dubai4-video-actions-bar {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .dubai4-video-actions-right {
        width: 100%;
        flex-direction: column;
    }
    
    .dubai4-video-actions-right button {
        width: 100%;
    }
}

/* Track Selection for Video Render */
.dubai4-video-track-section {
    margin-bottom: 1rem;
}

.dubai4-video-track-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.dubai4-video-track-section h3 svg {
    opacity: 0.6;
}

.dubai4-track-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.dubai4-track-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    background: var(--surface);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.dubai4-track-item:hover {
    background: var(--surface-hover, rgba(0, 0, 0, 0.02));
}

.dubai4-track-item.selected {
    background: rgba(99, 102, 241, 0.05);
    border-color: var(--primary-color);
}

.dubai4-track-radio {
    display: flex;
    align-items: center;
}

.dubai4-track-radio input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.dubai4-track-checkbox {
    display: flex;
    align-items: center;
}

.dubai4-track-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
    cursor: pointer;
    border-radius: 4px;
}

.dubai4-track-info {
    flex: 1;
    min-width: 0;
}

.dubai4-track-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.dubai4-track-lang {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
}

.dubai4-track-type {
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    background: var(--surface-alt, rgba(0, 0, 0, 0.04));
    border-radius: 4px;
    color: var(--text-light);
}

.dubai4-track-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.72rem;
    color: var(--text-light);
}

.dubai4-track-duration {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dubai4-track-duration svg {
    opacity: 0.6;
}

.dubai4-track-format {
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    background: var(--primary-color);
    color: white;
    border-radius: 3px;
    font-weight: 500;
}

.dubai4-track-download {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--hover-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
    cursor: pointer;
    flex-shrink: 0;
}

.dubai4-track-download:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.dubai4-track-download:active {
    transform: translateY(0);
}

/* Video Success Banner */
.dubai4-video-success-banner {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    animation: dubai4-success-appear 0.4s ease-out;
}

@keyframes dubai4-success-appear {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dubai4-success-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.dubai4-success-icon {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
}

.dubai4-success-text {
    flex: 1;
}

.dubai4-success-text h2 {
    margin: 0 0 0.25rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.dubai4-success-text p {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.dubai4-download-video-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    flex-shrink: 0;
}

.dubai4-download-video-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.dubai4-download-video-btn:active {
    transform: translateY(0);
}

.dubai4-download-video-btn svg {
    flex-shrink: 0;
}

/* Dark mode adjustments */
[data-theme="dark"] .dubai4-video-success-banner {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(16, 185, 129, 0.05) 100%);
}

[data-theme="dark"] .dubai4-track-download {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Responsive success banner */
@media (max-width: 768px) {
    .dubai4-success-content {
        flex-direction: column;
        text-align: center;
    }
    
    .dubai4-success-icon {
        width: 56px;
        height: 56px;
    }
    
    .dubai4-success-icon svg {
        width: 36px;
        height: 36px;
    }
    
    .dubai4-success-text h2 {
        font-size: 1.25rem;
    }
    
    .dubai4-download-video-btn {
        width: 100%;
        justify-content: center;
    }
}

[data-theme="dark"] .dubai4-track-item {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .dubai4-track-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .dubai4-track-item.selected {
    background: rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .dubai4-track-type {
    background: rgba(255, 255, 255, 0.08);
}

/* Version Badge */
.dubai4-version-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--primary-color);
    margin-left: auto;
}

.dubai4-badge-icon {
    font-size: 0.9rem;
}

/* Empty State */
.dubai4-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: var(--surface);
    border-radius: 8px;
}

.dubai4-empty-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.dubai4-empty-state h3 {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.dubai4-empty-state p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Hidden utility */
.dubai4-hidden,
.hidden {
    display: none !important;
}

/* Dark mode support */
[data-theme="dark"] .dubai4-nav-bar {
    background: rgba(30, 41, 59, 0.95);
}

[data-theme="dark"] .dubai4-phase-nav,
[data-theme="dark"] .dubai4-render-substeps,
[data-theme="dark"] .dubai4-selected-track-card,
[data-theme="dark"] .dubai4-video-section,
[data-theme="dark"] .dubai4-summary-card,
[data-theme="dark"] .dubai4-language-card,
[data-theme="dark"] .dubai4-fm-tree-container,
[data-theme="dark"] .dubai4-complete-card {
    background: linear-gradient(135deg, #1e293b 0%, rgba(99, 102, 241, 0.05) 100%);
}

[data-theme="dark"] .dubai4-track-item,
[data-theme="dark"] .dubai4-model-option,
[data-theme="dark"] .dubai4-studio-toolbar {
    background: #1e293b;
}

[data-theme="dark"] .dubai4-studio-table th {
    background: #334155;
}

/* ===========================================
   Dubai 4.0 Studio Mode - Fixed Layout
   =========================================== */

/* Hide project name when in Studio mode */
.dubai4-layout.dubai4-studio-mode .dubai4-nav-project-name,
.dubai4-studio-mode .dubai4-nav-project-name,
body.dubai4-studio-mode .dubai4-nav-project-name {
    display: none !important;
}

/* Hide entire nav bar in Studio mode - it will be moved to step header */
.dubai4-layout.dubai4-studio-mode #dubai4NavBar {
    display: none !important;
}

/* Studio mode step header contains the navigation */
.dubai4-layout.dubai4-studio-mode .dubai4-step-header {
    padding: 0.5rem 1rem;
}

/* Step title hidden programmatically in studio mode - keep this for fallback */
.dubai4-layout.dubai4-studio-mode .dubai4-step-header h2 {
    display: none;
}

/* Ensure view toggle and global controls are on the same line */
.dubai4-layout.dubai4-studio-mode .dubai4-step-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-view-toggle {
    margin-left: 0;
    background: rgba(0, 0, 0, 0.04);
    padding: 0.2rem;
    border-radius: 6px;
}

/* Collapse toggle container in studio header */
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-collapse-toggle {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    background: rgba(0, 0, 0, 0.04);
    padding: 0.2rem;
    border-radius: 6px;
}

/* Collapse buttons in studio header - match view toggle button style */
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-collapse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem 0.5rem;
    border: none;
    background: transparent;
    border-radius: 5px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    width: auto;
    height: auto;
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-collapse-btn:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-primary);
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-collapse-btn.active {
    background: var(--primary-color);
    color: white;
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-collapse-btn svg {
    width: 14px;
    height: 14px;
}

/* Waveform mode toggle in studio header */
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-waveform-mode-toggle {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    background: rgba(0, 0, 0, 0.04);
    padding: 0.2rem;
    border-radius: 6px;
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-waveform-mode-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.5rem;
    border: none;
    background: transparent;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-waveform-mode-btn:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-primary);
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-waveform-mode-btn.active {
    background: var(--primary-color);
    color: white;
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header #waveformModeTtsBtn.active {
    background: #22c55e;
    color: white;
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-waveform-mode-btn svg {
    width: 14px;
    height: 14px;
}

/* Fullscreen button in studio header - match view toggle button style */
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai4-fullscreen-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    border: none;
    background: transparent;
    border-radius: 5px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    width: auto;
    height: auto;
    margin-left: 0.75rem;
    margin-right: 0;
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai4-fullscreen-btn:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-primary);
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai4-fullscreen-btn svg {
    width: 14px;
    height: 14px;
}

/* Studio header nav (cloned from main nav) */
.dubai4-studio-header-nav {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    background: rgba(0, 0, 0, 0.04);
    padding: 0.2rem;
    border-radius: 6px;
}

.dubai4-studio-header-nav .dubai4-nav-step {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.5rem;
    border: none;
    background: transparent;
    border-radius: 5px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.dubai4-studio-header-nav .dubai4-nav-step:hover:not(.disabled) {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-primary);
}

.dubai4-studio-header-nav .dubai4-nav-step.active {
    background: var(--primary-color);
    color: white;
    font-weight: 500;
}

.dubai4-studio-header-nav .dubai4-nav-step.completed {
    color: var(--primary-color);
}

.dubai4-studio-header-nav .dubai4-nav-step.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.dubai4-studio-header-nav .dubai4-nav-step .dubai4-nav-icon {
    font-size: 0.85rem;
}

/* Hide step labels for non-active steps in studio header nav */
.dubai4-studio-header-nav .dubai4-nav-step .dubai4-nav-label {
    display: none;
}

/* Show label only for active step */
.dubai4-studio-header-nav .dubai4-nav-step.active .dubai4-nav-label {
    display: inline;
}

/* Studio save button (between Delete and Continue) */
.dubai4-studio-save-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--primary-color);
    background: var(--primary-color);
    color: white;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 0.5rem;
}

.dubai4-studio-save-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.dubai4-studio-save-btn svg {
    width: 16px;
    height: 16px;
}

/* Studio mode layout - fixed header, scrollable content */
.dubai4-layout.dubai4-studio-mode .dubai4-step-wrapper {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px); /* Subtract nav bar height */
    overflow: hidden;
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 50;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.04) 0%, rgba(168, 85, 247, 0.04) 100%);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    margin: 0.5rem 0.5rem 0 0.5rem;
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-component {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Rendition container in studio mode */
.dubai4-layout.dubai4-studio-mode .dubai3-rendition-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Waveform section - fixed at top */
.dubai4-layout.dubai4-studio-mode .dubai3-waveform-section {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 40;
    background: transparent;
    border-bottom: none;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
}

/* Playback controls - transparent background */
.dubai4-layout.dubai4-studio-mode .dubai3-playback-controls {
    background: transparent;
    border: none;
    padding: 0.35rem;
}

/* Right waveform controls - transparent background */
.dubai4-layout.dubai4-studio-mode .dubai3-waveform-controls-right {
    background: transparent;
    border: none;
    padding: 0.35rem;
}

/* Waveform wrapper - ensure full width in fullscreen */
.dubai4-layout.dubai4-studio-mode .dubai3-waveform-wrapper {
    width: 100%;
    flex: 1;
}

/* Fullscreen mode - ensure waveform takes full width */
.dubai4-fullscreen-mode .dubai3-waveform-wrapper {
    width: 100% !important;
    max-width: none !important;
}

.dubai4-fullscreen-mode .dubai3-waveform-section {
    width: 100%;
}

.dubai4-fullscreen-mode #zoomview-container,
.dubai4-fullscreen-mode #overview-container {
    width: 100% !important;
}

/* Rendition list - scrollable */
.dubai4-layout.dubai4-studio-mode .dubai3-rendition-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin: 0 0.5rem 0.5rem 0.5rem;
}

/* Virtual scroll container in studio mode */
.dubai4-layout.dubai4-studio-mode .dubai3-virtual-scroll-container {
    position: relative;
}

/* Rounded virtual rows in studio mode */
.dubai4-layout.dubai4-studio-mode .dubai3-virtual-row {
    padding: 2px 4px;
}

.dubai4-layout.dubai4-studio-mode .dubai3-virtual-row > .dubai3-rendition-row-collapsed {
    border-radius: 6px !important;
    border: 1px solid var(--border-color) !important;
    margin: 0;
}

.dubai4-layout.dubai4-studio-mode .dubai3-virtual-row > .dubai3-rendition-row-v2 {
    border-radius: 6px !important;
    border: 1px solid var(--border-color) !important;
    margin: 0;
}

/* Header settings in studio mode */
.dubai4-layout.dubai4-studio-mode .dubai3-header-settings {
    background: transparent;
}

/* Studio mode in fullscreen - take full viewport height */
.dubai4-fullscreen-mode.dubai4-studio-mode .dubai4-step-wrapper {
    height: 100vh !important;
}

.dubai4-fullscreen-mode.dubai4-studio-mode .dubai4-step-content {
    height: 100vh !important;
    padding: 0 !important;
}

.dubai4-fullscreen-mode.dubai4-studio-mode .dubai4-step-wrapper {
    padding: 0 !important;
}

/* ============================================
   Dubai 4 Studio - Unified Header Button Styles
   ============================================ */

/* Base button style for all action buttons in studio header */
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-header-settings-toggle,
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-select-all-btn,
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-merge-btn,
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-batch-tts-btn,
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-batch-final-btn,
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-delete-selected-btn,
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai4-studio-save-btn,
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-header-continue-btn,
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai4-header-continue-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border: none;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    white-space: nowrap;
    box-shadow: none;
    transform: none;
}

/* Translation Settings - primary color */
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-header-settings-item:not(.tts) .dubai3-header-settings-toggle {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-header-settings-item:not(.tts) .dubai3-header-settings-toggle:hover {
    background: var(--primary-color);
    color: white;
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-header-settings-item:not(.tts).expanded .dubai3-header-settings-toggle {
    background: var(--primary-color);
    color: white;
}

/* TTS Settings - secondary color */
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-header-settings-item.tts .dubai3-header-settings-toggle {
    background: rgba(139, 92, 246, 0.1);
    color: var(--secondary-color);
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-header-settings-item.tts .dubai3-header-settings-toggle:hover {
    background: var(--secondary-color);
    color: white;
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-header-settings-item.tts.expanded .dubai3-header-settings-toggle {
    background: var(--secondary-color);
    color: white;
}

/* Select All button - indigo */
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-select-all-btn {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-select-all-btn:hover {
    background: #6366f1;
    color: white;
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-select-all-btn.all-selected {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-select-all-btn.all-selected:hover {
    background: #10b981;
    color: white;
}

/* Merge button - amber/orange */
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-merge-btn {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-merge-btn:hover {
    background: #f59e0b;
    color: white;
}

/* Batch TTS button - purple */
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-batch-tts-btn {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-batch-tts-btn:hover {
    background: #8b5cf6;
    color: white;
}

/* Batch Final button - orange */
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-batch-final-btn {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-batch-final-btn:hover {
    background: #f59e0b;
    color: white;
}

/* Delete button - red */
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-delete-selected-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-delete-selected-btn:hover {
    background: #ef4444;
    color: white;
}

/* Save button - primary */
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai4-studio-save-btn {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    margin: 0;
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai4-studio-save-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Continue button - gradient primary */
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-header-continue-btn,
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai4-header-continue-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-header-continue-btn:hover,
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai4-header-continue-btn:hover {
    filter: brightness(1.1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Settings toggle arrow */
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-header-settings-arrow {
    margin-left: 0.15rem;
    color: inherit;
}

/* Settings toggle icons */
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-header-settings-toggle svg:first-child {
    width: 14px;
    height: 14px;
    color: inherit;
}

/* All button icons same size */
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-select-all-btn svg,
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-merge-btn svg,
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-batch-tts-btn svg,
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-batch-final-btn svg,
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-delete-selected-btn svg,
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai4-studio-save-btn svg,
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai3-header-continue-btn svg,
.dubai4-layout.dubai4-studio-mode .dubai4-step-header .dubai4-header-continue-btn svg {
    width: 14px;
    height: 14px;
}

/* ============================================
   Dubai 4 Studio - Settings Dropdown Styles
   ============================================ */

/* Dropdown panel */
.dubai4-layout.dubai4-studio-mode .dubai3-header-settings-content {
    min-width: 280px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    padding: 0.75rem;
    top: calc(100% + 0.5rem);
}

/* Grid layout */
.dubai4-layout.dubai4-studio-mode .dubai3-header-settings-grid {
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

/* Setting row */
.dubai4-layout.dubai4-studio-mode .dubai3-header-setting {
    gap: 0.3rem;
}

/* Labels */
.dubai4-layout.dubai4-studio-mode .dubai3-header-setting label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* Select dropdowns */
.dubai4-layout.dubai4-studio-mode .dubai3-header-setting select {
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 0.8rem;
    background: var(--surface);
}

.dubai4-layout.dubai4-studio-mode .dubai3-header-setting select:hover {
    border-color: var(--primary-color);
}

.dubai4-layout.dubai4-studio-mode .dubai3-header-setting select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}

/* Checkbox section */
.dubai4-layout.dubai4-studio-mode .dubai3-header-setting-checkbox {
    margin: 0.5rem 0;
    padding-top: 0.5rem;
}

.dubai4-layout.dubai4-studio-mode .dubai3-header-setting-checkbox .dubai3-checkbox {
    font-size: 0.8rem;
    gap: 0.4rem;
}

.dubai4-layout.dubai4-studio-mode .dubai3-header-setting-checkbox .dubai3-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
}

/* Action button inside dropdown */
.dubai4-layout.dubai4-studio-mode .dubai3-header-settings-action-btn {
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 500;
    box-shadow: none;
}

.dubai4-layout.dubai4-studio-mode .dubai3-header-settings-action-btn:hover {
    transform: none;
    filter: brightness(1.1);
}

/* ============================================
   Dubai 4 Studio - Collapsed Row State Colors
   ============================================ */

/* Has TTS but no final marked - light red */
.dubai4-layout.dubai4-studio-mode .dubai3-rendition-row-collapsed.has-tts-no-final {
    background: rgba(239, 68, 68, 0.08);
    border-left: 3px solid rgba(239, 68, 68, 0.5);
}

.dubai4-layout.dubai4-studio-mode .dubai3-rendition-row-collapsed.has-tts-no-final:hover {
    background: rgba(239, 68, 68, 0.12);
}

/* Has final TTS marked - light green */
.dubai4-layout.dubai4-studio-mode .dubai3-rendition-row-collapsed.has-final-tts {
    background: rgba(16, 185, 129, 0.1);
    border-left: 3px solid rgba(16, 185, 129, 0.6);
}

.dubai4-layout.dubai4-studio-mode .dubai3-rendition-row-collapsed.has-final-tts:hover {
    background: rgba(16, 185, 129, 0.15);
}

/* No TTS - transparent/white (default) */
.dubai4-layout.dubai4-studio-mode .dubai3-rendition-row-collapsed:not(.has-tts-no-final):not(.has-final-tts) {
    background: transparent;
    border-left: 3px solid transparent;
}

.dubai4-layout.dubai4-studio-mode .dubai3-rendition-row-collapsed:not(.has-tts-no-final):not(.has-final-tts):hover {
    background: rgba(99, 102, 241, 0.04);
}

/* ============================================
   Dubai 4 Editor Popup
   ============================================ */

/* Editor button in segment rows */
.dubai4-edit-btn,
.dubai4-edit-btn-simple {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-right: 6px;
}

.dubai4-edit-btn:hover,
.dubai4-edit-btn-simple:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: scale(1.05);
}

.dubai4-edit-btn svg {
    width: 14px;
    height: 14px;
}

/* Popup Overlay */
.dubai4-editor-popup {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.dubai4-editor-popup-content {
    width: 100%;
    max-width: 1400px;
    max-height: 95vh;
    overflow-y: auto;
    border-radius: 16px;
    background: var(--bg-primary, #fff);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .dubai4-editor-popup-content,
body.dark-mode .dubai4-editor-popup-content {
    background: var(--bg-primary, #1f2937);
}

/* Fullscreen mode for editor popup */
.dubai4-editor-popup.fullscreen {
    padding: 0;
}

.dubai4-editor-popup.fullscreen .dubai4-editor-popup-content {
    max-width: 100%;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
}

.dubai4-editor-popup.fullscreen .dubai4-editor {
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.dubai4-editor-popup.fullscreen .dubai4-editor-body {
    flex: 1;
    overflow-y: auto;
}

.dubai4-editor-popup.fullscreen .dubai4-editor-header {
    border-radius: 0;
}

/* Also show fullscreen when page is in fullscreen mode */
:fullscreen .dubai4-editor-popup,
:-webkit-full-screen .dubai4-editor-popup,
:-moz-full-screen .dubai4-editor-popup,
:-ms-fullscreen .dubai4-editor-popup {
    padding: 0;
}

:fullscreen .dubai4-editor-popup .dubai4-editor-popup-content,
:-webkit-full-screen .dubai4-editor-popup .dubai4-editor-popup-content,
:-moz-full-screen .dubai4-editor-popup .dubai4-editor-popup-content,
:-ms-fullscreen .dubai4-editor-popup .dubai4-editor-popup-content {
    max-width: 100%;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
}

/* Editor header - use flexbox with space-between for left/center/right layout */
.dubai4-editor-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px 16px 0 0;
}

/* Editor header navigation (centered) */
.dubai4-editor-header-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.dubai4-editor-header-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 6px;
    color: var(--primary-color, #6366f1);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai4-editor-header-nav-btn:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.4);
    transform: scale(1.05);
}

.dubai4-editor-header-nav-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.dubai4-editor-header-counter {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    min-width: 70px;
    text-align: center;
    background: rgba(99, 102, 241, 0.08);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    border: 1px solid rgba(99, 102, 241, 0.15);
}

/* Editor header actions */
.dubai4-editor-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Fullscreen toggle button in editor */
.dubai4-editor-fullscreen-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai4-editor-fullscreen-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: scale(1.05);
}

.dubai4-editor-fullscreen-btn svg {
    width: 18px;
    height: 18px;
}

/* Editor Container */
.dubai4-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.dubai4-editor-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dubai4-editor-speaker-input {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    min-width: 120px;
    max-width: 250px;
    transition: all 0.2s ease;
}

.dubai4-editor-speaker-input:hover {
    background: rgba(99, 102, 241, 0.05);
    border-color: rgba(99, 102, 241, 0.2);
}

.dubai4-editor-speaker-input:focus {
    outline: none;
    background: var(--surface-color, #fff);
    border-color: var(--primary-color, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

[data-theme="dark"] .dubai4-editor-speaker-input,
body.dark-mode .dubai4-editor-speaker-input {
    color: var(--text-primary, #f9fafb);
}

[data-theme="dark"] .dubai4-editor-speaker-input:focus,
body.dark-mode .dubai4-editor-speaker-input:focus {
    background: rgba(255, 255, 255, 0.05);
}

.dubai4-editor-speaker {
    font-size: 0.85rem;
    font-weight: 500;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.dubai4-editor-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai4-editor-close-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(1.1);
}

/* Editor Navigation */
.dubai4-editor-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-secondary, #f8fafc);
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

[data-theme="dark"] .dubai4-editor-nav,
body.dark-mode .dubai4-editor-nav {
    background: rgba(255, 255, 255, 0.03);
}

.dubai4-editor-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-primary, #fff);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai4-editor-nav-btn:hover:not(:disabled) {
    border-color: #6366f1;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
}

.dubai4-editor-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.dubai4-editor-seg-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dubai4-editor-page-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 40px;
    text-align: center;
}

.dubai4-editor-seg-buttons {
    display: flex;
    gap: 4px;
}

.dubai4-editor-seg-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-primary, #fff);
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dubai4-editor-seg-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
}

.dubai4-editor-seg-btn.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-color: #6366f1;
    color: #fff;
}

.dubai4-editor-nav-arrows {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.dubai4-editor-arrow-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-primary, #fff);
    color: var(--text-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai4-editor-arrow-btn:hover:not(:disabled) {
    border-color: #6366f1;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
}

.dubai4-editor-arrow-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.dubai4-editor-nav-counter {
    font-size: 0.85rem;
    color: var(--text-secondary);
    min-width: 80px;
    text-align: center;
}

/* Editor Body - 4 Row Grid for precise alignment */
.dubai4-editor-body {
    display: grid;
    grid-template-columns: 1fr 2fr;
    grid-template-rows: 1fr 1fr 1fr 1fr;
    gap: 1rem 1.5rem;
    padding: 1.5rem;
    flex: 1;
    min-height: 0;
}

/* Text Section - use contents so children participate in grid */
.dubai4-editor-texts {
    display: contents;
}

/* Original text box - row 1 */
.dubai4-editor-texts > .dubai4-editor-textbox:first-child {
    grid-column: 1;
    grid-row: 1;
}

/* Translated text box - row 2 */
.dubai4-editor-texts > .dubai4-editor-textbox.translated {
    grid-column: 1;
    grid-row: 2;
}

/* Graphs - use contents so children participate in grid */
.dubai4-editor-graphs {
    display: contents !important;
}

/* Energy graph - row 3 */
.dubai4-editor-graph-box:first-child {
    grid-column: 1;
    grid-row: 3;
}

/* Pitch graph - row 4 */
.dubai4-editor-graph-box:last-child {
    grid-column: 1;
    grid-row: 4;
}

/* Audio section - use contents so children participate in grid */
.dubai4-editor-audio {
    display: contents !important;
}

/* Original track - spans rows 1-2 (matches text boxes height) */
.dubai4-editor-waveform-box.original {
    grid-column: 2;
    grid-row: 1 / 3;
}

/* TTS section - spans rows 3-4 (matches graphs height) */
.dubai4-editor-tts-section {
    grid-column: 2;
    grid-row: 3 / 5;
}

.dubai4-editor-textbox {
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 1rem;
}

[data-theme="dark"] .dubai4-editor-textbox,
body.dark-mode .dubai4-editor-textbox {
    background: rgba(255, 255, 255, 0.03);
}

/* translated textbox inherits from base class */

.dubai4-editor-graph-box {
    background: var(--surface-color, #f9fafb);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    min-height: 105px;
}

[data-theme="dark"] .dubai4-editor-graph-box,
body.dark-mode .dubai4-editor-graph-box {
    background: rgba(255, 255, 255, 0.03);
}

.dubai4-editor-graph-box label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dubai4-editor-graph-box canvas {
    display: block;
    width: 100%;
    height: 90px;
    border-radius: 6px;
}

.dubai4-editor-textbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.dubai4-editor-textbox-header label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.dubai4-editor-textbox-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.dubai4-editor-save-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-secondary, #f9fafb);
    color: var(--text-secondary);
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai4-editor-save-btn:hover:not(:disabled) {
    background: var(--bg-hover, #f3f4f6);
    border-color: var(--secondary-color, #8b5cf6);
    color: var(--secondary-color, #8b5cf6);
}

.dubai4-editor-save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.dubai4-editor-save-btn.saving {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
    color: #f59e0b;
}

.dubai4-editor-save-btn.saved {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #10b981;
}

/* AI+ Retime Button */
.dubai4-editor-retime-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.6rem;
    border: 1px solid #8b5cf6;
    border-radius: 6px;
    font-size: 0.75rem;
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai4-editor-retime-btn:hover:not(:disabled) {
    background: rgba(139, 92, 246, 0.2);
    border-color: #7c3aed;
    color: #7c3aed;
}

.dubai4-editor-retime-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.dubai4-editor-retime-btn.processing {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
    color: #f59e0b;
    animation: pulse 1.5s infinite;
}

.dubai4-editor-retime-btn.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
    color: #10b981;
}

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

.dubai4-editor-time-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
    font-family: 'JetBrains Mono', monospace;
}

.dubai4-editor-duration {
    color: #6366f1;
    font-weight: 500;
}

.dubai4-editor-original-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-primary);
    max-height: 120px;
    overflow-y: auto;
}

.dubai4-editor-text-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dubai4-editor-lang-select {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    font-size: 0.8rem;
    background: var(--bg-primary, #fff);
    color: var(--text-primary);
    cursor: pointer;
}

.dubai4-editor-translate-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border: none;
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai4-editor-translate-btn:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.2);
}

.dubai4-editor-translate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.dubai4-editor-translated-textarea {
    width: 100%;
    min-height: 60px;
    max-height: 80px;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: none;
    background: var(--bg-primary, #fff);
    color: var(--text-primary);
    box-sizing: border-box;
}

.dubai4-editor-translated-textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Waveform Box */
.dubai4-editor-waveform-box {
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 1rem;
}

[data-theme="dark"] .dubai4-editor-waveform-box,
body.dark-mode .dubai4-editor-waveform-box {
    background: rgba(255, 255, 255, 0.03);
}

.dubai4-editor-waveform-box.original {
    border-left: 3px solid #6366f1;
}

.dubai4-editor-waveform-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.dubai4-editor-waveform-header label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.dubai4-editor-waveform-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dubai4-editor-duration-badge {
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
}

/* Editor Mode Toolbar */
.dubai4-editor-mode-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background: var(--bg-secondary, #f8fafc);
    border-radius: 8px;
}

[data-theme="dark"] .dubai4-editor-mode-toolbar,
body.dark-mode .dubai4-editor-mode-toolbar {
    background: rgba(255, 255, 255, 0.05);
}

.dubai4-editor-mode-buttons {
    display: flex;
    gap: 0.35rem;
}

.dubai4-editor-mode-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-primary, #fff);
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai4-editor-mode-btn:hover {
    border-color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
}

.dubai4-editor-mode-btn.active {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.dubai4-editor-mode-btn.trim.active {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.dubai4-editor-mode-btn.split.active {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.dubai4-editor-expand-buttons {
    display: flex;
    gap: 0.35rem;
}

.dubai4-editor-expand-btn {
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-primary, #fff);
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dubai4-editor-expand-btn:hover {
    border-color: #10b981;
    color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

/* Waveform Controls Bar */
.dubai4-editor-waveform-controls-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    padding: 0.5rem;
    background: var(--bg-secondary, #f8fafc);
    border-radius: 8px;
}

[data-theme="dark"] .dubai4-editor-waveform-controls-bar,
body.dark-mode .dubai4-editor-waveform-controls-bar {
    background: rgba(255, 255, 255, 0.05);
}

.dubai4-editor-mode-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dubai4-editor-action-btn {
    padding: 0.4rem 0.85rem;
    border: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai4-editor-action-btn.primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
}

.dubai4-editor-action-btn.primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.dubai4-editor-scrub-hint {
    font-size: 0.75rem;
    color: var(--text-muted, #9ca3af);
    font-style: italic;
}

.dubai4-editor-waveform-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dubai4-editor-play-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.dubai4-editor-play-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* TTS track play button - Purple */
.dubai4-editor-tts-section .dubai4-editor-play-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
}

.dubai4-editor-tts-section .dubai4-editor-play-btn:hover {
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.dubai4-editor-time {
    font-size: 0.75rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    background: transparent;
}

.dubai4-editor-waveform-container {
    position: relative;
    min-height: 120px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
    overflow: hidden;
}

[data-theme="dark"] .dubai4-editor-waveform-container,
body.dark-mode .dubai4-editor-waveform-container {
    background: rgba(255, 255, 255, 0.03);
}

.dubai4-editor-waveform-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

[data-theme="dark"] .dubai4-editor-waveform-loading,
body.dark-mode .dubai4-editor-waveform-loading {
    background: rgba(0, 0, 0, 0.5);
}

.dubai4-editor-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* TTS Section */
.dubai4-editor-tts-section {
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 1rem;
    border-left: 3px solid #10b981;
    flex: 1;
    display: flex;
    flex-direction: column;
}

[data-theme="dark"] .dubai4-editor-tts-section,
body.dark-mode .dubai4-editor-tts-section {
    background: rgba(255, 255, 255, 0.03);
}

.dubai4-editor-tts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.dubai4-editor-tts-header label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.dubai4-editor-tts-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dubai4-editor-model-select {
    padding: 0.4rem 2rem 0.4rem 0.75rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    background: var(--bg-primary, #fff);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 12px;
    min-width: 120px;
}

.dubai4-editor-model-select:hover {
    border-color: var(--secondary-color, #8b5cf6);
    background-color: var(--bg-secondary, #f9fafb);
}

.dubai4-editor-model-select:focus {
    outline: none;
    border-color: var(--secondary-color, #8b5cf6);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.dubai4-editor-model-select option {
    padding: 0.5rem;
    font-weight: 500;
}

.dubai4-editor-checkbox {
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0 0.5rem;
    white-space: nowrap;
}

.dubai4-editor-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
}

/* Generate button - Purple (secondary) default */
.dubai4-editor-generate-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border: none;
    background: linear-gradient(135deg, var(--secondary-color, #8b5cf6) 0%, #c084fc 100%);
    color: #fff;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dubai4-editor-generate-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}

.dubai4-editor-generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Generate button - Processing state (orange) */
.dubai4-editor-generate-btn.processing {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    box-shadow: 0 2px 5px rgba(245, 158, 11, 0.25);
    animation: pulse-generate 1.5s ease-in-out infinite;
}

/* Generate button - Done state (green) */
.dubai4-editor-generate-btn.done {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

/* Generate button - Error state (red) */
.dubai4-editor-generate-btn.error {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.25);
}

/* Final button - Red when not set */
.dubai4-editor-final-btn {
    padding: 0.4rem 0.75rem;
    border: 1px solid rgba(239, 68, 68, 0.4);
    background: transparent;
    color: #ef4444;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dubai4-editor-final-btn:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.6);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

/* Final button - Green when set */
.dubai4-editor-final-btn.is-final {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.dubai4-editor-final-btn.is-final:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.45);
}

.dubai4-editor-final-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Versions */
.dubai4-editor-versions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.dubai4-editor-versions label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.dubai4-editor-version-buttons {
    display: flex;
    gap: 4px;
}

.dubai4-editor-version-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-primary, #fff);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.dubai4-editor-version-btn:hover {
    border-color: #6366f1;
    color: #6366f1;
}

.dubai4-editor-version-btn.has-version {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}

.dubai4-editor-version-btn.selected {
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.4);
}

.dubai4-editor-version-btn.final {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    border-color: #10b981;
    color: #fff;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

.dubai4-editor-version-btn.empty-slot {
    background: transparent;
    border-style: dashed;
}

.dubai4-editor-version-btn.target-slot {
    border-color: var(--secondary-color, #8b5cf6);
    border-style: solid;
    background: rgba(139, 92, 246, 0.15);
    color: var(--secondary-color, #8b5cf6);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

/* ===== Dubai 4 Editor - Dark Mode Button Styles ===== */

[data-theme="dark"] .dubai4-editor-model-select {
    background-color: #1e293b;
    border-color: #475569;
    color: #e2e8f0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

[data-theme="dark"] .dubai4-editor-model-select:hover {
    background-color: #334155;
    border-color: var(--secondary-color, #a78bfa);
}

[data-theme="dark"] .dubai4-editor-model-select:focus {
    border-color: var(--secondary-color, #a78bfa);
    box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
}

[data-theme="dark"] .dubai4-editor-model-select option {
    background-color: #1e293b;
    color: #e2e8f0;
}

[data-theme="dark"] .dubai4-editor-save-btn {
    background: #1e293b;
    border-color: #475569;
    color: var(--text-secondary);
}

[data-theme="dark"] .dubai4-editor-save-btn:hover:not(:disabled) {
    background: #334155;
    border-color: var(--secondary-color, #a78bfa);
    color: var(--secondary-color, #a78bfa);
}

[data-theme="dark"] .dubai4-editor-save-btn.saving {
    background: rgba(245, 158, 11, 0.15);
    border-color: #fbbf24;
    color: #fbbf24;
}

[data-theme="dark"] .dubai4-editor-save-btn.saved {
    background: rgba(16, 185, 129, 0.15);
    border-color: #34d399;
    color: #34d399;
}

[data-theme="dark"] .dubai4-editor-retime-btn {
    background: rgba(139, 92, 246, 0.2);
    border-color: #a78bfa;
    color: #a78bfa;
}

[data-theme="dark"] .dubai4-editor-retime-btn:hover:not(:disabled) {
    background: rgba(139, 92, 246, 0.3);
    border-color: #c4b5fd;
    color: #c4b5fd;
}

[data-theme="dark"] .dubai4-editor-retime-btn.processing {
    background: rgba(245, 158, 11, 0.2);
    border-color: #fbbf24;
    color: #fbbf24;
}

[data-theme="dark"] .dubai4-editor-retime-btn.success {
    background: rgba(16, 185, 129, 0.2);
    border-color: #34d399;
    color: #34d399;
}

[data-theme="dark"] .dubai4-editor-translate-btn {
    background: rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .dubai4-editor-translate-btn:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .dubai4-editor-translated-textarea {
    background: #1e293b;
    border-color: #475569;
    color: var(--text-primary);
}

[data-theme="dark"] .dubai4-editor-translated-textarea:focus {
    border-color: #818cf8;
    background: #334155;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}

[data-theme="dark"] .dubai4-editor-mode-btn {
    background: #1e293b;
    border-color: #475569;
    color: var(--text-secondary);
}

[data-theme="dark"] .dubai4-editor-mode-btn:hover {
    background: #334155;
    border-color: #64748b;
}

[data-theme="dark"] .dubai4-editor-mode-btn.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: #818cf8;
    color: #818cf8;
}

[data-theme="dark"] .dubai4-editor-mode-btn.trim.active {
    background: rgba(59, 130, 246, 0.15);
    border-color: #60a5fa;
    color: #60a5fa;
}

[data-theme="dark"] .dubai4-editor-mode-btn.split.active {
    background: rgba(239, 68, 68, 0.15);
    border-color: #f87171;
    color: #f87171;
}

[data-theme="dark"] .dubai4-editor-expand-btn {
    background: #1e293b;
    border-color: #475569;
    color: var(--text-secondary);
}

[data-theme="dark"] .dubai4-editor-expand-btn:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: #34d399;
    color: #34d399;
}

[data-theme="dark"] .dubai4-editor-action-btn {
    background: #334155;
    color: var(--text-primary);
}

[data-theme="dark"] .dubai4-editor-action-btn.primary {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
}

[data-theme="dark"] .dubai4-editor-version-btn {
    background: #1e293b;
    border-color: #475569;
    color: var(--text-secondary);
}

[data-theme="dark"] .dubai4-editor-version-btn:hover {
    border-color: #818cf8;
    color: #818cf8;
}

[data-theme="dark"] .dubai4-editor-version-btn.has-version {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}

[data-theme="dark"] .dubai4-editor-version-btn.empty-slot {
    background: transparent;
    border-color: #64748b;
}

[data-theme="dark"] .dubai4-editor-version-btn.target-slot {
    background: rgba(167, 139, 250, 0.2);
    border-color: #a78bfa;
    color: #a78bfa;
    box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.25);
}

[data-theme="dark"] .dubai4-editor-final-btn {
    border-color: rgba(248, 113, 113, 0.5);
    color: #f87171;
}

[data-theme="dark"] .dubai4-editor-final-btn:hover:not(:disabled) {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.7);
}

[data-theme="dark"] .dubai4-editor-nav-btn,
[data-theme="dark"] .dubai4-editor-arrow-btn {
    background: #1e293b;
    border-color: #475569;
    color: var(--text-secondary);
}

[data-theme="dark"] .dubai4-editor-nav-btn:hover:not(:disabled),
[data-theme="dark"] .dubai4-editor-arrow-btn:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.1);
    border-color: #818cf8;
    color: #818cf8;
}

[data-theme="dark"] .dubai4-editor-seg-btn {
    background: #1e293b;
    border-color: #475569;
    color: var(--text-secondary);
}

[data-theme="dark"] .dubai4-editor-seg-btn:hover {
    border-color: #818cf8;
    color: #818cf8;
}

[data-theme="dark"] .dubai4-editor-seg-btn.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border-color: #6366f1;
    color: #fff;
}

[data-theme="dark"] .dubai4-editor-play-btn {
    background: linear-gradient(135deg, #6366f1 0%, #818cf8 100%);
}

[data-theme="dark"] .dubai4-editor-tts-section .dubai4-editor-play-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 100%);
}

[data-theme="dark"] .dubai4-editor-header-nav-btn {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
    color: var(--text-secondary);
}

[data-theme="dark"] .dubai4-editor-header-nav-btn:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.5);
}

[data-theme="dark"] .dubai4-editor-close-btn {
    color: var(--text-secondary);
}

[data-theme="dark"] .dubai4-editor-close-btn:hover {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

[data-theme="dark"] .dubai4-editor-fullscreen-btn {
    color: var(--text-secondary);
}

[data-theme="dark"] .dubai4-editor-fullscreen-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #818cf8;
}

[data-theme="dark"] .dubai4-editor-lang-select {
    background: #1e293b;
    border-color: #475569;
    color: var(--text-primary);
}

[data-theme="dark"] .dubai4-editor-lang-select:hover {
    border-color: var(--secondary-color, #a78bfa);
}

/* TTS Waveform Container */
.dubai4-editor-waveform-container.tts {
    flex: 1;
    min-height: 120px;
    background: transparent;
}

.dubai4-editor-no-tts {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 100px;
    color: var(--text-muted, #9ca3af);
    font-size: 0.9rem;
}

.dubai4-editor-waveform-simple {
    min-height: 80px;
    background: transparent;
}

.dubai4-editor-tts-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
    background: transparent;
}

/* Ensure WaveSurfer container in TTS section has no white background */
.dubai4-editor-waveform-container.tts,
.dubai4-editor-waveform-container.tts * {
    background-color: transparent;
}

.dubai4-editor-waveform-simple > div {
    background: transparent !important;
}

/* Error state */
.dubai4-editor-error {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #ef4444;
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .dubai4-editor-body {
        grid-template-columns: 1fr;
    }
    
    .dubai4-editor-popup-content {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .dubai4-editor-popup {
        padding: 0.5rem;
    }
    
    .dubai4-editor-header {
        padding: 0.75rem 1rem;
    }
    
    /* Make header navigation not absolutely positioned on small screens */
    .dubai4-editor-header-nav {
        position: static;
        transform: none;
    }
    
    .dubai4-editor-header-counter {
        min-width: 55px;
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .dubai4-editor-header-nav-btn {
        width: 28px;
        height: 28px;
    }
    
    .dubai4-editor-body {
        padding: 1rem;
        gap: 1rem;
    }
    
    .dubai4-editor-tts-actions {
        flex-wrap: wrap;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .dubai4-nav-bar {
        padding: 0.5rem;
    }
    
    .dubai4-nav-steps {
        gap: 0.15rem;
    }
    
    .dubai4-nav-step {
        padding: 0.35rem 0.5rem;
    }
    
    .dubai4-nav-render-actions {
        margin-left: 0.35rem;
        padding: 2px;
    }
    
    .dubai4-nav-render-btn {
        padding: 0.3rem 0.4rem;
    }
    
    .dubai4-nav-render-btn span {
        display: none;
    }
    
    .dubai4-nav-project-name {
        display: none;
    }
    
    .dubai4-step-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .dubai4-header-actions-slot {
        width: 100%;
        justify-content: flex-start;
        padding-right: 0;
    }
    
    .dubai4-render-summary {
        flex-wrap: wrap;
    }
    
    .dubai4-lang-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .dubai4-render-options {
        gap: 0.75rem;
    }
    
    .dubai4-checkbox,
    .dubai4-format-select {
        font-size: 0.72rem;
    }
}

/* ============================================
   Global Notification System
   Displays errors and messages in upper right
   without browser dialogs (fullscreen safe)
   ============================================ */

.global-notification-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 420px;
    width: calc(100% - 40px);
    pointer-events: none;
}

/* Fullscreen mode - position at top of fullscreen element */
:fullscreen .global-notification-container,
:-webkit-full-screen .global-notification-container,
:-moz-full-screen .global-notification-container,
:-ms-fullscreen .global-notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2147483647; /* Maximum z-index for fullscreen */
}

.global-notification {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.global-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.global-notification.hide {
    opacity: 0;
    transform: translateX(100%);
}

.global-notification-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 2px;
}

.global-notification-content {
    flex: 1;
    min-width: 0;
}

.global-notification-message {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
    word-break: break-word;
}

.global-notification-close {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    margin: -4px -4px -4px 0;
    color: var(--text-light);
    opacity: 0.6;
    transition: opacity 0.2s, color 0.2s;
    border-radius: 4px;
}

.global-notification-close:hover {
    opacity: 1;
    color: var(--text-primary);
    background: var(--surface-hover);
}

/* Error notification style */
.global-notification-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fecaca;
}

.global-notification-error .global-notification-icon {
    color: #dc2626;
    background: rgba(220, 38, 38, 0.1);
}

.global-notification-error .global-notification-message {
    color: #991b1b;
}

/* Warning notification style */
.global-notification-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fde68a;
}

.global-notification-warning .global-notification-icon {
    color: #d97706;
    background: rgba(217, 119, 6, 0.1);
}

.global-notification-warning .global-notification-message {
    color: #92400e;
}

/* Success notification style */
.global-notification-success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-color: #bbf7d0;
}

.global-notification-success .global-notification-icon {
    color: #16a34a;
    background: rgba(22, 163, 74, 0.1);
}

.global-notification-success .global-notification-message {
    color: #166534;
}

/* Info notification style */
.global-notification-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #bfdbfe;
}

.global-notification-info .global-notification-icon {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.1);
}

.global-notification-info .global-notification-message {
    color: #1e40af;
}

/* Dark mode support for notifications */
[data-theme="dark"] .global-notification-error {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15) 0%, rgba(185, 28, 28, 0.1) 100%);
    border-color: rgba(248, 113, 113, 0.3);
}

[data-theme="dark"] .global-notification-error .global-notification-icon {
    color: #f87171;
    background: rgba(248, 113, 113, 0.15);
}

[data-theme="dark"] .global-notification-error .global-notification-message {
    color: #fca5a5;
}

[data-theme="dark"] .global-notification-warning {
    background: linear-gradient(135deg, rgba(217, 119, 6, 0.15) 0%, rgba(180, 83, 9, 0.1) 100%);
    border-color: rgba(251, 191, 36, 0.3);
}

[data-theme="dark"] .global-notification-warning .global-notification-icon {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.15);
}

[data-theme="dark"] .global-notification-warning .global-notification-message {
    color: #fcd34d;
}

[data-theme="dark"] .global-notification-success {
    background: linear-gradient(135deg, rgba(22, 163, 74, 0.15) 0%, rgba(21, 128, 61, 0.1) 100%);
    border-color: rgba(74, 222, 128, 0.3);
}

[data-theme="dark"] .global-notification-success .global-notification-icon {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.15);
}

[data-theme="dark"] .global-notification-success .global-notification-message {
    color: #86efac;
}

[data-theme="dark"] .global-notification-info {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(29, 78, 216, 0.1) 100%);
    border-color: rgba(96, 165, 250, 0.3);
}

[data-theme="dark"] .global-notification-info .global-notification-icon {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.15);
}

[data-theme="dark"] .global-notification-info .global-notification-message {
    color: #93c5fd;
}

[data-theme="dark"] .global-notification-close {
    color: var(--text-secondary);
}

[data-theme="dark"] .global-notification-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile responsive adjustments */
@media (max-width: 480px) {
    .global-notification-container {
        top: 70px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
    }
    
    .global-notification {
        padding: 12px 14px;
    }
    
    .global-notification-message {
        font-size: 0.85rem;
    }
}

/* ============================================
   Inline Confirmation Popup
   ============================================ */
.confirm-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 100000;
    backdrop-filter: blur(2px);
}

.confirm-popup {
    min-width: 200px;
    max-width: 280px;
    background: var(--bg-primary, #ffffff);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
    padding: 16px;
    z-index: 100001;
    opacity: 0;
    transform: scale(0.9) translateY(-8px);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.confirm-popup.show {
    opacity: 1;
    transform: scale(1) translateY(0);
}

.confirm-popup-above {
    transform-origin: bottom center;
}

.confirm-popup-above.show {
    transform: scale(1) translateY(0);
}

.confirm-popup::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    background: var(--bg-primary, #ffffff);
    border-radius: 2px;
    transform: translateX(-50%) rotate(45deg);
    box-shadow: -2px -2px 4px rgba(0, 0, 0, 0.05);
}

.confirm-popup-above::before {
    top: auto;
    bottom: -6px;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.05);
}

.confirm-popup-message {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary, #1a1a1a);
    margin-bottom: 14px;
    text-align: center;
    word-wrap: break-word;
}

.confirm-popup-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.confirm-popup-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.15s ease;
    min-width: 70px;
}

.confirm-popup-btn-cancel {
    background: var(--bg-secondary, #f3f4f6);
    color: var(--text-secondary, #6b7280);
}

.confirm-popup-btn-cancel:hover {
    background: var(--bg-tertiary, #e5e7eb);
    color: var(--text-primary, #1a1a1a);
}

.confirm-popup-btn-confirm {
    background: #3b82f6;
    color: white;
}

.confirm-popup-btn-confirm:hover {
    background: #2563eb;
}

/* Danger type (for delete actions) */
.confirm-popup-danger .confirm-popup-btn-confirm {
    background: #ef4444;
}

.confirm-popup-danger .confirm-popup-btn-confirm:hover {
    background: #dc2626;
}

/* Warning type */
.confirm-popup-warning .confirm-popup-btn-confirm {
    background: #f59e0b;
}

.confirm-popup-warning .confirm-popup-btn-confirm:hover {
    background: #d97706;
}

/* Dark mode support */
[data-theme="dark"] .confirm-popup {
    background: var(--bg-primary, #1f2937);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .confirm-popup::before {
    background: var(--bg-primary, #1f2937);
}

[data-theme="dark"] .confirm-popup-message {
    color: var(--text-primary, #f9fafb);
}

[data-theme="dark"] .confirm-popup-btn-cancel {
    background: var(--bg-secondary, #374151);
    color: var(--text-secondary, #9ca3af);
}

[data-theme="dark"] .confirm-popup-btn-cancel:hover {
    background: var(--bg-tertiary, #4b5563);
    color: var(--text-primary, #f9fafb);
}

/* Fullscreen mode support */
:fullscreen .confirm-popup-overlay,
:-webkit-full-screen .confirm-popup-overlay,
:-moz-full-screen .confirm-popup-overlay,
:-ms-fullscreen .confirm-popup-overlay {
    position: fixed;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .confirm-popup {
        min-width: 180px;
        max-width: 260px;
        padding: 14px;
    }
    
    .confirm-popup-message {
        font-size: 0.85rem;
    }
    
    .confirm-popup-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
}

/* ========================================
   Dubai 4.0 Studio Loading Overlay
   ======================================== */

.dubai4-studio-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: dubai4-overlay-fadein 0.3s ease-out;
}

@keyframes dubai4-overlay-fadein {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.dubai4-studio-loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    animation: dubai4-loading-content-up 0.4s ease-out 0.1s both;
}

@keyframes dubai4-loading-content-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Beautiful spinning loader */
.dubai4-studio-spinner {
    position: relative;
    width: 64px;
    height: 64px;
}

.dubai4-studio-spinner::before,
.dubai4-studio-spinner::after {
    content: '';
    position: absolute;
    border-radius: 50%;
}

.dubai4-studio-spinner::before {
    width: 100%;
    height: 100%;
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        var(--primary-color) 60deg,
        transparent 120deg
    );
    animation: dubai4-spinner-rotate 1s linear infinite;
}

.dubai4-studio-spinner::after {
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    background: rgba(15, 23, 42, 1);
    border-radius: 50%;
}

@keyframes dubai4-spinner-rotate {
    to {
        transform: rotate(360deg);
    }
}

/* Inner dot pulse */
.dubai4-studio-spinner-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    background: var(--primary-color);
    border-radius: 50%;
    z-index: 1;
    animation: dubai4-dot-pulse 1.2s ease-in-out infinite;
}

@keyframes dubai4-dot-pulse {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

.dubai4-studio-loading-text {
    font-size: 1.25rem;
    font-weight: 500;
    color: #f1f5f9;
    letter-spacing: 0.5px;
}

.dubai4-studio-loading-subtext {
    font-size: 0.875rem;
    color: #94a3b8;
    margin-top: -12px;
    animation: dubai4-subtext-pulse 2s ease-in-out infinite;
}

@keyframes dubai4-subtext-pulse {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Progress dots animation */
.dubai4-loading-dots {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.dubai4-loading-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: dubai4-dots-bounce 1.4s ease-in-out infinite;
}

.dubai4-loading-dots span:nth-child(1) {
    animation-delay: 0s;
}

.dubai4-loading-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.dubai4-loading-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dubai4-dots-bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Legacy simple loading (for backwards compatibility) */
.dubai4-studio-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    gap: 1rem;
    color: var(--text-secondary);
}

.dubai4-studio-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem;
    gap: 1rem;
    text-align: center;
}

.dubai4-studio-empty .dubai4-empty-icon {
    font-size: 4rem;
    opacity: 0.5;
}

.dubai4-studio-empty h3 {
    margin: 0;
    color: var(--text-primary);
}

.dubai4-studio-empty p {
    margin: 0;
    color: var(--text-secondary);
}
