/* Dashboard Specific Variables */
:root {
    --sidebar-width: 260px;
    --header-height: 56px;
    --dashboard-bg: #f8fafc; /* Slightly different from landing page */
}

[data-theme="dark"] {
    --dashboard-bg: #0c0d10;
    --glass-bg: #0c0d10;
    --glass-border: rgba(255, 255, 255, 0.05);
    --surface-border: rgba(255, 255, 255, 0.05);
    --bg-main: #0c0d10;
}

/* Dashboard Layout */
body.dashboard-body {
    margin: 0;
    padding: 0;
    background-color: var(--dashboard-bg);
    overflow: hidden; /* We want the main content to scroll, not the whole body */
}

.dashboard-layout {
    display: flex;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background: #0c0d10; /* Changed to darker grey */
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    transition: var(--transition);
    z-index: 100;
}

[data-theme="light"] .sidebar {
    background: var(--surface);
    border-right: 1px solid var(--surface-border);
}

.sidebar-header {
    margin-bottom: 2rem;
    padding: 0 1.5rem;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    font-family: var(--font-sans);
    letter-spacing: -0.02em;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.35rem 1rem;
    margin: 0.1rem 1rem;
    color: #a0a0a0;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 400;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.nav-text {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.nav-item span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.nav-item i {
    flex-shrink: 0;
}

.nav-item i {
    font-size: 1.15rem;
    color: #888888;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: #e0e0e0;
}

.nav-item:hover i {
    color: #e0e0e0;
}

.nav-item.active {
    background: #2a2b2f;
    color: #ffffff;
}

.nav-item.active i {
    color: #ffffff;
}

[data-theme="light"] .nav-item {
    color: #444444;
}
[data-theme="light"] .nav-item i {
    color: #555555;
}
[data-theme="light"] .nav-item:hover {
    background: var(--bg-alt);
    color: var(--text-main);
}
[data-theme="light"] .nav-item.active {
    background: #e2e8f0;
    color: var(--text-main);
}
[data-theme="light"] .nav-item.active i {
    color: var(--text-main);
}

.nav-action-btn {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    transition: background 0.2s;
}

.nav-action-btn i {
    font-size: 0.85rem !important;
    color: #888888 !important;
}

.nav-item:hover .nav-action-btn {
    background: rgba(255, 255, 255, 0.1);
}
.nav-item:hover .nav-action-btn i {
    color: #ffffff !important;
}

[data-theme="light"] .nav-action-btn {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

[data-theme="light"] .sidebar-footer {
    border-top: 1px solid var(--surface-border);
}

/* --- Main Content Area --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* --- Top Header --- */
.top-header {
    height: var(--header-height);
    background: #0c0d10;
    border-bottom: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 99999;
}

[data-theme="light"] .top-header {
    background: var(--surface);
}

.header-left {
    min-width: 0;
    flex: 1;
}

.top-header-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.top-header-title span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.top-header-title i {
    font-size: 1rem;
    flex-shrink: 0;
}

.header-search {
    position: relative;
    width: 300px;
}

.header-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.header-search input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--surface-border);
    background: var(--bg-main);
    color: var(--text-main);
    font-family: inherit;
    transition: var(--transition);
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-left: auto;
    flex-shrink: 0;
}

.credits-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

[data-theme="dark"] .credits-badge {
    background: rgba(122, 92, 255, 0.2);
}

.action-icon {
    font-size: 1.25rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.top-header .theme-btn,
.top-header .action-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.top-header .theme-btn:hover,
.top-header .action-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

[data-theme="light"] .top-header .theme-btn,
[data-theme="light"] .top-header .action-icon {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .top-header .theme-btn:hover,
[data-theme="light"] .top-header .action-icon:hover {
    background: rgba(0, 0, 0, 0.1);
}

.action-icon:hover {
    color: var(--text-main);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}

/* --- Dashboard Scroll Area --- */
.dashboard-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.dashboard-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* --- Welcome Section --- */
.welcome-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
}

.welcome-text h1 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
    font-family: 'Outfit', sans-serif;
}

.welcome-text p {
    color: var(--text-muted);
    margin: 0;
}

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

.stat-card {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

[data-theme="dark"] .stat-icon {
    background: rgba(122, 92, 255, 0.15);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
}

/* --- Two Column Layout (Charts & Activity) --- */
.dashboard-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

/* --- Generic Panel/Card --- */
.panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

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

.panel-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    font-family: 'Outfit', sans-serif;
}

/* --- Chart Area --- */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* --- Activity Timeline --- */
.timeline {
    position: relative;
    padding-left: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--surface-border);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -1.5rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--glass-bg);
    box-sizing: border-box;
}

.timeline-content h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.95rem;
    color: var(--text-main);
}

.timeline-content p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.timeline-content .time {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* --- Recent Projects Table --- */
.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

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

.data-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.data-table td {
    font-size: 0.95rem;
    color: var(--text-main);
}

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

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

.data-table tbody tr:hover {
    background: rgba(0,0,0,0.02);
}

[data-theme="dark"] .data-table tbody tr:hover {
    background: rgba(255,255,255,0.02);
}

.project-title {
    font-weight: 500;
}

.play-btn-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.play-btn-small:hover {
    background: var(--primary);
    color: white;
}

/* --- Voice Library Preview --- */
.voices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.voice-card {
    background: var(--bg-main);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.voice-card:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
}

.voice-avatar-lg {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0.75rem;
}

.voice-name {
    font-weight: 600;
    margin: 0 0 0.25rem 0;
}

/* --- Studio Editor --- */
.studio-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.studio-container {
    background: #1c1c1c; /* Neutral dark grey */
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    min-height: 400px;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .studio-container {
    background: #ffffff;
    border: 1px solid var(--surface-border);
}

.studio-top-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem; /* Reduced padding to bring borders closer to the button */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
}

.studio-top-toolbar::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

[data-theme="light"] .studio-top-toolbar {
    border-bottom: 1px solid var(--surface-border);
    background: #f8fafc;
}

.toolbar-right {
    margin-left: auto;
    display: flex;
    gap: 0.25rem;
}

.studio-tab {
    background: transparent;
    border: none;
    padding: 0.4rem 0.8rem;
    color: #cbd5e1;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

[data-theme="light"] .studio-tab {
    color: var(--text-muted);
}

.studio-tab:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .studio-tab:hover {
    color: var(--text-main);
    background: var(--bg-alt);
}

.studio-tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

[data-theme="light"] .studio-tab.active {
    background: var(--bg-main);
    color: var(--text-main);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.studio-textarea {
    flex: 1;
    background: transparent;
    border: none;
    padding: 2rem;
    color: #f8fafc;
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    line-height: 1.6;
    resize: none;
    outline: none;
}

[data-theme="light"] .studio-textarea {
    color: var(--text-main);
}

.studio-textarea::placeholder {
    color: #475569;
}

.quick-prompts {
    padding: 0 2rem 1rem 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.prompt-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
}

[data-theme="light"] .prompt-pill {
    background: var(--bg-main);
    border: 1px solid var(--surface-border);
    color: var(--text-muted);
}

.prompt-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

[data-theme="light"] .prompt-pill:hover {
    background: var(--bg-alt);
    color: var(--text-main);
}

.studio-controls {
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
}

.controls-left, .controls-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.control-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 500;
}

.control-item i {
    font-size: 1rem;
}

[data-theme="light"] .control-item {
    color: var(--text-muted);
}

.voice-selector {
    color: #cbd5e1;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 9999px; /* Pill shape */
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    transition: var(--transition);
}

[data-theme="light"] .voice-selector {
    color: var(--text-main);
}

.voice-selector:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .voice-selector:hover {
    background: var(--bg-alt);
}

.select-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
}

.settings-text-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.2rem;
    transition: var(--transition);
}

[data-theme="light"] .settings-text-btn {
    color: var(--text-muted);
}

.settings-text-btn:hover {
    color: #cbd5e1;
}

[data-theme="light"] .settings-text-btn:hover {
    color: var(--text-main);
}

.btn-generate-subtle {
    background: rgba(255, 255, 255, 0.9);
    color: #0f172a;
    border: none;
    padding: 0.5rem 1.2rem;
    border-radius: 9999px; /* Extrêmement arrondi (pillule) */
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: var(--transition);
}

[data-theme="light"] .btn-generate-subtle {
    background: var(--primary);
    color: white;
}

.btn-generate-subtle:hover {
    background: white;
    transform: translateY(-1px);
}

[data-theme="light"] .btn-generate-subtle:hover {
    background: var(--primary-dark);
}

.studio-advanced-settings {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

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

.slider-group label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
}

.slider-group input[type="range"] {
    width: 100%;
    accent-color: var(--primary);
}

.studio-result {
    margin-top: 1.5rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    animation: fadeInUp 0.4s ease forwards;
}

.audio-player {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.play-pause-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.audio-progress-bar {
    flex: 1;
    height: 6px;
    background: var(--surface-border);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.audio-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

.audio-time {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: monospace;
}

/* --- Banner --- */
.dashboard-banner {
    background: linear-gradient(135deg, rgba(255,255,255,0.02) 0%, rgba(255,255,255,0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
    min-height: 180px;
}

[data-theme="light"] .dashboard-banner {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid var(--surface-border);
}

.banner-content {
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    z-index: 2;
}

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

.banner-features li {
    font-size: 0.85rem;
    color: #94a3b8;
}

[data-theme="light"] .banner-features li {
    color: var(--text-muted);
}

.banner-title {
    font-size: 1.8rem;
    color: #ffffff;
    font-weight: 600;
    margin: 0;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

[data-theme="light"] .banner-title {
    color: var(--text-main);
}

.badge-v2 {
    background: linear-gradient(90deg, #10b981, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    margin-left: 0.5rem;
}

.badge-alpha {
    font-size: 0.9rem;
    color: #94a3b8;
    font-weight: 400;
    vertical-align: super;
}

.banner-visual {
    position: absolute;
    right: -50px;
    top: -50px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 1;
}

.globe-mockup {
    position: relative;
    width: 100%;
    height: 100%;
}

.lang-tag {
    position: absolute;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    backdrop-filter: blur(4px);
}

[data-theme="light"] .lang-tag {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-main);
    border: 1px solid var(--surface-border);
}

.tag-hindi { top: 35%; left: 20%; }
.tag-russian { top: 30%; right: 25%; }
.tag-spanish { top: 55%; left: 10%; }
.tag-portuguese { top: 50%; right: 15%; }
.tag-arabic { bottom: 25%; left: 30%; }
.tag-chinese { bottom: 30%; right: 20%; }

/* --- Responsive --- */
.mobile-sidebar-toggle {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
}

@media (max-width: 1024px) {
    .dashboard-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        box-shadow: 10px 0 15px -3px rgba(0,0,0,0.1);
    }

    .sidebar.active {
        left: 0;
    }

    .mobile-sidebar-toggle {
        display: block;
    }

    .welcome-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .header-search {
        display: none; /* Hide search on mobile for space */
    }

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

/* --- New Editor Layout Styles (Split Pane) --- */
.editor-split-layout {
    display: flex;
    gap: 0;
    height: calc(100dvh - var(--header-height));
    background-color: transparent;
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    border: none;
}

[data-theme="light"] .editor-split-layout {
    background-color: transparent;
    border: none;
    box-shadow: none;
}

.editor-main-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    position: relative;
}

.editor-side-pane {
    width: 320px;
    background: transparent;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

[data-theme="light"] .editor-side-pane {
    background: transparent;
    border-left: 1px solid var(--surface-border);
}

.hide-on-desktop {
    display: none !important;
}

@media (max-width: 768px) {
    .hide-on-desktop {
        display: flex !important;
    }

    .hide-on-mobile {
        display: none !important;
    }
}

.editor-side-pane {
    width: 320px;
    background: transparent;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

[data-theme="light"] .editor-side-pane {
    background: transparent;
    border-left: 1px solid var(--surface-border);
}

/* Editor Main Area */
.new-textarea {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.1rem;
    line-height: 1.6;
    resize: none;
    outline: none;
    width: 100%;
}

[data-theme="light"] .new-textarea {
    color: var(--text-main);
}

.new-textarea::placeholder {
    color: #4b4b4b;
}

[data-theme="light"] .new-textarea::placeholder {
    color: #94a3b8;
}

.editor-quick-prompts {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.prompts-title {
    display: block;
    color: #888888;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

[data-theme="light"] .prompts-title {
    color: var(--text-muted);
}

.prompts-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.prompt-pill {
    background: transparent;
    border: 1px solid #333333;
    color: #e0e0e0;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

[data-theme="light"] .prompt-pill {
    border-color: var(--surface-border);
    color: var(--text-main);
}

.prompt-pill i {
    font-size: 1rem;
}

.prompt-pill:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: #555555;
}

[data-theme="light"] .prompt-pill:hover {
    background: rgba(0, 0, 0, 0.02);
    border-color: #cbd5e1;
}

/* Bottom Bar */
.editor-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2rem;
    padding-top: 1rem;
    border-top: 1px solid transparent;
}

.editor-credits-info {
    text-align: right;
}

.char-count-display {
    color: #666666;
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

[data-theme="light"] .char-count-display {
    color: var(--text-muted);
}

.credit-cost-display {
    color: #888888;
    font-size: 0.8rem;
}

.btn-light-pill {
    background: #ffffff;
    color: #000000;
    border: none;
    border-radius: 9999px;
    padding: 0.8rem 1.5rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

/* Bottom Audio Player (Image 2 style) */
.bottom-audio-player {
    display: flex;
    align-items: center;
    background: #2a2a2a;
    padding: 0.4rem 0.8rem;
    border-radius: 9999px;
    gap: 1rem;
    border: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .bottom-audio-player {
    background: #ffffff;
    border-color: rgba(0,0,0,0.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.bottom-player-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    color: #000000;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.bottom-player-btn:hover {
    transform: scale(1.05);
}

[data-theme="light"] .bottom-player-btn {
    background: #111111;
    color: #ffffff;
}

.bottom-player-time {
    font-size: 0.85rem;
    color: #93c5fd;
    font-family: monospace;
    letter-spacing: 0.5px;
}

[data-theme="light"] .bottom-player-time {
    color: #2563eb;
}

.btn-light-pill:hover {
    background: #e0e0e0;
}

[data-theme="light"] .btn-light-pill {
    background: var(--primary);
    color: #ffffff;
}

[data-theme="light"] .btn-light-pill:hover {
    background: var(--primary-hover);
}

/* Side Pane Settings */
.side-pane-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    padding: 5px;
    margin: 1rem 1.5rem;
    gap: 5px;
}

[data-theme="light"] .side-pane-tabs {
    background: rgba(0, 0, 0, 0.05);
    border-bottom: none;
}

.side-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: #888888;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 50px;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    text-align: center;
}

[data-theme="light"] .side-tab {
    color: var(--text-muted);
}

.side-tab.active {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .side-tab.active {
    background: #ffffff;
    color: var(--text-main);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.side-pane-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

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

.setting-label {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

[data-theme="light"] .setting-label {
    color: var(--text-main);
}

/* Custom Selects */
.custom-select-box {
    background: #111111;
    border: 1px solid #333333;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    color: #ffffff;
    font-size: 0.9rem;
}

[data-theme="light"] .custom-select-box {
    background: #ffffff;
    border: 1px solid var(--surface-border);
    color: var(--text-main);
}

.custom-select-box .ml-auto {
    margin-left: auto;
    color: #888888;
}

.select-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

/* Custom Dropdowns */
.custom-dropdown {
    position: relative;
    width: 100%;
}
.custom-dropdown .dropdown-trigger {
    background: #111111;
    border: 1px solid #333333;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    cursor: pointer;
    color: #ffffff;
    font-size: 0.9rem;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, opacity 0.2s, transform 0.2s;
}
[data-theme="light"] .custom-dropdown .dropdown-trigger {
    background: #ffffff;
    border: 1px solid var(--surface-border);
    color: var(--text-main);
}
.custom-dropdown .dropdown-trigger:hover {
    border-color: var(--primary);
}
.custom-dropdown .dropdown-trigger .ml-auto {
    margin-left: auto;
    color: #888888;
    transition: transform 0.2s;
}
.custom-dropdown.open .dropdown-trigger .ml-auto {
    transform: rotate(180deg);
}
.custom-dropdown .dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: #1a1a1a;
    border: 1px solid #333333;
    border-radius: 8px;
    z-index: 100;
    display: none;
    flex-direction: column;
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .custom-dropdown .dropdown-menu {
    background: #ffffff;
    border: 1px solid var(--surface-border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}
.custom-dropdown.open .dropdown-menu {
    display: flex;
}
.custom-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    cursor: pointer;
    color: #ffffff;
    font-size: 0.9rem;
    transition: background 0.2s;
}
[data-theme="light"] .custom-dropdown .dropdown-item {
    color: var(--text-main);
}
.custom-dropdown .dropdown-item:hover,
.custom-dropdown .dropdown-item.active {
    background: #2a2a2a;
}
[data-theme="light"] .custom-dropdown .dropdown-item:hover,
[data-theme="light"] .custom-dropdown .dropdown-item.active {
    background: #f5f5f5;
}

.custom-dropdown .explore-more-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
}
[data-theme="light"] .custom-dropdown .explore-more-item {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}
.custom-dropdown .explore-more-item:hover {
    background: rgba(122, 92, 255, 0.1);
}

/* Model Selector (Gradient) */
.model-select-box {
    background: #111111;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333333;
}

[data-theme="light"] .model-select-box {
    background: #ffffff;
    border: 1px solid var(--surface-border);
}

.model-select-trigger {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    color: #ffffff;
    font-size: 0.9rem;
    cursor: pointer;
    border-bottom: 1px solid #222222;
}

[data-theme="light"] .model-select-trigger {
    color: var(--text-main);
    border-bottom: 1px solid var(--surface-border);
}

.model-v2-badge {
    border: 1px solid #ffffff;
    border-radius: 4px;
    padding: 0.1rem 0.3rem;
    font-size: 0.7rem;
    font-weight: 700;
}

[data-theme="light"] .model-v2-badge {
    border: 1px solid var(--text-main);
}

.model-promo {
    background: linear-gradient(90deg, #2a9d8f, #e9c46a, #f4a261, #e76f51);
    background-size: 200% 200%;
    animation: gradientShift 5s ease infinite;
    padding: 0.6rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #ffffff;
    font-size: 0.8rem;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.btn-try-v3 {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    cursor: pointer;
}

/* Pro Sliders */
.pro-slider-wrapper {
    position: relative;
    width: 100%;
    height: 36px;
    background: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    user-select: none;
    margin-bottom: 0.5rem;
}

[data-theme="light"] .pro-slider-wrapper {
    background: #e2e8f0;
}

.pro-slider-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #404040;
    width: var(--val, 50%);
    pointer-events: none;
    border-radius: 8px;
}

[data-theme="light"] .pro-slider-fill {
    background: #cbd5e1;
}

.pro-slider-label {
    position: absolute;
    left: 1rem;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    z-index: 2;
    display: flex;
    align-items: center;
}

.pro-slider-label::after {
    content: "";
    display: inline-block;
    width: 2px;
    height: 12px;
    background: rgba(255, 255, 255, 0.2);
    margin-left: 8px;
    border-radius: 1px;
}

[data-theme="light"] .pro-slider-label {
    color: var(--text-main);
}

[data-theme="light"] .pro-slider-label::after {
    background: rgba(0, 0, 0, 0.2);
}

.pro-slider-value {
    position: absolute;
    right: 1rem;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    pointer-events: none;
}

[data-theme="light"] .pro-slider-value {
    color: var(--text-main);
}

.pro-slider-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 10;
}

.pro-slider-wrapper:focus-within {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Toggle Switch */
.toggle-group {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.custom-toggle {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.custom-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333333;
    transition: .4s;
    border-radius: 20px;
}

[data-theme="light"] .toggle-slider {
    background-color: var(--surface-border);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: #aaaaaa;
    transition: .4s;
    border-radius: 50%;
}

[data-theme="light"] .toggle-slider:before {
    background-color: white;
}

input:checked + .toggle-slider {
    background-color: #ffffff;
}

[data-theme="light"] input:checked + .toggle-slider {
    background-color: var(--primary);
}

input:checked + .toggle-slider:before {
    transform: translateX(16px);
    background-color: #000000;
}

[data-theme="light"] input:checked + .toggle-slider:before {
    background-color: white;
}

/* Audio Player and Loading */

.editor-audio-result {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #181818;
    border-radius: var(--radius-lg);
    margin-top: 1rem;
}

[data-theme="light"] .editor-audio-result {
    background: var(--surface);
    border: 1px solid var(--surface-border);
}

/* Responsive Editor Split Layout */
@media (max-width: 1024px) {
    .editor-split-layout {
        flex-direction: column;
        height: auto;
        min-height: calc(100dvh - var(--header-height) - 2rem);
    }

    .editor-side-pane {
        width: 100%;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }

    [data-theme="light"] .editor-side-pane {
        border-top: 1px solid var(--surface-border);
        border-left: none;
    }

    .editor-main-pane {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .dashboard-scroll {
        padding: 1rem;
        overflow-x: hidden;
    }

    .welcome-text h1 {
        font-size: 1.5rem;
        word-break: break-word;
    }

    .welcome-text p {
        font-size: 0.9rem;
    }

    .editor-main-pane {
        padding: 0.75rem; /* Réduire la marge latérale */
    }

    .top-header-title {
        font-size: 0.95rem;
    }

    .top-header-title i {
        font-size: 1rem;
    }

    .header-actions {
        gap: 6px;
    }

    .top-header .theme-btn,
    .top-header .action-icon {
        width: 40px;
        height: 40px;
    }

    .top-header .lang-toggle-btn {
        width: 52px;
        padding: 0 0.3rem;
    }

    .user-profile .user-avatar {
        width: 40px;
        height: 40px;
    }

    .action-icon, .theme-btn i {
        font-size: 1.2rem;
    }

    .mobile-sidebar-toggle {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hide-mobile {
        display: none;
    }

    /* Bottom actions mobile overrides moved to the end of file for proper cascading */

    .modal-content {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .header-actions {
        gap: 4px;
    }

    .top-header-title {
        font-size: 0.85rem;
    }

    .top-header .theme-btn,
    .top-header .action-icon,
    .user-profile .user-avatar,
    .mobile-sidebar-toggle {
        width: 36px;
        height: 36px;
    }

    .top-header .lang-toggle-btn {
        width: 48px;
    }

    .action-icon, .theme-btn i {
        font-size: 1.1rem;
    }
}

/* Editor Bottom Bar Styling */
.editor-bottom-bar {
    display: flex;
    flex-direction: column;
    padding-top: 1rem;
}

#bottom-audio-player-container {
    grid-area: audio;
    width: 100%;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    justify-content: flex-start;
}

/* Audio Results Area (Above bottom bar) */
.editor-audio-results-wrapper {
    grid-area: audio;
    margin: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem; /* slightly larger gap since they are side by side */
    width: 100%;
}

.results-title {
    font-size: 0.95rem;
    color: var(--text-main);
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.audio-proposal-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex: 1;
    min-width: 250px; /* Forces wrapping on mobile screens so they stack vertically */
}

.audio-proposal-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 0.5rem;
}

/* New Pill Audio Player Design */
.audio-player-pill {
    display: flex;
    align-items: center;
    background: #2C2C2C;
    border-radius: 99px;
    padding: 0.5rem 1rem 0.5rem 0.5rem;
    gap: 1rem;
    width: 100%;
    box-sizing: border-box;
}

[data-theme="light"] .audio-player-pill {
    background: #f1f5f9;
}

.pill-play-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ffffff;
    color: #000000;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s;
}

[data-theme="light"] .pill-play-btn {
    background: #000000;
    color: #ffffff;
}

.pill-play-btn:hover {
    transform: scale(1.05);
}

.pill-waveform {
    flex: 1;
    display: flex;
    align-items: center;
    opacity: 0.5;
}

.pill-time {
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

[data-theme="light"] .pill-time {
    color: #000000;
}

.pill-download-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, opacity 0.2s, transform 0.2s;
}

[data-theme="light"] .pill-download-btn {
    border-color: rgba(0,0,0,0.2);
}

.pill-download-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .pill-download-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.editor-bottom-actions {
    display: grid;
    grid-template-columns: 1fr auto auto;
    grid-template-rows: auto auto;
    grid-template-areas:
        "audio audio audio"
        ". info button";
    align-items: end;
    column-gap: 1.5rem;
    row-gap: 1rem;
    width: 100%;
}

.bottom-controls-row {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.voice-selector-bottom {
    flex: 1;
    margin-bottom: 0;
}

.voice-selector-bottom .dropdown-trigger {
    padding: 0.6rem 1rem;
    border-radius: 8px;
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .voice-selector-bottom .dropdown-trigger {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

.icon-btn-outline {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.icon-btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .icon-btn-outline {
    border: 1px solid #e2e8f0;
}

[data-theme="light"] .icon-btn-outline:hover {
    background: rgba(0, 0, 0, 0.02);
}

.btn-generate-full {
    grid-area: button;
    background: var(--gradient-brand);
    color: #ffffff;
    border: none;
    padding: 0 1.5rem;
    height: 44px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
    font-family: inherit;
    margin-bottom: 0.2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.btn-generate-full:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
}

.editor-credits-info {
    grid-area: info;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.3rem;
    margin-bottom: 0; /* Removed margin so the text block sits at the bottom */
}

.credit-cost-display {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: #888888;
}

.char-count-display {
    font-size: 0.8rem;
    color: #888888;
}

[data-theme="light"] .credit-cost-display,
[data-theme="light"] .char-count-display {
    color: var(--text-muted);
}

/* Settings Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.2s forwards;
}

[data-theme="light"] .modal-overlay {
    background: rgba(15, 23, 42, 0.4); /* Professional slate tint */
}

.modal-content {
    background: #181818;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 90%;
    max-width: 400px;
    padding: 1.5rem;
    transform: translateY(20px);
    animation: slideUp 0.3s forwards cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .modal-content {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-main);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 50%;
    transition: background 0.2s;
}

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

[data-theme="light"] .icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes fadeOut {
    to { opacity: 0; }
}

@keyframes slideUp {
    to { transform: translateY(0); }
}

@keyframes slideDown {
    to { transform: translateY(20px); }
}

/* Fix for mobile layout wrapper to not break desktop grid */
.mobile-controls-wrapper {
    display: contents;
}

/* Base styles are overridden on mobile here to ensure correct cascading */
@media (max-width: 768px) {
    .editor-bottom-actions {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
        width: 100%;
    }

    .mobile-controls-wrapper {
        display: flex;
        width: 100%;
        justify-content: space-between;
        align-items: center;
    }

    .editor-credits-info {
        display: flex;
        flex-direction: column;
        gap: 0.3rem;
        align-items: flex-start;
    }

    .char-count-display {
        margin: 0;
        font-size: 0.9rem;
    }

    .credit-cost-display {
        margin: 0;
        font-size: 0.9rem;
    }

    #mobile-bottom-controls {
        display: flex;
        align-items: center;
        gap: 0.8rem;
    }

    .btn-generate-full {
        width: 100%;
        border-radius: 999px;
    }

    /* HISTORY CONTAINER & SCROLLBAR */
    #history-list-container {
        padding-right: 0.2rem;
        scrollbar-gutter: stable; /* Empêche la scrollbar de réduire la largeur utile */
    }

    /* HISTORY FILTERS MOBILE */
    #history-filters {
        flex-direction: column !important;
        gap: 0.8rem !important;
        margin-bottom: 1.5rem !important;
        width: 100% !important;
        box-sizing: border-box;
    }
    #history-filters > * {
        width: 100% !important;
        flex: none !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    /* HISTORY CARD (SIDE-HISTORY-ITEM) */
    .side-history-item {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin-bottom: 0.5rem; /* Espace régulier d'environ 24px géré par le gap du parent (1rem=16px + margin=8px) */
        overflow: hidden;
    }

    /* HISTORY HEADER (AVATAR + NAME + DATE) */
    .shi-header {
        width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }
    .shi-user {
        min-width: 0; /* Permet la troncature du nom sans pousser la date */
        flex: 1 1 auto;
    }
    .shi-name {
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .shi-date {
        flex-shrink: 0; /* Protège la date de la compression */
    }

    /* HISTORY TEXT OVERFLOW MOBILE */
    .shi-text {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow-wrap: break-word;
        word-wrap: break-word;
        word-break: break-word;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    /* HISTORY ACTIONS MOBILE */
    .shi-main-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    width: 100%;
    box-sizing: border-box;
    flex-wrap: nowrap;
    overflow-x: auto;
}

    /* SIDE PANE TABS MOBILE */
    .side-pane-tabs {
        margin: 1rem 0 !important;
        padding: 4px !important;
        width: 100%;
        box-sizing: border-box;
    }
    .side-tab {
        padding: 0.6rem 0.2rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }
}

/* --- Profile Dropdown Menu --- */
.user-profile {
    position: relative;
    cursor: pointer;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    width: 270px;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

[data-theme="dark"] .profile-dropdown {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}

.user-profile.active .profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
}

.dh-avatar-wrapper {
    position: relative;
    display: inline-block;
}

.avatar-upload-btn {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 2px solid var(--surface);
    transition: transform 0.2s;
}

.avatar-upload-btn:hover {
    transform: scale(1.1);
}

.dh-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

.dh-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.dh-info h4 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text-main);
    font-weight: 700;
}

.dh-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.plan-badge {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 100px;
    letter-spacing: 0.02em;
}

.dropdown-credits-section {
    padding: 0.8rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.credits-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.credits-amount {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
}

.credits-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--bg-alt);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.credits-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 0.3rem 0;
}

.dropdown-stats {
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-stats i {
    color: #f59e0b;
    font-size: 1.1rem;
}

.dropdown-links a {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.45rem 1rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.dropdown-links a:hover {
    background: var(--bg-alt);
    color: var(--primary);
}

.dropdown-links a.text-danger:hover {
    color: #ef4444;
}

.dropdown-links a.text-danger:hover i {
    color: #ef4444;
}

.dropdown-links i {
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: color 0.2s;
}

.dropdown-links a:hover i {
    color: var(--primary);
}

/* --- Side History Item (Premium SaaS Redesign) --- */
.side-history-item {
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.side-history-item:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}

.shi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.shi-user {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    flex: 1;
}

.shi-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.shi-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shi-date {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.shi-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: break-word;
    word-break: break-word;
    margin: 0;
}

.shi-actions-row {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    width: 100%;
}

.shi-main-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    width: 100%;
    box-sizing: border-box;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.shi-icon-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.shi-icon-btn i {
    font-size: 1.1rem;
}

.shi-play:hover {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.2);
}

.shi-dl:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-color: rgba(59, 130, 246, 0.2);
}

.shi-share:hover {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    border-color: rgba(139, 92, 246, 0.2);
}

.shi-delete {
    margin-left: auto;
    background: transparent !important;
    border-color: transparent !important;
    color: var(--text-muted) !important;
}

.shi-delete:hover {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

/* New Voice Selector Styles */
.new-voice-selector {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
}

[data-theme="light"] .new-voice-selector {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.voice-selector-current {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

[data-theme="light"] .voice-selector-current {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.voice-selector-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    margin-right: 12px;
    background: #ffdfbf;
    object-fit: cover;
}

.voice-selector-name {
    font-weight: 500;
    flex: 1;
    font-size: 0.95rem;
    color: #ffffff;
}

[data-theme="light"] .voice-selector-name {
    color: var(--text-main);
}

.voice-selector-icon {
    color: #888888;
}

[data-theme="light"] .voice-selector-icon {
    color: var(--text-muted);
}

.voice-selector-add {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: background 0.2s;
    border-radius: 0 0 12px 12px;
}

[data-theme="light"] .voice-selector-add {
    color: var(--text-main);
}

.voice-selector-add:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .voice-selector-add:hover {
    background: rgba(0, 0, 0, 0.04);
}

.voice-selector-add-icon {
    margin-right: 12px;
    font-size: 1.15rem;
    color: #ffffff;
}

[data-theme="light"] .voice-selector-add-icon {
    color: var(--text-main);
}

/* Dual Generation Styles */
.dual-gen-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .dual-gen-container {
        grid-template-columns: 1fr;
    }
}

.dual-gen-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.dual-gen-legend {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    margin-left: 0.5rem;
}
.custom-dropdown .dropdown-trigger .selected-text { display: flex; align-items: center; gap: 0.5rem; }

/* Premium Lock Card */
.premium-lock-container {
    background: linear-gradient(145deg, rgba(30,30,40,0.8) 0%, rgba(20,20,30,0.95) 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05), inset 0 0 20px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.premium-lock-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.05), inset 0 0 20px rgba(0, 0, 0, 0.05);
    border-color: rgba(139, 92, 246, 0.5);
}

.premium-lock-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.05));
}

.premium-lock-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.premium-lock-desc {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.premium-benefits {
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 0 auto 2rem auto;
    display: inline-block;
    text-align: left;
    border: 1px solid rgba(255,255,255,0.05);
}

.premium-benefits p {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.premium-benefits ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.8rem 1.5rem;
}

.premium-benefits li {
    color: var(--text-muted);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.premium-benefits li i {
    color: #10b981;
    font-size: 1.1rem;
}

.premium-lock-btn {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563EB 0%, #0EA5E9 50%, #00D4FF 100%);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.premium-lock-btn:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* --- Premium UI --- */
.user-avatar.is-premium, .dh-avatar img.is-premium {
    border: none;
    padding: 2px;
    background: linear-gradient(135deg, #F59E0B, #FFD700, #EAB308);
}

.sidebar-premium-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0 14px;
    height: 46px;
    box-sizing: border-box;
    margin: 0.5rem 1rem 1rem 1rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #F59E0B, #FFD700, #EAB308);
    color: #1f2937;
    font-weight: 600;
    cursor: default;
    font-size: 0.85rem;
    text-align: center;
}
.sidebar-premium-btn i {
    font-size: 1rem;
    flex-shrink: 0;
}
.sidebar-premium-btn span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.btn-hide-premium {
    background: transparent;
    border: none;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    padding: 0 0.2rem;
    margin-left: 0.5rem;
    display: flex;
    align-items: center;
    transition: opacity 0.2s, transform 0.2s;
    font-size: 1.1rem;
}
.btn-hide-premium:hover {
    opacity: 1;
    transform: scale(1.1);
}
.sidebar-premium-btn.hidden {
    display: none !important;
}


/* Mobile Layout Enhancements (Voice Selector & Text Area Width) */
@media (max-width: 768px) {
    .editor-main-pane {
        padding: 0 !important;
    }
    .studio-textarea {
        padding: 0.5rem 0.75rem !important;
    }
    .editor-bottom-bar {
        padding: 1rem 0.75rem 0 0.75rem !important;
    }
    /* Mobile Top Voice Selector */
    .mobile-voice-top-wrapper {
        display: flex;
        align-items: center;
        margin-bottom: 0.5rem;
        padding: 0 0.75rem;
        margin-top: 0.5rem;
    }
    .mobile-voice-top-wrapper .new-voice-selector {
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        width: auto !important;
        display: inline-flex !important;
        padding: 0 !important;
    }
    .mobile-voice-top-wrapper .voice-selector-current {
        padding: 4px 12px 4px 4px !important;
        border: none !important;
        background: rgba(255, 255, 255, 0.05) !important;
        border-radius: 30px !important;
        height: auto !important;
    }
    [data-theme='light'] .mobile-voice-top-wrapper .voice-selector-current {
        background: rgba(0, 0, 0, 0.04) !important;
    }
    .mobile-voice-top-wrapper .voice-selector-avatar {
        width: 32px !important;
        height: 32px !important;
        margin-right: 8px !important;
    }
    .mobile-voice-top-wrapper .voice-selector-desc {
        display: none !important;
    }
    .mobile-voice-top-wrapper .voice-selector-info {
        display: flex !important;
        align-items: center !important;
    }
    .mobile-voice-top-wrapper .voice-selector-name {
        font-size: 0.95rem !important;
        font-weight: 500 !important;
        margin-right: 0.5rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }
}

@media (max-width: 768px) {
    .mobile-voice-top-wrapper .voice-selector-add {
        display: none !important;
    }
}



/* Push bottom controls down on mobile */
@media (max-width: 768px) {
    .editor-split-layout {
        min-height: calc(100dvh - var(--header-height)) !important;
        height: calc(100dvh - var(--header-height));
        display: flex !important;
        flex-direction: column !important;
    }
    .editor-main-pane {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
    }
    .studio-textarea {
        flex: 1 !important;
        min-height: 80px;
    }
    .editor-bottom-bar {
        margin-top: auto !important;
    }
}

/* ========================================================= */
/* MOBILE SUBTLE COMPACT TWEAKS (5-10% REDUCTION + PILL BTN) */
/* ========================================================= */
@media (max-width: 768px) {
    /* 1. SÉLECTEUR DE VOIX EN HAUT (Slightly smaller) */
    .mobile-voice-top-wrapper {
        margin-bottom: 0.35rem !important; /* was 0.5rem */
    }
    .mobile-voice-top-wrapper .voice-selector-current {
        padding: 3px 10px 3px 3px !important; /* was 4px 12px 4px 4px */
    }
    .mobile-voice-top-wrapper .voice-selector-avatar {
        width: 28px !important; /* was 32px */
        height: 28px !important;
        margin-right: 6px !important; /* was 8px */
    }
    .mobile-voice-top-wrapper .voice-selector-name {
        font-size: 0.88rem !important; /* was 0.95rem */
    }

    /* 2. ZONE DE TEXTE (Slightly more compact text/padding) */
    .studio-textarea {
        padding: 0.45rem 0.65rem !important; /* was 0.5rem 0.75rem */
        font-size: 0.98rem !important; /* default is ~1.05rem */
    }
    .studio-textarea::placeholder {
        font-size: 0.95rem !important;
    }

    /* 3. ÉLÉMENTS DU BAS (Compteur, Crédits, Paramètres) */
    .editor-bottom-actions {
        gap: 0.75rem !important; /* was 1rem */
    }
    .char-count-display, .credit-cost-display {
        font-size: 0.83rem !important; /* was 0.9rem */
    }
    .editor-credits-info {
        gap: 0.2rem !important; /* was 0.3rem */
    }
    #settings-modal-btn {
        width: 38px !important;  /* was 42px */
        height: 38px !important;
        padding: 0 !important;
    }
    #settings-modal-btn i {
        font-size: 1.15rem !important; /* slightly smaller icon */
    }

    /* 4. BOUTON « GÉNÉRER LA VOIX » (More rounded, pill shape) */
    .btn-generate-full {
        border-radius: 999px !important; /* enhanced rounding for a modern pill look, was 8px */
    }
}

/* ========================================================= */
/* COMPACT HISTORY DATE FILTER                               */
/* ========================================================= */
.history-compact-date-filter {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.history-compact-date-filter i {
    position: absolute;
    right: 0.6rem;
    pointer-events: none;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.compact-date-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 0.4rem 2rem 0.4rem 0.8rem;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-color);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    width: auto;
    min-width: 140px;
}

.compact-date-select:hover {
    background-color: var(--surface, rgba(0,0,0,0.02));
    border-color: var(--text-muted);
}

.compact-date-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

/* ========================================================= */
/* GRADIENT UPDATE: BOUTON "GÉNÉRER LA VOIX"                 */
/* ========================================================= */
/* Target ONLY the "Générer la voix" button via its ID */
#generate-btn {
    background: linear-gradient(90deg, #2563EB 0%, #0EA5E9 50%, #00D4FF 100%) !important;
    color: #ffffff !important; /* Ensure perfect readability in all modes */
    border: none !important;
}

/* Hover state: slight brightness increase for interactivity */
#generate-btn:hover {
    background: linear-gradient(90deg, #3B82F6 0%, #38BDF8 50%, #22D3EE 100%) !important;
}

/* ========================================================= */
/* REFONTE DES BOUTONS : PILL BUTTONS                        */
/* ========================================================= */
/* S'applique spécifiquement au bouton Générer la voix demandé */
#generate-btn {
    border-radius: 999px !important;
}

.shi-pill-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    transition: all 0.2s ease;
    font-size: 0.85rem;
    font-family: inherit;
}
.shi-pill-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}
.shi-pill-btn.shi-play:hover { background: rgba(16, 185, 129, 0.1); color: #10b981; border-color: rgba(16, 185, 129, 0.2); }
.shi-pill-btn.shi-dl:hover { background: rgba(59, 130, 246, 0.1); color: #3b82f6; border-color: rgba(59, 130, 246, 0.2); }
