/* ─── INTERVIEW COPILOT STYLING SYSTEM (LIGHT MODE) ─────────────────── */

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-card: rgba(241, 245, 249, 0.85);
    --border-color: rgba(15, 23, 42, 0.08);
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    --accent-indigo: #4f46e5; /* Indigo-600 */
    --accent-violet: #7c3aed; /* Violet-600 */
    --accent-emerald: #059669; /* Emerald-600 */
    --accent-amber: #d97706; /* Amber-600 */
    --accent-red: #dc2626; /* Red-600 */
    
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-outfit: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.04) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.02) 0px, transparent 50%);
    color: var(--text-primary);
    font-family: var(--font-sans);
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ─── WebKit / Mobile OS Resets ────────────────────────────────────── */
button, select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: transparent;
    border: none;
    color: inherit;
    font: inherit;
    outline: none;
}

select {
    cursor: pointer;
}

/* ─── Custom Scrollbars ───────────────────────────────────────────── */
.custom-scroll::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}
.custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scroll::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.1);
    border-radius: 4px;
}
.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.35);
}

/* ─── Status Pulsing Animation ───────────────────────────────────── */
@keyframes status-pulse {
    0% { transform: scale(0.92); opacity: 0.6; box-shadow: 0 0 0 0 rgba(5, 150, 105, 0.4); }
    70% { transform: scale(1.08); opacity: 1; box-shadow: 0 0 0 8px rgba(5, 150, 105, 0); }
    100% { transform: scale(0.92); opacity: 0.6; box-shadow: 0 0 0 0 rgba(5, 150, 105, 0); }
}

@keyframes status-pulse-red {
    0% { transform: scale(0.92); opacity: 0.6; box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
    70% { transform: scale(1.08); opacity: 1; box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
    100% { transform: scale(0.92); opacity: 0.6; box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.status-pulse-active {
    animation: status-pulse 2s infinite ease-in-out;
}

.status-pulse-active-red {
    animation: status-pulse-red 1.6s infinite ease-in-out;
}

/* ─── Settings Drawer Slide-Out ──────────────────────────────────── */
#settings-drawer.active {
    transform: translateX(0);
}

#drawer-backdrop.active {
    display: block;
    opacity: 1;
}

/* ─── iOS Switch Controls styling ────────────────────────────────── */
.switch-on {
    background-color: var(--accent-indigo) !important;
}
.switch-on-emerald {
    background-color: var(--accent-emerald) !important;
}
.switch-knob-on {
    left: calc(100% - 16px) !important;
    background-color: #ffffff !important;
}
.switch-off {
    background-color: #cbd5e1 !important; /* Slate-300 */
}
.switch-knob-off {
    left: 2px !important;
    background-color: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* ─── Chat Feed & Bubble Designs ─────────────────────────────────── */
.chat-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 2px 0;
}

/* Interviewer Bubble */
.bubble-interviewer {
    align-self: flex-start;
    max-width: 90%;
    background: rgba(241, 245, 249, 0.85);
    border: 1px solid rgba(79, 70, 229, 0.12);
    border-radius: 18px 18px 18px 4px;
    padding: 10px 14px;
    box-shadow: 0 2px 8px -1px rgba(15, 23, 42, 0.05);
}

.bubble-me {
    align-self: flex-end;
    max-width: 90%;
    background: rgba(5, 150, 105, 0.05);
    border: 1px solid rgba(5, 150, 105, 0.15);
    border-radius: 18px 18px 4px 18px;
    padding: 10px 14px;
    box-shadow: 0 2px 8px -1px rgba(15, 23, 42, 0.05);
}

.sender-tag {
    font-family: var(--font-outfit);
    font-weight: 700;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.tag-interviewer { color: var(--accent-indigo); }
.tag-me { color: var(--accent-emerald); }

.bubble-text {
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-primary);
    word-break: break-word;
}

/* AI Answer Container */
.ai-answer-container {
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 18px;
    padding: 14px 16px;
    margin-top: 2px;
    box-shadow: 
        0 4px 20px -2px rgba(15, 23, 42, 0.04),
        0 0 10px rgba(99, 102, 241, 0.01);
    position: relative;
    overflow: hidden;
}

.ai-answer-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3.5px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent-indigo), var(--accent-violet));
}

.ai-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.04);
    padding-bottom: 6px;
}

.ai-tag {
    font-family: var(--font-outfit);
    font-weight: 700;
    font-size: 9.5px;
    color: var(--accent-violet);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 4.5px;
}

.ai-time {
    font-size: 8.5px;
    color: var(--text-muted);
    font-family: monospace;
}

/* ─── Streaming Suggestions Cursor Animation ─────────────────────── */
#suggestions-area::after, .streaming-text::after {
    content: '▋';
    color: var(--accent-indigo);
    font-weight: 700;
    animation: cursor-blink 0.9s steps(2, start) infinite;
    display: inline-block;
    margin-left: 2px;
}

.streaming-finished .streaming-text::after {
    display: none;
}

@keyframes cursor-blink {
    to { visibility: hidden; }
}

/* ─── Markdown formatting inside Suggestion Area ─────────────────── */
.md-content h1, .md-content h2, .md-content h3 {
    font-family: var(--font-outfit);
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 1rem;
    margin-bottom: 0.4rem;
}
.md-content h1 { font-size: 1.1rem; border-left: 3px solid var(--accent-indigo); padding-left: 8px; }
.md-content h2 { font-size: 1rem; border-left: 2px solid var(--accent-indigo); padding-left: 6px; }
.md-content h3 { font-size: 0.9rem; font-weight: 600; }

.md-content p {
    margin-bottom: 0.65rem;
    line-height: 1.6;
    font-size: 12.5px;
    color: var(--text-secondary);
}

.md-content ul, .md-content ol {
    margin-left: 1.1rem;
    margin-bottom: 0.65rem;
    font-size: 12.5px;
}
.md-content ul { list-style: disc; }
.md-content ol { list-style: decimal; }
.md-content li { margin-bottom: 0.3rem; color: var(--text-secondary); }

.md-content strong {
    font-weight: 600;
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.04);
    padding: 0.5px 3.5px;
    border-radius: 4px;
}

.md-content code {
    background: rgba(99, 102, 241, 0.08);
    color: var(--accent-indigo);
    padding: 0.1rem 0.25rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85em;
    border: 1px solid rgba(99, 102, 241, 0.12);
}

.md-content pre {
    background: #f1f5f9;
    padding: 0.75rem;
    border-radius: 12px;
    overflow-x: auto;
    margin: 0.65rem 0;
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.md-content pre code {
    background: transparent;
    padding: 0;
    font-size: 0.8rem;
    color: var(--text-primary);
    border: none;
}
