/* Business Articulation Trainer - Styles */
:root {
    --primary: #1a5f7a;
    --primary-light: #2a8fae;
    --secondary: #e8f4f8;
    --accent: #d4a843;
    --success: #2d7d32;
    --warning: #f57f17;
    --danger: #c62828;
    --text: #1a2a3a;
    --text-muted: #5a6a7a;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --border: #d0dce8;
    --shadow: 0 2px 8px rgba(26, 42, 58, 0.08);
    --shadow-lg: 0 4px 16px rgba(26, 42, 58, 0.12);
    --radius: 10px;
    --radius-sm: 6px;
    --transition: all 0.2s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; }

.app-container { max-width: 900px; margin: 0 auto; padding: 20px; }
.app-header { text-align: center; margin-bottom: 24px; position: relative; }
.header-content h1 { font-size: 1.75rem; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.subtitle { color: var(--text-muted); font-size: 0.95rem; }
.auth-form { position: absolute; top: 0; right: 0; display: flex; gap: 8px; }
.auth-form input { padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.9rem; width: 160px; }
.auth-form button { padding: 8px 16px; background: var(--primary); color: white; border: none; border-radius: var(--radius-sm); font-weight: 600; cursor: pointer; transition: var(--transition); }
.auth-form button:hover { background: var(--primary-light); }

.view { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.week-selector h2 { font-size: 1.1rem; margin-bottom: 12px; color: var(--text-muted); }
.week-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.week-tab { padding: 10px 18px; background: var(--card-bg); border: 2px solid var(--border); border-radius: 24px; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: var(--transition); }
.week-tab:hover { border-color: var(--primary-light); color: var(--primary); }
.week-tab.active { background: var(--primary); border-color: var(--primary); color: white; }

.prompts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.prompt-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; cursor: pointer; transition: var(--transition); box-shadow: var(--shadow); }
.prompt-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--primary-light); }
.prompt-category { display: inline-block; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--primary); background: var(--secondary); padding: 4px 10px; border-radius: 12px; margin-bottom: 8px; }
.prompt-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; line-height: 1.3; }
.prompt-card p { font-size: 0.85rem; color: var(--text-muted); }
.target-info { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.target-badge { font-size: 0.75rem; color: var(--text-muted); }
.target-badge span { font-weight: 700; color: var(--primary); }
.week-badge { font-size: 0.7rem; font-weight: 700; padding: 3px 8px; border-radius: 10px; background: var(--accent); color: #3a2e00; }

.stats-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; padding: 16px; background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); }
.stat { text-align: center; }
.stat-value { display: block; font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

/* Session View */
.session-header { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.back-btn { padding: 8px 14px; background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.85rem; color: var(--text-muted); cursor: pointer; transition: var(--transition); }
.back-btn:hover { background: var(--secondary); border-color: var(--primary-light); color: var(--primary); }
.prompt-info { flex: 1; }
.prompt-info .prompt-category { margin-bottom: 6px; }
.prompt-info h3 { font-size: 1.1rem; }

.session-content { background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.prompt-card.large { padding: 24px; border-bottom: 1px solid var(--border); }
.prompt-text { font-size: 1.05rem; line-height: 1.7; margin-bottom: 16px; }

.input-tabs { display: flex; gap: 4px; padding: 4px; background: var(--secondary); border-radius: var(--radius-sm); margin-bottom: 16px; }
.input-tab { flex: 1; padding: 10px 16px; background: transparent; border: none; border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: var(--transition); }
.input-tab.active { background: var(--card-bg); color: var(--primary); box-shadow: var(--shadow); }
.input-panel { display: none; }
.input-panel.active { display: block; animation: fadeIn 0.2s ease; }

textarea { width: 100%; min-height: 140px; padding: 14px; border: 2px solid var(--border); border-radius: var(--radius); font-family: inherit; font-size: 0.95rem; line-height: 1.6; resize: vertical; transition: var(--transition); }
textarea:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(26, 95, 122, 0.1); }

/* Voice Recorder */
.voice-recorder { text-align: center; padding: 20px; }
.record-btn { width: 80px; height: 80px; border-radius: 50%; border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; margin: 0 auto 16px; transition: var(--transition); box-shadow: var(--shadow-lg); }
.record-btn.idle { background: var(--danger); color: white; }
.record-btn.recording { background: #fff; animation: pulse 1.5s infinite; }
.record-btn.recording::before { content: ''; position: absolute; width: 40px; height: 40px; background: var(--danger); border-radius: 50%; }
.record-btn svg { width: 32px; height: 32px; z-index: 1; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(198, 40, 40, 0.7); } 50% { box-shadow: 0 0 0 16px rgba(198, 40, 40, 0); } }
.waveform { height: 60px; background: var(--secondary); border-radius: var(--radius-sm); margin-bottom: 12px; position: relative; overflow: hidden; }
.waveform canvas { width: 100%; height: 100%; }
.recording-status { font-size: 0.85rem; color: var(--text-muted); min-height: 24px; }
.recording-status.recording { color: var(--danger); font-weight: 600; }

.submit-btn { width: 100%; padding: 14px 24px; background: var(--primary); color: white; border: none; border-radius: var(--radius); font-size: 1rem; font-weight: 600; cursor: pointer; transition: var(--transition); margin-top: 16px; }
.submit-btn:hover { background: var(--primary-light); }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Feedback View */
.feedback-view { padding: 24px; }
.feedback-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.feedback-score { display: flex; align-items: center; gap: 16px; }
.score-circle { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; font-weight: 700; color: white; }
.score-circle.excellent { background: var(--success); }
.score-circle.good { background: #43a047; }
.score-circle.fair { background: var(--warning); }
.score-circle.poor { background: var(--danger); }
.score-label { font-size: 0.85rem; color: var(--text-muted); }
.score-label strong { color: var(--text); }

.feedback-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.feedback-tab { padding: 10px 16px; background: transparent; border: none; border-bottom: 3px solid transparent; font-size: 0.85rem; font-weight: 600; color: var(--text-muted); cursor: pointer; transition: var(--transition); }
.feedback-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.feedback-tab:hover { color: var(--primary); }

.feedback-panel { display: none; }
.feedback-panel.active { display: block; animation: fadeIn 0.2s ease; }

/* PREA Breakdown */
.prea-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.prea-item { padding: 16px; background: var(--secondary); border-radius: var(--radius); }
.prea-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.prea-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); }
.prea-score { font-size: 1.25rem; font-weight: 700; }
.prea-score.high { color: var(--success); }
.prea-score.med { color: var(--warning); }
.prea-score.low { color: var(--danger); }
.prea-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.prea-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.prea-bar-fill.high { background: var(--success); }
.prea-bar-fill.med { background: var(--warning); }
.prea-bar-fill.low { background: var(--danger); }
.prea-feedback { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }

/* Filler Detection */
.filler-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filler-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: #fff3e0; border-radius: 20px; font-size: 0.8rem; color: #e65100; }
.filler-badge .count { background: var(--warning); color: white; padding: 1px 6px; border-radius: 10px; font-size: 0.7rem; font-weight: 700; }
.filler-suggestions { font-size: 0.85rem; color: var(--text-muted); }
.filler-suggestions strong { color: var(--text); display: block; margin-bottom: 8px; }
.filler-suggestions ul { margin-left: 16px; }
.filler-suggestions li { margin: 4px 0; }

/* Compression */
.compression-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.comp-stat { text-align: center; padding: 16px; background: var(--secondary); border-radius: var(--radius); }
.comp-value { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.comp-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.comp-stat.on-target .comp-value { color: var(--success); }
.comp-stat.over-target .comp-value { color: var(--danger); }
.comp-stat.under-target .comp-value { color: var(--warning); }
.comp-feedback { font-size: 0.9rem; line-height: 1.6; }

/* Prosody */
.prosody-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.prosody-item { text-align: center; padding: 16px; background: var(--secondary); border-radius: var(--radius); }
.prosody-value { font-size: 1.5rem; font-weight: 700; color: var(--primary); }
.prosody-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.prosody-flags { display: flex; flex-direction: column; gap: 8px; }
.prosody-flag { padding: 10px 14px; background: #fff3e0; border-left: 3px solid var(--warning); border-radius: var(--radius-sm); font-size: 0.85rem; color: #e65100; }
.prosody-flag.good { background: #e8f5e9; border-left-color: var(--success); color: var(--success); }

/* Register */
.register-analysis { font-size: 0.9rem; line-height: 1.7; }
.register-tag { display: inline-block; padding: 4px 12px; background: var(--primary); color: white; border-radius: 16px; font-size: 0.75rem; font-weight: 600; margin-bottom: 12px; }
.register-feedback { color: var(--text-muted); }

/* Followup */
.followup-card { background: var(--secondary); border-radius: var(--radius); padding: 16px; margin-top: 16px; }
.followup-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px; }
.followup-text { font-style: italic; color: var(--text); line-height: 1.6; }

.action-btns { display: flex; gap: 12px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); }
.action-btn { flex: 1; padding: 12px 20px; border-radius: var(--radius); font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: var(--transition); border: none; }
.action-btn.primary { background: var(--primary); color: white; }
.action-btn.primary:hover { background: var(--primary-light); }
.action-btn.secondary { background: var(--card-bg); color: var(--primary); border: 1px solid var(--primary); }
.action-btn.secondary:hover { background: var(--secondary); }

/* Loading */
.loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; gap: 12px; }
.spinner { width: 40px; height: 40px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 640px) {
    .app-container { padding: 16px; }
    .week-tabs { justify-content: center; }
    .week-tab { padding: 8px 14px; font-size: 0.8rem; }
    .prompts-grid { grid-template-columns: 1fr; }
    .stats-bar { grid-template-columns: repeat(2, 1fr); }
    .prea-grid { grid-template-columns: 1fr; }
    .compression-stats { grid-template-columns: 1fr; }
    .prosody-grid { grid-template-columns: 1fr; }
    .action-btns { flex-direction: column; }
}

/* Complementary UI Component Rules */
.missing-section {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    border-left: 4px solid var(--danger);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 20px;
}
.missing-section h3 {
    color: #991b1b;
    font-size: 0.95rem;
    margin-bottom: 8px;
}
.missing-section ul {
    margin-left: 20px;
    color: #b91c1c;
    font-size: 0.85rem;
}
.missing-section li {
    margin: 4px 0;
}

.fillers-section, .compression-section, .prosody-section, .followup-section, .transcript-section {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
}

.compression-bar {
    margin: 12px 0;
}
.bar-track {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}
.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.bar-fill.high { background: var(--success); }
.bar-fill.med { background: var(--warning); }
.bar-fill.low { background: var(--danger); }

.compression-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 6px;
}
.compression-advice {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.5;
}

.transcript-annotated {
    background: var(--secondary);
    padding: 16px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text);
    border: 1px solid var(--border);
}
.filler-highlight {
    background: #fef08a;
    color: #854d0e;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    border-bottom: 2px solid #ca8a04;
    cursor: help;
}

.followup-box {
    background: #eff6ff;
    border-left: 4px solid var(--primary);
    padding: 16px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    color: #1e3a8a;
    font-style: italic;
    margin: 12px 0 16px;
    line-height: 1.6;
}

.feedback-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}
.feedback-actions button {
    flex: 1;
    padding: 14px 20px;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}
.feedback-actions .btn-primary {
    background: var(--primary);
    color: white;
}
.feedback-actions .btn-primary:hover {
    background: var(--primary-light);
}
.feedback-actions .btn-secondary {
    background: var(--card-bg);
    color: var(--primary);
    border: 1px solid var(--primary);
}
.feedback-actions .btn-secondary:hover {
    background: var(--secondary);
}
