/* ============ CSS Custom Properties ============ */
:root {
    /* Primary teal palette */
    --primary: #0d9488;
    --primary-dark: #0f766e;
    --primary-darker: #134e4a;

    /* Warm accent colors */
    --accent-coral: #FF7F50;
    --accent-coral-dark: #E5673D;
    --accent-coral-light: rgba(255, 127, 80, 0.08);
    --accent-coral-border: rgba(255, 127, 80, 0.25);
    --accent-gold: #FFC107;
    --accent-gold-dark: #E5AC00;
    --accent-gold-light: rgba(255, 193, 7, 0.10);

    /* Semantic feedback colors */
    --score-good: #16a34a;
    --score-good-bg: rgba(22, 163, 74, 0.08);
    --score-good-border: rgba(22, 163, 74, 0.2);
    --score-warn: #E5A700;
    --score-warn-bg: rgba(229, 167, 0, 0.10);
    --score-warn-border: rgba(229, 167, 0, 0.25);
    --score-critical: #E04343;
    --score-critical-bg: rgba(224, 67, 67, 0.08);
    --score-critical-border: rgba(224, 67, 67, 0.2);

    /* Section backgrounds */
    --section-alt-bg: #F8FAFC;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #f0fdfa 0%, #ecfdf5 50%, #f0fdfa 100%);
    color: #334155;
    min-height: 100vh;
}

header {
    text-align: center;
    padding: 2rem 1rem 1rem;
    border-bottom: 1px solid #ccfbf1;
    background: rgba(255, 255, 255, 0.6);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

header h1 {
    font-size: 2rem;
    color: #0d9488;
    letter-spacing: 2px;
}

header .subtitle {
    color: #64748b;
    margin-top: 0.25rem;
    font-size: 0.9rem;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

#app-page section {
    display: none;
}

#app-page section.active {
    display: block;
}

.hidden {
    display: none !important;
}

/* ============ JD + Resume Section ============ */
h2 {
    margin-bottom: 1rem;
    color: #134e4a;
}

h3 {
    margin: 1.5rem 0 0.75rem;
    color: #0f766e;
}

.optional-tag {
    font-size: 0.7rem;
    color: #64748b;
    background: #ccfbf1;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 0.4rem;
}

.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.input-card h2 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
}

.analysis-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.analysis-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #ccfbf1;
    border-radius: 8px;
    padding: 1rem;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.analysis-card h3 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
}

.analysis-card ul {
    padding-left: 1.25rem;
    margin: 0.25rem 0;
}

.analysis-card li {
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0.15rem 0;
}

/* Gap Analysis */
#gap-analysis {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #ccfbf1;
    border-radius: 8px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

#gap-analysis h3 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
}

.gap-row {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.gap-matched, .gap-missing {
    flex: 1;
    min-width: 200px;
}

.gap-matched strong, .gap-missing strong {
    display: block;
    font-size: 0.8rem;
    color: #0f766e;
    margin-bottom: 0.4rem;
}

.tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin: 0.15rem;
}

.tag-green { background: rgba(22, 163, 74, 0.08); color: #16a34a; border: 1px solid rgba(22, 163, 74, 0.2); }
.tag-red { background: rgba(220, 38, 38, 0.08); color: #dc2626; border: 1px solid rgba(220, 38, 38, 0.2); }
.tag-dim { background: #ccfbf1; color: #64748b; }

.gap-focus {
    margin-top: 0.75rem;
}

.gap-focus strong {
    display: block;
    font-size: 0.8rem;
    color: #b45309;
    margin-bottom: 0.4rem;
}

.gap-focus ul {
    padding-left: 1.25rem;
    margin: 0;
}

.gap-focus li {
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0.15rem 0;
    color: #92400e;
}

.gap-note {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
}

/* File upload */
.upload-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.file-upload-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.9rem;
    background: #fff;
    border: 1px solid #99f6e4;
    border-radius: 6px;
    color: #0d9488;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.file-upload-btn:hover {
    background: #f0fdfa;
    border-color: #0d9488;
}

.file-upload-btn input[type="file"] {
    display: none;
}

.upload-hint {
    font-size: 0.8rem;
    color: #94a3b8;
}

textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #99f6e4;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    color: #334155;
    font-size: 0.95rem;
    resize: vertical;
    font-family: inherit;
}

textarea:focus {
    outline: none;
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

/* Rich textarea (contenteditable) */
.rich-textarea-wrap {
    width: 100%;
    border: 1px solid #99f6e4;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.rich-textarea-wrap:focus-within {
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

.rich-textarea {
    width: 100%;
    min-height: 280px;
    max-height: 450px;
    overflow-y: auto;
    padding: 1rem;
    color: #334155;
    font-size: 0.95rem;
    line-height: 1.6;
    outline: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.rich-textarea:empty::before {
    content: attr(data-placeholder);
    color: #94a3b8;
    pointer-events: none;
}

/* Strip pasted backgrounds and force readable colors */
.rich-textarea * {
    background: transparent !important;
    color: #334155 !important;
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
    margin-top: 0;
    margin-bottom: 0;
}

.rich-textarea h1, .rich-textarea h2, .rich-textarea h3,
.rich-textarea h4, .rich-textarea h5, .rich-textarea h6 {
    margin: 0.4em 0 0.2em;
    color: #1e293b !important;
    font-size: 1.05em !important;
    font-weight: 700 !important;
}

.rich-textarea p {
    margin: 0.15em 0;
}

.rich-textarea ul, .rich-textarea ol {
    margin: 0.2em 0;
    padding-left: 1.5em;
}

.rich-textarea li {
    margin: 0.1em 0;
}

.rich-textarea b, .rich-textarea strong {
    font-weight: 600;
    color: #1e293b !important;
}

.rich-textarea a {
    color: #0d9488 !important;
    text-decoration: underline;
}

.rich-textarea br {
    display: block;
    content: "";
    margin: 0;
}

.rich-textarea table {
    border-collapse: collapse;
    margin: 0.3em 0;
    width: 100%;
}

.rich-textarea table td, .rich-textarea table th {
    border: 1px solid #e2e8f0;
    padding: 0.25em 0.5em;
}

/* Scrollbar styling */
.rich-textarea::-webkit-scrollbar {
    width: 6px;
}

.rich-textarea::-webkit-scrollbar-track {
    background: transparent;
}

.rich-textarea::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.rich-textarea::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.jd-options {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.jd-options label {
    color: #0f766e;
    font-size: 0.9rem;
}

.jd-options select {
    padding: 0.5rem 0.75rem;
    border: 1px solid #99f6e4;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.8);
    color: #334155;
    font-size: 0.9rem;
}

.jd-options select:focus {
    outline: none;
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    margin-top: 1rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #0d9488, #0891b2);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 10px rgba(13, 148, 136, 0.3);
}

button:hover {
    background: linear-gradient(135deg, #0f766e, #0e7490);
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.4);
}

button:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
}

button.loading {
    background: linear-gradient(135deg, #0d9488, #0891b2);
    color: #fff;
    pointer-events: none;
    position: relative;
    padding-left: 2.8rem;
}

button.loading::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 50%;
    width: 1.1rem;
    height: 1.1rem;
    margin-top: -0.55rem;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
}

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

/* Progress steps under the button during analysis */
.analysis-progress {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #64748b;
}

.analysis-progress .step {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: color 0.3s;
}

.analysis-progress .step.active {
    color: #0d9488;
    font-weight: 600;
}

.analysis-progress .step.done {
    color: #22c55e;
}

.analysis-progress .step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
    transition: background 0.3s;
}

.analysis-progress .step.active .step-dot {
    background: #0d9488;
    animation: pulse-dot 1s ease-in-out infinite;
}

.analysis-progress .step.done .step-dot {
    background: #22c55e;
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.6; }
}

/* Fullscreen analysis overlay */
.analysis-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.45);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    opacity: 1;
    transition: opacity 0.3s ease;
}

.analysis-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.analysis-overlay-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(13, 148, 136, 0.2);
    border-radius: 20px;
    padding: 3rem 3.5rem;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15), 0 0 40px rgba(13, 148, 136, 0.08);
    max-width: 460px;
    width: 90%;
    animation: overlay-card-in 0.4s ease-out;
}

@keyframes overlay-card-in {
    from { transform: scale(0.9) translateY(20px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}

.analysis-spinner {
    width: 52px;
    height: 52px;
    margin: 0 auto 1.5rem;
    border: 4px solid #e2e8f0;
    border-top-color: #0d9488;
    border-right-color: #0891b2;
    border-radius: 50%;
    animation: overlay-spin 0.8s linear infinite;
}

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

.analysis-overlay-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 1.5rem;
}

.analysis-overlay-steps {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.analysis-overlay-steps .overlay-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: #94a3b8;
    transition: color 0.3s;
}

.analysis-overlay-steps .overlay-step.active {
    color: #0d9488;
    font-weight: 600;
}

.analysis-overlay-steps .overlay-step.done {
    color: #22c55e;
}

.analysis-overlay-steps .overlay-step .step-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.75rem;
    background: #e2e8f0;
    color: #94a3b8;
    transition: all 0.3s;
}

.analysis-overlay-steps .overlay-step.active .step-icon {
    background: #0d9488;
    color: #fff;
    animation: pulse-dot 1s ease-in-out infinite;
}

.analysis-overlay-steps .overlay-step.done .step-icon {
    background: #22c55e;
    color: #fff;
}

.analysis-overlay-hint {
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0;
}

/* Analysis report screen */
.analysis-report-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.analysis-report-header h2 {
    margin: 0;
    font-size: 1.4rem;
    color: #1e293b;
}

.btn-link {
    background: none;
    border: none;
    color: #0d9488;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.btn-link:hover {
    background: rgba(13, 148, 136, 0.08);
}

.btn-start-interview {
    display: block;
    width: 100%;
    margin-top: 1.5rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #0d9488, #0891b2);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.25);
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-start-interview:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(13, 148, 136, 0.35);
}

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

.btn-danger {
    background: #e05555;
}

.btn-danger:hover {
    background: #c03030;
}

/* Mic toggle button */
.btn-mic {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, #16a34a, #22c55e);
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
    box-shadow: 0 2px 10px rgba(22, 163, 74, 0.3);
}

.btn-mic:hover {
    background: linear-gradient(135deg, #15803d, #16a34a);
}

.btn-mic.muted {
    background: #e05555;
}

.btn-mic.muted:hover {
    background: #c03030;
}

/* Skills display */
#skills-display {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #ccfbf1;
    border-radius: 8px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

#skills-content p {
    margin: 0.4rem 0;
    line-height: 1.5;
}

#skills-content strong {
    color: #0f766e;
}

/* ============ Interview Section — Split Screen ============ */
/* Hidden but keeps DOM accessible for JS */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

.interview-split {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    align-items: start;
}

.interview-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.video-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #ccfbf1;
    background: #000;
    box-shadow: 0 8px 30px rgba(13, 148, 136, 0.1);
}

#local-video {
    width: 100%;
    display: block;
}

#status-indicator {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 20px;
    font-size: 0.8rem;
    color: #0d9488;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(13, 148, 136, 0.15);
}

#status-indicator.active {
    color: #4ade80;
}

#status-indicator.error {
    color: #e05555;
}

#status-indicator.reconnecting {
    color: #f59e0b;
    animation: pulse 1.5s infinite;
}

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

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

/* ============ Log Panel (Split-screen right) ============ */

/* Keep hidden log panel stats working */
.log-stats { display: none; }
.stat { display: none; }

.stat-label {
    display: block;
    font-size: 0.65rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    display: block;
    font-size: 1.2rem;
    color: #0d9488;
    font-weight: bold;
    font-family: "SF Mono", monospace;
}

/* ============ Toast Notifications ============ */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.3s ease-out;
    max-width: 360px;
}

.toast.toast-exit {
    animation: toastOut 0.3s ease-in forwards;
}

.toast-info { background: linear-gradient(135deg, #0d9488, #14b8a6); }
.toast-success { background: linear-gradient(135deg, var(--score-good), #22c55e); }
.toast-warning { background: linear-gradient(135deg, var(--accent-coral-dark), var(--accent-coral)); }
.toast-error { background: linear-gradient(135deg, var(--score-critical), #ef4444); }

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

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

/* ============ Report Section ============ */
.report-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #ccfbf1;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 1rem;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.06);
}

.report-card h3 {
    margin-top: 0;
    color: #0d9488;
    font-size: 1.3rem;
}

.report-card h4 {
    margin: 1.25rem 0 0.5rem;
    color: #0f766e;
}

.report-card p {
    line-height: 1.6;
    margin: 0.3rem 0;
}

.report-card ul {
    padding-left: 1.25rem;
    margin: 0.5rem 0;
}

.report-card li {
    line-height: 1.5;
    margin: 0.25rem 0;
}

.score {
    font-size: 1.2rem;
    margin: 0.75rem 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: var(--section-alt-bg);
}

.score strong {
    font-size: 1.4rem;
}

.score.score-level-good strong { color: var(--score-good); }
.score.score-level-warn strong { color: var(--score-warn); }
.score.score-level-critical strong { color: var(--score-critical); }

.score.score-level-good { background: var(--score-good-bg); border: 1px solid var(--score-good-border); }
.score.score-level-warn { background: var(--score-warn-bg); border: 1px solid var(--score-warn-border); }
.score.score-level-critical { background: var(--score-critical-bg); border: 1px solid var(--score-critical-border); }

.storage-info {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

.error {
    color: #dc2626;
}

/* ============ App Navigation ============ */
.app-nav {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.6);
    border-bottom: 1px solid #ccfbf1;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.app-nav button {
    padding: 0.5rem 1rem;
    margin: 0;
    background: transparent;
    color: #64748b;
    border: 1px solid transparent;
    box-shadow: none;
    font-size: 0.85rem;
    border-radius: 6px;
}

.app-nav button:hover {
    background: #f0fdfa;
    color: #0d9488;
    box-shadow: none;
}

.app-nav button.nav-active {
    background: #0d9488;
    color: #fff;
}

/* ============ Wizard Progress ============ */
.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
    padding: 1.5rem 0 0.5rem;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    position: relative;
}

.wizard-step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    background: #e2e8f0;
    color: #94a3b8;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.wizard-step.active .wizard-step-circle {
    background: linear-gradient(135deg, #0d9488, #0891b2);
    color: #fff;
    box-shadow: 0 2px 12px rgba(13, 148, 136, 0.35);
}

.wizard-step.completed .wizard-step-circle {
    background: #22c55e;
    color: #fff;
}

.wizard-step-label {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wizard-step.active .wizard-step-label {
    color: #0d9488;
    font-weight: 600;
}

.wizard-step.completed .wizard-step-label {
    color: #22c55e;
}

.wizard-step-line {
    width: 80px;
    height: 2px;
    background: #e2e8f0;
    margin: 0 0.5rem;
    margin-bottom: 1.2rem;
    transition: background 0.3s;
}

.wizard-step-line.completed {
    background: #22c55e;
}

.wizard-panel {
    animation: wizard-fade-in 0.35s ease-out;
}

@keyframes wizard-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wizard-panel-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.wizard-panel-header h2 {
    margin-bottom: 0.25rem;
    font-size: 1.4rem;
}

.wizard-subtitle {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    gap: 1rem;
}

.wizard-actions .btn-secondary {
    margin-top: 0;
}

.wizard-actions .btn-start-interview {
    width: auto;
    margin-top: 0;
    padding: 0.85rem 2rem;
}

/* ============ Detected Role Banner ============ */
.detected-role-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.08), rgba(8, 145, 178, 0.08));
    border: 1px solid rgba(13, 148, 136, 0.2);
    border-radius: 10px;
    margin-bottom: 1.25rem;
}

.role-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    font-weight: 600;
}

.role-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0d9488;
}

.role-seniority {
    font-size: 0.8rem;
    padding: 0.15rem 0.6rem;
    background: rgba(13, 148, 136, 0.1);
    border-radius: 12px;
    color: #0f766e;
    font-weight: 500;
}

/* ============ Skill Tags ============ */
.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.skill-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
}

.skill-tag-check {
    background: rgba(22, 163, 74, 0.08);
    color: #16a34a;
    border: 1px solid rgba(22, 163, 74, 0.2);
}

.skill-tag-neutral {
    background: #f0fdfa;
    color: #0f766e;
    border: 1px solid #ccfbf1;
}

.skill-tag-warn {
    background: rgba(220, 38, 38, 0.06);
    color: #dc2626;
    border: 1px solid rgba(220, 38, 38, 0.15);
}

.responsibilities-card {
    margin-top: 1rem;
}

.responsibilities-card ul {
    padding-left: 1.25rem;
    margin: 0;
}

.responsibilities-card li {
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0.2rem 0;
    color: #334155;
}

/* ============ Focus Areas (Step 3) ============ */
.config-role-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: rgba(13, 148, 136, 0.06);
    border: 1px solid #ccfbf1;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #1e293b;
}

.focus-areas-section {
    margin-bottom: 1.25rem;
}

.focus-areas-section h3 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
}

.focus-hint {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0 0 0.75rem;
}

.focus-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.focus-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.75rem;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    color: #b45309;
}

/* ============ Interview Config Panel ============ */
.interview-config {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #ccfbf1;
    border-radius: 8px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.interview-config h3 {
    margin: 0 0 0.75rem;
    font-size: 1rem;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
}

.config-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-size: 0.85rem;
    color: #0f766e;
}

.config-grid select, .config-grid input[type="text"] {
    padding: 0.5rem;
    border: 1px solid #99f6e4;
    border-radius: 6px;
    background: #fff;
    font-size: 0.85rem;
}

.checkbox-label {
    flex-direction: row !important;
    align-items: center;
    gap: 0.5rem !important;
}

.btn-secondary {
    background: #fff;
    color: #0d9488;
    border: 1px solid #0d9488;
    box-shadow: none;
}

.btn-secondary:hover {
    background: #f0fdfa;
    box-shadow: none;
}

/* ============ Timer ============ */
/* Round floating timer — top right */
.round-timer {
    position: fixed;
    top: 1.25rem;
    right: 1.5rem;
    z-index: 100;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #ccfbf1;
}

.round-timer.hidden {
    display: none;
}

.timer-ring {
    position: absolute;
    width: 80px;
    height: 80px;
    transform: rotate(-90deg);
}

.timer-ring-bg {
    fill: none;
    stroke: #e2e8f0;
    stroke-width: 4;
}

.timer-ring-fill {
    fill: none;
    stroke: #0d9488;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 213.63;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.5s;
}

.timer-ring-fill.timer-warning {
    stroke: #f59e0b;
}

.timer-ring-fill.timer-critical {
    stroke: #dc2626;
    animation: pulse-ring 0.8s infinite;
}

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

.timer-display {
    font-family: "SF Mono", monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: #1e293b;
    z-index: 1;
    letter-spacing: -0.02em;
}

/* ============ Real-time Indicators ============ */
.realtime-indicators {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    align-items: center;
}

.confidence-meter-live {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: #64748b;
    flex: 1;
}

.confidence-meter-live .meter-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.confidence-meter-live .meter-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s;
}

.meter-fill.meter-low { background: var(--score-critical); }
.meter-fill.meter-mid { background: var(--score-warn); }
.meter-fill.meter-high { background: var(--score-good); }

#live-confidence-value {
    min-width: 35px;
    text-align: right;
    font-weight: bold;
    color: #334155;
}

.noise-indicator {
    font-size: 0.8rem;
    color: #64748b;
}

.noise-low { color: #22c55e; font-weight: bold; }
.noise-med { color: #f59e0b; font-weight: bold; }
.noise-high { color: #dc2626; font-weight: bold; }

/* ============ Screen Share & Record Buttons ============ */
.btn-screen-share, .btn-record {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    background: #fff;
    color: #0d9488;
    border: 1px solid #99f6e4;
    box-shadow: none;
}

.btn-screen-share:hover, .btn-record:hover {
    background: #f0fdfa;
    box-shadow: none;
}

.btn-screen-share.active {
    background: #0d9488;
    color: #fff;
}

.btn-record.recording {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
    animation: pulse 1s infinite;
}

/* ============ Skill Scores ============ */
.skill-scores {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0.75rem 0;
}

.skill-score-item {
    display: grid;
    grid-template-columns: 150px 1fr 50px;
    align-items: center;
    gap: 0.75rem;
}

.skill-name {
    font-size: 0.85rem;
    color: #334155;
    font-weight: 500;
}

.skill-bar {
    height: 10px;
    background: #e2e8f0;
    border-radius: 5px;
    overflow: hidden;
}

.skill-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s;
    background: #0d9488;
}

.skill-fill.score-high { background: linear-gradient(90deg, #16a34a, #22c55e); }
.skill-fill.score-mid { background: linear-gradient(90deg, #d4940a, #E5A700); }
.skill-fill.score-low { background: linear-gradient(90deg, #c33a3a, #E04343); }

.skill-value {
    font-size: 0.85rem;
    font-weight: bold;
    color: #334155;
    text-align: right;
}

.skill-score-item.score-high-item .skill-value { color: var(--score-good); }
.skill-score-item.score-mid-item .skill-value { color: var(--score-warn); }
.skill-score-item.score-low-item .skill-value { color: var(--score-critical); }

.skill-notes {
    grid-column: 1 / -1;
    font-size: 0.8rem;
    color: #64748b;
    margin: 0;
    padding-left: 0.5rem;
    border-left: 2px solid #ccfbf1;
}

/* ============ Coaching Plan ============ */
.coaching-plan {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
    font-size: 0.9rem;
    line-height: 1.7;
    overflow-y: auto;
    max-height: calc(100vh - 220px);
}

/* Coaching Plan Button */
.btn-coaching {
    background: linear-gradient(135deg, #0d9488, #0891b2) !important;
    color: #fff !important;
    font-weight: 600 !important;
    padding: 0.6rem 1.25rem !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-coaching:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.35);
}

/* Coaching Modal */
.coaching-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: coaching-fade-in 0.25s ease-out;
}

.coaching-modal.hidden {
    display: none;
}

.coaching-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.coaching-modal-content {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 90%;
    max-width: 720px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: coaching-slide-up 0.3s ease-out;
}

.coaching-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.coaching-modal-header h3 {
    margin: 0;
    color: #0d9488;
    font-size: 1.15rem;
}

.coaching-modal-actions {
    display: flex;
    gap: 0.5rem;
}

.coaching-modal-actions button {
    font-size: 0.8rem;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    transition: background 0.15s;
}

.coaching-modal-actions button:hover {
    background: #e2e8f0;
}

.coaching-modal-content .coaching-plan {
    margin: 0;
    border: none;
    border-radius: 0 0 16px 16px;
    padding: 1.5rem;
}

@keyframes coaching-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes coaching-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============ Report Loading Animation ============ */
.report-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    animation: report-fade-in 0.4s ease-out;
}

.report-loading h3 {
    margin: 1.5rem 0 0.5rem;
    color: #0d9488;
    font-size: 1.3rem;
}

.report-loading p {
    color: #64748b;
    font-size: 0.95rem;
}

.report-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: #0d9488;
    border-radius: 50%;
    animation: report-spin 0.8s linear infinite;
}

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

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

/* ============ Report Actions ============ */
.report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #ccfbf1;
}

.report-actions button {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    margin: 0;
}

.shared-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent-coral), #FF9472);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
}

/* ============ History Dashboard ============ */
#history-filters {
    margin-bottom: 1rem;
}

#history-search {
    width: 100%;
    max-width: 400px;
    padding: 0.6rem 1rem;
    border: 1px solid #99f6e4;
    border-radius: 8px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.8);
}

.history-table {
    border: 1px solid #ccfbf1;
    border-radius: 8px;
    overflow: hidden;
}

.history-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 0.8fr 1fr 0.8fr;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: #f0fdfa;
    font-size: 0.75rem;
    font-weight: 600;
    color: #0f766e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 0.8fr 1fr 0.8fr;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.7);
    border-top: 1px solid #f0fdfa;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s;
    align-items: center;
}

.history-row:hover {
    background: #f0fdfa;
}

.score-high { color: var(--score-good); font-weight: bold; }
.score-mid { color: var(--score-warn); font-weight: bold; }
.score-low { color: var(--score-critical); font-weight: bold; }

.status-completed { color: #22c55e; }
.status-in_progress { color: #f59e0b; }
.status-pending { color: #64748b; }
.status-abandoned { color: #dc2626; }

.empty-state {
    text-align: center;
    color: #94a3b8;
    padding: 3rem;
    font-size: 0.95rem;
}

/* ============ Transcript View ============ */
.transcript-entry {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid #f0fdfa;
    font-size: 0.85rem;
    line-height: 1.5;
}

.transcript-ai { background: rgba(13, 148, 136, 0.04); }
.transcript-user { background: rgba(37, 99, 235, 0.04); }
.transcript-system { background: rgba(220, 38, 38, 0.04); font-style: italic; }

.transcript-time {
    font-family: "SF Mono", monospace;
    font-size: 0.75rem;
    color: #94a3b8;
    margin-right: 0.5rem;
}

/* ============ Analytics Dashboard ============ */
.analytics-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.analytics-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #ccfbf1;
    border-radius: 8px;
    padding: 1.25rem;
    text-align: center;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.analytics-stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #0d9488;
}

.analytics-stat-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 0.25rem;
}

.analytics-types {
    margin-bottom: 1.5rem;
}

.analytics-charts {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.5rem;
}

.analytics-charts canvas {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #ccfbf1;
    border-radius: 8px;
    padding: 0.5rem;
}

/* ============ Question Preview ============ */
.question-group {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid #ccfbf1;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.question-group h4 {
    margin: 0 0 0.5rem;
    color: #0f766e;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.question-group ul {
    padding-left: 1.25rem;
    margin: 0;
}

.question-group li {
    margin: 0.3rem 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ============ Profile Section ============ */
.profile-form {
    max-width: 600px;
}

.profile-form label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #0f766e;
}

.profile-form input[type="text"] {
    padding: 0.6rem;
    border: 1px solid #99f6e4;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* ============ Print-to-PDF ============ */
@media print {
    #landing-page, header, .app-nav, .controls,
    .round-timer, .report-actions, #toast-container,
    .realtime-indicators { display: none !important; }
    .report-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
    body { background: white; }
    main { padding: 0; }
    #app-page { display: block !important; }
    #report-section { display: block !important; }
}

/* ============ Responsive ============ */
@media (max-width: 800px) {
    .input-grid {
        grid-template-columns: 1fr;
    }

    .analysis-grid {
        grid-template-columns: 1fr;
    }

    .interview-split {
        grid-template-columns: 1fr;
    }

    main {
        padding: 1rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .video-container {
        max-width: 100%;
    }

    .gap-row {
        flex-direction: column;
        gap: 1rem;
    }

    .wizard-progress {
        gap: 0;
    }

    .wizard-step-line {
        width: 40px;
    }

    .wizard-step-label {
        font-size: 0.65rem;
    }

    .wizard-actions {
        flex-direction: column;
    }

    .wizard-actions .btn-start-interview {
        width: 100%;
    }

    .detected-role-banner {
        flex-wrap: wrap;
    }
}
