/* =====================================================
   AUREV - Rich & Engaging UI
   Notion-inspired Light Theme
   ===================================================== */

:root {
    /* Colors */
    --primary: #7C3AED;
    --primary-hover: #6D28D9;
    --primary-light: #EDE9FE;
    --primary-glow: rgba(124, 58, 237, 0.15);
    
    --secondary: #3B82F6;
    --secondary-light: #DBEAFE;
    
    --success: #10B981;
    --success-light: #D1FAE5;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --error: #EF4444;
    --error-light: #FEE2E2;
    
    --bg-page: #F9FAFB;
    --bg-card: #FFFFFF;
    --bg-hover: #F3F4F6;
    --bg-active: #EDE9FE;
    
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-muted: #9CA3AF;
    --text-white: #FFFFFF;
    
    --border: #E5E7EB;
    --border-dark: #D1D5DB;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: 150ms ease;
    
    --sidebar-width: 260px;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg-page); color: var(--text-primary); line-height: 1.6; }

/* =====================================================
   Loading Screen
   ===================================================== */
.loading-screen {
    position: fixed; inset: 0; background: var(--bg-card);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; transition: opacity 0.3s ease;
}
.loading-content { text-align: center; }
.logo-animated { margin-bottom: 24px; }
.logo-icon-lg {
    width: 64px; height: 64px; border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), #EC4899);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; font-weight: 800; color: white;
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.loading-dots { display: flex; gap: 8px; justify-content: center; }
.loading-dots span {
    width: 8px; height: 8px; border-radius: 50%; background: var(--primary);
    animation: bounce 1.4s infinite ease-in-out both;
}
.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* =====================================================
   Logo
   ===================================================== */
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
    width: 40px; height: 40px; border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), #EC4899);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; font-weight: 800; color: white;
}
.logo-icon-sm { width: 32px; height: 32px; border-radius: 10px; font-size: 16px; }
.logo-text { font-size: 22px; font-weight: 700; color: var(--text-primary); }

/* =====================================================
   Auth Page
   ===================================================== */
.auth-page { display: flex; min-height: 100vh; }
.auth-left {
    flex: 1; padding: 60px;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 50%, #FCE7F3 100%);
    display: flex; align-items: center;
}
.auth-branding { max-width: 480px; }
.auth-hero-title { font-size: 48px; font-weight: 800; line-height: 1.1; margin: 32px 0 16px; }
.gradient-text { background: linear-gradient(135deg, var(--primary), #EC4899); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.auth-hero-subtitle { font-size: 18px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 40px; }
.auth-features { display: flex; flex-direction: column; gap: 20px; }
.auth-feature { display: flex; gap: 16px; align-items: flex-start; }
.auth-feature-icon { font-size: 24px; }
.auth-feature strong { display: block; font-weight: 600; margin-bottom: 2px; }
.auth-feature p { font-size: 14px; color: var(--text-muted); margin: 0; }

.auth-right { width: 480px; padding: 60px; display: flex; align-items: center; justify-content: center; background: var(--bg-card); }
.auth-card { width: 100%; max-width: 360px; }
.auth-title { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.auth-subtitle { color: var(--text-muted); margin-bottom: 24px; }
.auth-switch { text-align: center; margin-top: 24px; font-size: 14px; color: var(--text-muted); }

/* =====================================================
   Forms
   ===================================================== */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.form-input, .form-textarea {
    width: 100%; padding: 12px 14px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); font-family: var(--font);
    font-size: 15px; color: var(--text-primary);
    transition: var(--transition);
}
.form-input:focus, .form-textarea:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }
.form-input-lg { padding: 16px 18px; font-size: 16px; }
.form-textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.form-hint { font-size: 13px; color: var(--text-muted); margin-top: 6px; }

/* =====================================================
   Buttons
   ===================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 20px; font-family: var(--font); font-size: 14px; font-weight: 600;
    border-radius: var(--radius); border: none; cursor: pointer;
    transition: all var(--transition); text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white; box-shadow: 0 2px 8px var(--primary-glow);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 12px var(--primary-glow); }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-dark); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-lg { padding: 16px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-oauth {
    width: 100%; padding: 14px; background: var(--bg-card);
    border: 1px solid var(--border); font-weight: 500;
}
.btn-oauth:hover { background: var(--bg-hover); }

.divider { display: flex; align-items: center; margin: 24px 0; color: var(--text-muted); font-size: 13px; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.divider span { padding: 0 16px; }

/* =====================================================
   Dashboard Layout
   ===================================================== */
.dashboard { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-width); background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 100;
}
.sidebar.hidden { display: none; }
.main.full-width { margin-left: 0; }
.sidebar-header { padding: 20px; border-bottom: 1px solid var(--border); }
.sidebar-nav { flex: 1; padding: 12px; overflow-y: auto; }
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }

.logo-text-only {
    font-family: var(--font);
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), #EC4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: var(--radius);
    color: var(--text-secondary); font-size: 14px; font-weight: 500;
    cursor: pointer; transition: var(--transition); margin-bottom: 4px;
}
.nav-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.nav-item.active { background: var(--bg-active); color: var(--primary); }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Credits Widget */
.credits-widget { 
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(236, 72, 153, 0.1)); 
    border: 1px solid rgba(124, 58, 237, 0.2);
    border-radius: var(--radius); 
    padding: 14px; 
    margin-bottom: 12px; 
}
.credits-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.credits-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.credits-value { font-size: 18px; font-weight: 700; color: var(--primary); }
.credits-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.credits-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #EC4899); border-radius: 3px; transition: width 0.5s ease; }
.credits-hint { 
    font-size: 10px; 
    color: var(--text-muted); 
    margin-top: 8px; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 8px; 
}
.credits-divider { color: var(--border); }
.credits-cost-hint {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 16px;
}

/* Welcome Screen */
.welcome-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-page);
    padding: 40px;
}
.welcome-content {
    text-align: center;
    max-width: 480px;
}
.welcome-icon {
    font-size: 64px;
    margin-bottom: 24px;
}
.welcome-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--primary), #EC4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.welcome-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 32px;
}

.voice-score-widget { background: var(--bg-page); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }
.voice-score-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.voice-score-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.voice-score-value { font-size: 14px; font-weight: 700; color: var(--primary); }
.voice-score-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.voice-score-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #EC4899); border-radius: 3px; transition: width 0.5s ease; }

.user-menu { display: flex; flex-direction: column; gap: 12px; }
.user-info { display: flex; align-items: center; gap: 12px; }
.user-avatar {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #EC4899);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; color: white; font-size: 14px;
}
.user-details { flex: 1; min-width: 0; }
.user-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { flex: 1; margin-left: var(--sidebar-width); }
.main-content { padding: 32px 40px; max-width: 1200px; }

/* =====================================================
   Page Header
   ===================================================== */
.page-container { padding: 32px 40px; max-width: 1200px; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.page-title { font-size: 28px; font-weight: 700; }
.page-subtitle { color: var(--text-muted); margin-top: 4px; }

.voice-score-badge {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 16px; background: var(--primary-light);
    border-radius: 20px;
}
.voice-score-badge .score-label { font-size: 12px; color: var(--text-muted); }
.voice-score-badge .score-value { font-size: 16px; font-weight: 700; color: var(--primary); }

/* =====================================================
   Cards
   ===================================================== */
.card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 24px;
    box-shadow: var(--shadow-sm);
}
.card-header { margin-bottom: 20px; }
.card-title { font-size: 16px; font-weight: 600; }

/* =====================================================
   Onboarding
   ===================================================== */
.onboarding-container { max-width: 708px; margin: 0 auto; padding: 40px 24px; }
.onboarding-progress { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 48px; }
.progress-step { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.progress-step-icon {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--bg-page); border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 600; color: var(--text-muted);
}
.progress-step.active .progress-step-icon { background: var(--primary); border-color: var(--primary); color: white; }
.progress-step.completed .progress-step-icon { background: var(--success); border-color: var(--success); color: white; }
.progress-step-label { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.progress-step.active .progress-step-label { color: var(--primary); }
.progress-step.completed .progress-step-label { color: var(--success); }
.progress-line { width: 80px; height: 2px; background: var(--border); margin: 0 8px 24px; }
.progress-line.completed { background: var(--success); }

.onboarding-content { text-align: center; }
.onboarding-illustration { margin-bottom: 24px; }
.illustration-circle {
    width: 100px; height: 100px; margin: 0 auto;
    background: var(--primary-light); border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 48px;
}


.onboarding-title { font-size: 28px; font-weight: 700; margin-bottom: 12px; }
.onboarding-subtitle { font-size: 16px; color: var(--text-secondary); margin-bottom: 32px; }
.import-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 32px; text-align: left; }

.progress-animation { display: flex; justify-content: center; margin-bottom: 24px; }
.spinner-lg {
    width: 48px; height: 48px;
    border: 3px solid var(--border); border-top-color: var(--primary);
    border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================
   Select Posts
   ===================================================== */
.select-content { max-width: 900px; margin: 0 auto; }
.profile-card-large {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 24px;
    display: flex; align-items: center; gap: 20px; margin-bottom: 32px;
}
.profile-photo { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.profile-photo-placeholder {
    width: 72px; height: 72px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #EC4899);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 700; color: white;
}
.profile-info h3 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.profile-info p { color: var(--text-secondary); font-size: 14px; }

.posts-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 16px; }
.posts-header-left h2 { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.posts-header-left p { font-size: 14px; color: var(--text-muted); }
.posts-header-right { display: flex; align-items: center; gap: 12px; }
.selection-badge {
    background: var(--primary-light); color: var(--primary);
    padding: 6px 14px; border-radius: 20px; font-size: 14px; font-weight: 600;
}

.posts-grid { display: flex; flex-direction: column; gap: 16px; padding-bottom: 120px; }
.post-card {
    background: var(--bg-card); border: 2px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px;
    cursor: pointer; transition: all var(--transition);
}
.post-card:hover { border-color: var(--border-dark); box-shadow: var(--shadow); }
.post-card.selected { border-color: var(--primary); background: linear-gradient(to bottom, var(--primary-light), var(--bg-card)); }
.post-card.auto-deselected { opacity: 0.6; }

.post-card-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 14px; }
.checkbox-wrapper { flex-shrink: 0; margin-top: 2px; }
.checkbox-wrapper input { display: none; }
.checkbox-custom {
    width: 22px; height: 22px; border: 2px solid var(--border-dark);
    border-radius: 6px; display: flex; align-items: center; justify-content: center;
    transition: var(--transition); cursor: pointer; background: var(--bg-card);
}
.checkbox-wrapper input:checked + .checkbox-custom { background: var(--primary); border-color: var(--primary); }
.checkbox-wrapper input:checked + .checkbox-custom::after { content: '✓'; color: white; font-size: 14px; font-weight: 600; }

.post-author { display: flex; align-items: center; gap: 10px; flex: 1; }
.post-author-photo { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.post-author-photo-placeholder {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #EC4899);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 600; color: white;
}
.post-author-info { display: flex; flex-direction: column; }
.post-author-name { font-size: 14px; font-weight: 600; }
.post-date { font-size: 12px; color: var(--text-muted); }
.post-meta { display: flex; gap: 8px; }
.post-badge { font-size: 11px; font-weight: 600; padding: 4px 8px; border-radius: 4px; background: var(--bg-page); color: var(--text-muted); }
.post-card-content { font-size: 14px; color: var(--text-primary); line-height: 1.7; }
.post-card-content p { margin: 0 0 12px; }
.post-engagement { display: flex; gap: 16px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.engagement-item { font-size: 13px; color: var(--text-muted); }

.sticky-footer {
    position: fixed; bottom: 0; left: var(--sidebar-width); right: 0;
    background: var(--bg-card); border-top: 1px solid var(--border);
    padding: 16px 40px; box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
}
.sticky-footer-content { max-width: 900px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.selection-summary { display: flex; align-items: center; gap: 8px; }
.selection-count { font-size: 15px; }
.selection-hint { font-size: 13px; color: var(--text-muted); }

/* =====================================================
   Generate Page
   ===================================================== */
.generate-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 1024px) { .generate-layout { grid-template-columns: 1fr; } }

.sliders-section { background: var(--bg-page); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.sliders-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.sliders-header h4 { font-size: 14px; font-weight: 600; }
.slider-item { margin-bottom: 20px; }
.slider-item:last-child { margin-bottom: 0; }
.slider-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.slider-label { font-size: 13px; font-weight: 500; }
.slider-value { font-size: 13px; font-weight: 600; color: var(--primary); }
.slider-input { width: 100%; height: 6px; -webkit-appearance: none; background: var(--border); border-radius: 3px; cursor: pointer; }
.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none; width: 18px; height: 18px;
    background: var(--primary); border-radius: 50%; cursor: pointer;
    box-shadow: 0 2px 6px var(--primary-glow);
}
.slider-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-top: 6px; }

.empty-output {
    height: 300px; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: var(--bg-card); border: 2px dashed var(--border);
    border-radius: var(--radius-lg); color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }

/* Generated Post */
.generated-post-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
}
.generated-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--bg-page);
}
.generated-meta { display: flex; align-items: center; gap: 12px; }
.generated-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 12px; background: var(--primary-light);
    color: var(--primary); border-radius: 20px; font-size: 12px; font-weight: 600;
}
.voice-match { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.match-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.generated-content-wrapper { padding: 24px; }
.generated-content { font-size: 15px; line-height: 1.8; white-space: pre-wrap; }
.generated-footer { padding: 20px; border-top: 1px solid var(--border); }
.feedback-section { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.feedback-label { font-size: 13px; color: var(--text-muted); }
.feedback-buttons { display: flex; gap: 8px; }
.feedback-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--bg-card);
    font-size: 13px; font-weight: 500; cursor: pointer; transition: var(--transition);
}
.feedback-btn:hover { background: var(--bg-hover); }
.feedback-btn.active[data-feedback="up"] { background: var(--success-light); border-color: var(--success); color: var(--success); }
.feedback-btn.active[data-feedback="down"] { background: var(--error-light); border-color: var(--error); color: var(--error); }
.feedback-btn svg { width: 16px; height: 16px; }
.action-buttons { display: flex; gap: 12px; }

/* =====================================================
   Modals
   ===================================================== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 24px;
}
.modal {
    background: var(--bg-card); border-radius: var(--radius-lg);
    max-width: 500px; width: 100%; max-height: 90vh; overflow: hidden;
    box-shadow: var(--shadow-xl);
}
.modal-large { max-width: 900px; }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; }
.modal-title { font-size: 18px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 24px; color: var(--text-muted); cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--text-primary); }
.modal-body { padding: 24px; max-height: 60vh; overflow-y: auto; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; }

.edit-comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 768px) { .edit-comparison { grid-template-columns: 1fr; } }
.edit-column { display: flex; flex-direction: column; }
.edit-column-header { font-size: 13px; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.badge-success { background: var(--success-light); color: var(--success); padding: 2px 8px; border-radius: 4px; font-size: 11px; }
.edit-content {
    flex: 1; padding: 16px; background: var(--bg-page);
    border-radius: var(--radius); font-size: 14px; line-height: 1.7;
    white-space: pre-wrap; min-height: 200px; border: 1px solid var(--border);
}
.edit-textarea {
    flex: 1; padding: 16px; border: 1px solid var(--primary);
    border-radius: var(--radius); font-size: 14px; line-height: 1.7;
    min-height: 200px; resize: none; font-family: var(--font);
}
.edit-textarea:focus { outline: none; box-shadow: 0 0 0 3px var(--primary-glow); }

.feedback-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.feedback-option {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; border: 1px solid var(--border);
    border-radius: var(--radius); cursor: pointer; transition: var(--transition);
}
.feedback-option:hover { background: var(--bg-hover); }
.feedback-option input { width: 18px; height: 18px; accent-color: var(--primary); }

/* =====================================================
   Voice Profile & Learnings
   ===================================================== */
.analysis-section { margin-bottom: 24px; }
.analysis-title { font-size: 12px; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.analysis-content { color: var(--text-secondary); line-height: 1.7; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { padding: 6px 12px; background: var(--bg-page); border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.tag-primary { background: var(--primary-light); border-color: transparent; color: var(--primary); }
.rules-list { display: flex; flex-direction: column; gap: 8px; }
.rule { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; }
.rule.do { background: var(--success-light); color: #065F46; }
.rule.dont { background: var(--error-light); color: #991B1B; }

.learning-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
}
.learning-type { font-size: 11px; font-weight: 600; color: var(--primary); text-transform: uppercase; margin-bottom: 6px; }
.learning-text { font-size: 14px; color: var(--text-primary); }
.learning-meta { font-size: 12px; color: var(--text-muted); margin-top: 8px; }

/* =====================================================
   History
   ===================================================== */
.history-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; }
.history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.history-date { font-size: 13px; color: var(--text-muted); }
.history-topic { font-size: 13px; color: var(--primary); background: var(--primary-light); padding: 6px 12px; border-radius: var(--radius-sm); margin-bottom: 12px; display: inline-block; }
.history-content { font-size: 14px; color: var(--text-secondary); line-height: 1.7; white-space: pre-wrap; }

/* =====================================================
   Alerts & Toast
   ===================================================== */
.alert { padding: 14px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.alert-error { background: var(--error-light); border: 1px solid rgba(239,68,68,0.3); color: #991B1B; }
.alert-success { background: var(--success-light); border: 1px solid rgba(16,185,129,0.3); color: #065F46; }

.toast {
    position: fixed; bottom: 24px; right: 24px; padding: 14px 20px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    font-size: 14px; font-weight: 500; z-index: 9999;
    transform: translateY(100px); opacity: 0; transition: all 0.3s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: var(--success); background: var(--success-light); color: #065F46; }
.toast.error { border-color: var(--error); background: var(--error-light); color: #991B1B; }

/* =====================================================
   Utilities
   ===================================================== */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.link { color: var(--primary); text-decoration: none; font-weight: 500; }
.link:hover { text-decoration: underline; }
.mb-md { margin-bottom: 16px; }
.mt-md { margin-top: 16px; }

/* =====================================================
   Topic Header (Generate Page)
   ===================================================== */
.topic-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.topic-header .form-label {
    margin-bottom: 0;
}

.topic-header .btn-ghost {
    color: var(--primary);
    font-size: 13px;
}

.topic-header .btn-ghost:hover {
    background: var(--primary-light);
}

/* =====================================================
   Topic Ideas Page
   ===================================================== */
.prompts-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.prompt-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.prompt-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    transform: translateY(-2px);
}

.prompt-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

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

.prompt-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.prompt-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-bottom: 8px;
}

.prompt-context {
    font-size: 13px;
    color: var(--text-muted);
}

.prompt-action {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transform: translateX(10px);
    transition: all var(--transition);
}

.prompt-card:hover .prompt-action {
    opacity: 1;
    transform: translateX(0);
}

.prompt-action svg {
    width: 14px;
    height: 14px;
}

/* Skeleton Loading */
.prompt-skeleton {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.skeleton-icon {
    width: 32px;
    height: 32px;
    background: var(--bg-hover);
    border-radius: 8px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-content {
    flex: 1;
}

.skeleton-label {
    width: 100px;
    height: 12px;
    background: var(--bg-hover);
    border-radius: 4px;
    margin-bottom: 10px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-text {
    width: 80%;
    height: 20px;
    background: var(--bg-hover);
    border-radius: 4px;
    margin-bottom: 10px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-context {
    width: 60%;
    height: 14px;
    background: var(--bg-hover);
    border-radius: 4px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

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

/* Empty/Error State */
.prompts-empty {
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.prompts-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.prompts-empty h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.prompts-empty p {
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* How It Works Card */
.how-it-works-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.how-it-works-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.how-it-works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

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

.how-item-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.how-item-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Refresh Button Loading State */
#refresh-prompts-btn.loading svg {
    animation: spin 1s linear infinite;
}

/* =====================================================
   Responsive
   ===================================================== */
@media (max-width: 1024px) {
    .auth-page { flex-direction: column; }
    .auth-left { display: none; }
    .auth-right { width: 100%; padding: 40px 24px; }
    .how-it-works-grid { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .main { margin-left: 0; }
    .sticky-footer { left: 0; }
    .main-content, .page-container { padding: 24px 16px; }
    .prompt-card { padding: 16px; }
    .prompt-action { display: none; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}
