/* ==========================================
   CSS Variables & Theme
   ========================================== */
:root {
    /* Colors - Light Theme */
    --color-primary: #6366f1;
    --color-primary-hover: #4f46e5;
    --color-primary-light: #eef2ff;
    --color-secondary: #64748b;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    
    --color-bg-primary: #f8fafc;
    --color-bg-secondary: #ffffff;
    --color-bg-tertiary: #f1f5f9;
    
    --color-text-primary: #0f172a;
    --color-text-secondary: #475569;
    --color-text-tertiary: #94a3b8;
    
    --color-border: #e2e8f0;
    --color-border-hover: #cbd5e1;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    
    /* Sidebar */
    --sidebar-width: 260px;
}

/* Dark Theme */
[data-theme="dark"] {
    --color-primary: #818cf8;
    --color-primary-hover: #6366f1;
    --color-primary-light: #1e1b4b;
    
    --color-bg-primary: #0f172a;
    --color-bg-secondary: #1e293b;
    --color-bg-tertiary: #334155;
    
    --color-text-primary: #f8fafc;
    --color-text-secondary: #cbd5e1;
    --color-text-tertiary: #64748b;
    
    --color-border: #334155;
    --color-border-hover: #475569;
}

/* ==========================================
   Reset & Base Styles
   ========================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ==========================================
   Layout
   ========================================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ==========================================
   Sidebar
   ========================================== */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--color-bg-secondary);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 100;
    padding: var(--spacing-lg);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding-bottom: var(--spacing-xl);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--spacing-lg);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--color-primary), #a855f7);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.logo-icon svg {
    width: 22px;
    height: 22px;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-section {
    margin-bottom: var(--spacing-xl);
}

.nav-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-tertiary);
    margin-bottom: var(--spacing-sm);
    padding-left: var(--spacing-sm);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
    margin-bottom: var(--spacing-xs);
}

.nav-item:hover {
    background-color: var(--color-bg-tertiary);
    color: var(--color-text-primary);
}

.nav-item.active {
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: 500;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.status-indicator {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background-color: var(--color-bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.status-dot.online {
    background-color: var(--color-success);
    box-shadow: 0 0 8px var(--color-success);
}

.status-dot.offline {
    background-color: var(--color-error);
}

.status-dot.checking {
    background-color: var(--color-warning);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ==========================================
   Main Content
   ========================================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--spacing-2xl);
    max-width: 1200px;
}

.page-header {
    margin-bottom: var(--spacing-2xl);
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.page-header p {
    color: var(--color-text-secondary);
    font-size: 1rem;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* ==========================================
   Cards
   ========================================== */
.card {
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
    margin-bottom: var(--spacing-lg);
}

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

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
}

.card-body {
    padding: var(--spacing-lg);
}

.char-count {
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
}

/* ==========================================
   TTS Container
   ========================================== */
.tts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
}

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

.input-section,
.output-section {
    display: flex;
    flex-direction: column;
}

/* Textarea */
textarea {
    width: 100%;
    min-height: 150px;
    padding: var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    resize: vertical;
    transition: border-color var(--transition-fast);
}

textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

textarea::placeholder {
    color: var(--color-text-tertiary);
}

/* Voice Grid */
.voice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--spacing-md);
}

.voice-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--spacing-lg);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.voice-option:hover {
    border-color: var(--color-primary);
    background-color: var(--color-primary-light);
}

.voice-option.selected {
    border-color: var(--color-primary);
    background-color: var(--color-primary-light);
}

.voice-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--color-primary), #a855f7);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.voice-name {
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
}

/* ==========================================
   Buttons
   ========================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all var(--transition-fast);
}

.btn svg {
    width: 18px;
    height: 18px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), #a855f7);
    color: white;
    box-shadow: var(--shadow-md);
}

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

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

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

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

.btn-generate {
    width: 100%;
    padding: var(--spacing-lg);
    font-size: 1rem;
    margin-top: auto;
}

/* ==========================================
   Player
   ========================================== */
.player-card {
    flex: 1;
    position: relative;
}

.player-container {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-placeholder {
    text-align: center;
    color: var(--color-text-tertiary);
}

.player-placeholder svg {
    width: 64px;
    height: 64px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.player-placeholder p {
    font-size: 0.875rem;
}

.player {
    width: 100%;
}

.waveform-container {
    position: relative;
    height: 100px;
    background-color: var(--color-bg-primary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow var(--transition-fast);
}

.waveform-container:hover {
    box-shadow: 0 0 0 2px var(--color-primary);
}

.waveform {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    opacity: 0.4;
}

.waveform canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.waveform-progress {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 0%;
    overflow: hidden;
    z-index: 2;
    pointer-events: none;
}

.waveform-progress .waveform-played {
    position: absolute;
    inset: 0;
}

.waveform-progress .waveform-played canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.waveform-cursor {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0%;
    width: 3px;
    background: linear-gradient(180deg, var(--color-primary), #a855f7);
    border-radius: 2px;
    z-index: 3;
    pointer-events: none;
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
    transition: left 0.05s linear;
}

.waveform-cursor::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, var(--color-primary), #a855f7);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
}

.waveform-cursor::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, var(--color-primary), #a855f7);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.4);
}

.player-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.btn-player {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    background-color: var(--color-bg-tertiary);
    color: var(--color-text-primary);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

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

.btn-player.btn-play-main {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--color-primary), #a855f7);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-player.btn-play-main:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.btn-player svg {
    width: 20px;
    height: 20px;
}

.btn-player.btn-play-main svg {
    width: 24px;
    height: 24px;
}

.time-display {
    font-size: 0.9rem;
    font-family: 'Inter', monospace;
    color: var(--color-text-secondary);
    min-width: 90px;
    font-weight: 500;
}

/* ==========================================
   Loading
   ========================================== */
.loading-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl);
    z-index: 10;
}

[data-theme="dark"] .loading-overlay {
    background-color: rgba(15, 23, 42, 0.9);
}

.loading-spinner {
    text-align: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
    margin: 0 auto var(--spacing-md);
}

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

.loading-spinner p {
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.loading-time {
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
}

/* ==========================================
   Clone Page
   ========================================== */
.clone-container {
    max-width: 700px;
    position: relative;
}

.upload-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-2xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--color-primary);
    background-color: var(--color-primary-light);
}

.upload-content svg {
    width: 48px;
    height: 48px;
    color: var(--color-text-tertiary);
    margin-bottom: var(--spacing-md);
}

.upload-content p {
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
}

.upload-content span {
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
}

.uploaded-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md);
    background-color: var(--color-bg-primary);
    border-radius: var(--radius-md);
    margin-top: var(--spacing-md);
}

.file-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.file-info svg {
    width: 24px;
    height: 24px;
    color: var(--color-primary);
}

.file-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.btn-preview {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: white;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    transition: all var(--transition-fast);
}

.btn-preview:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-preview svg {
    width: 16px;
    height: 16px;
}

.btn-preview .pause-icon {
    width: 14px;
    height: 14px;
}

.btn-remove {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--color-text-tertiary);
    transition: all var(--transition-fast);
}

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

.btn-remove svg {
    width: 16px;
    height: 16px;
}

/* Preview Player */
.preview-player {
    margin-top: var(--spacing-md);
    padding: var(--spacing-lg);
    background-color: var(--color-bg-primary);
    border-radius: var(--radius-lg);
    border: 2px solid var(--color-border);
}

.preview-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.preview-player .waveform-container {
    margin-bottom: var(--spacing-md);
}

/* ==========================================
   History Page
   ========================================== */
.history-container {
    max-width: 800px;
}

/* History Player Card */
.history-player-card {
    margin-bottom: var(--spacing-xl);
    border: 2px solid var(--color-primary);
    box-shadow: var(--shadow-lg);
    display: none;
}

.history-player-card.show {
    display: block;
    animation: slideDown 0.3s ease-out;
}

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

.history-player-card .card-header {
    background: linear-gradient(135deg, var(--color-primary-light), transparent);
}

.history-player-card .card-header h3 {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.history-player-card .card-header h3::before {
    content: '🎵';
}

.btn-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    color: var(--color-text-tertiary);
    transition: all var(--transition-fast);
}

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

.btn-close svg {
    width: 18px;
    height: 18px;
}

.history-player-text {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    background-color: var(--color-bg-primary);
    border-radius: var(--radius-md);
    line-height: 1.6;
    max-height: 80px;
    overflow-y: auto;
}

.history-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--spacing-lg);
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.history-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.history-item:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.history-item.playing {
    border-color: var(--color-primary);
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-bg-secondary));
}

.history-play {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-primary), #a855f7);
    border-radius: var(--radius-full);
    color: white;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}

.history-play:hover {
    transform: scale(1.1);
}

.history-play svg {
    width: 20px;
    height: 20px;
}

.history-info {
    flex: 1;
    min-width: 0;
}

.history-text {
    font-weight: 500;
    margin-bottom: var(--spacing-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-meta {
    display: flex;
    gap: var(--spacing-lg);
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
}

.history-actions-item {
    display: flex;
    gap: var(--spacing-sm);
}

.history-actions-item button {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    color: var(--color-text-secondary);
    transition: all var(--transition-fast);
}

.history-actions-item button:hover {
    background-color: var(--color-bg-tertiary);
    color: var(--color-text-primary);
}

.history-actions-item button svg {
    width: 18px;
    height: 18px;
}

.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--color-text-tertiary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-state p {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-xs);
}

.empty-state span {
    font-size: 0.875rem;
}

/* ==========================================
   Settings Page
   ========================================== */
.settings-container {
    max-width: 600px;
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
}

.form-group input[type="url"],
.form-group input[type="text"] {
    width: 100%;
    padding: var(--spacing-md);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    transition: border-color var(--transition-fast);
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-hint {
    display: block;
    font-size: 0.875rem;
    color: var(--color-text-tertiary);
    margin-top: var(--spacing-xs);
}

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}

.toggle {
    width: 48px;
    height: 26px;
    background-color: var(--color-bg-tertiary);
    border-radius: var(--radius-full);
    position: relative;
    transition: background-color var(--transition-fast);
}

.toggle.active {
    background-color: var(--color-primary);
}

.toggle-switch {
    width: 22px;
    height: 22px;
    background-color: white;
    border-radius: var(--radius-full);
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.toggle.active .toggle-switch {
    transform: translateX(22px);
}

.about-content p {
    margin-bottom: var(--spacing-lg);
    color: var(--color-text-secondary);
}

.about-links {
    display: flex;
    gap: var(--spacing-md);
}

.about-links a {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--color-bg-tertiary);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    transition: all var(--transition-fast);
}

.about-links a:hover {
    background-color: var(--color-border);
}

.about-links svg {
    width: 18px;
    height: 18px;
}

/* ==========================================
   Toast Notifications
   ========================================== */
.toast-container {
    position: fixed;
    bottom: var(--spacing-xl);
    right: var(--spacing-xl);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    z-index: 1000;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    max-width: 400px;
}

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

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

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

.toast.warning {
    border-left: 4px solid var(--color-warning);
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--color-success);
}

.toast.error .toast-icon {
    color: var(--color-error);
}

.toast.warning .toast-icon {
    color: var(--color-warning);
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 0.875rem;
}

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

.toast-close {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    color: var(--color-text-tertiary);
    transition: all var(--transition-fast);
}

.toast-close:hover {
    background-color: var(--color-bg-tertiary);
    color: var(--color-text-primary);
}

.toast-close svg {
    width: 14px;
    height: 14px;
}

/* ==========================================
   Utilities
   ========================================== */
.hidden {
    display: none !important;
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: var(--spacing-md);
    }
    
    .main-content {
        margin-left: 0;
        padding: var(--spacing-lg);
    }
    
    .nav-section {
        display: flex;
        flex-wrap: wrap;
        gap: var(--spacing-sm);
        margin-bottom: var(--spacing-md);
    }
    
    .nav-label {
        display: none;
    }
    
    .nav-item {
        flex: 1;
        justify-content: center;
        margin-bottom: 0;
    }
    
    .nav-item span {
        display: none;
    }
    
    .status-indicator {
        display: none;
    }
    
    .tts-container {
        grid-template-columns: 1fr;
    }
    
    .voice-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
