@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-heading: 'Outfit', sans-serif;
    
    /* Sleek Dark Mode Palette (Ensign College Green/Gold themed) */
    --bg-base: #09120e;
    --bg-surface: rgba(12, 28, 20, 0.65);
    --bg-surface-elevated: rgba(20, 44, 31, 0.8);
    --border-color: rgba(255, 255, 255, 0.08);
    
    /* Text Colors */
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    /* Branding & Accent Colors */
    --accent-green: #10b981;
    --accent-gold: #fbbf24;
    --accent-gradient: linear-gradient(135deg, #10b981 0%, #fbbf24 100%);
    
    /* Status Colors */
    --status-success: #10b981;
    --status-warning: #f59e0b;
    --status-danger: #ef4444;
    --status-muted: #64748b;
    --status-thinking: #a78bfa;
    --status-success-bg: rgba(16, 185, 129, 0.1);
    --status-warning-bg: rgba(245, 158, 11, 0.1);
    --status-danger-bg: rgba(239, 68, 68, 0.1);
    
    /* Transitions & Shadows */
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 1px 1px 0 rgba(255, 255, 255, 0.05) inset;
}

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

body {
    font-family: var(--font-primary);
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 2rem 1.5rem;
    overflow-x: hidden;
    background-image: 
        radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(251, 191, 36, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

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

h1 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.system-status {
    display: flex;
    gap: 1rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dashboard-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.dashboard-link:hover,
.dashboard-link:focus-visible {
    border-color: var(--accent-gold);
    background: rgba(251, 191, 36, 0.1);
    outline: none;
}

.dashboard-link-top { margin-bottom: 0.75rem; }

@media (max-width: 680px) {
    header { align-items: flex-start; flex-direction: column; }
    .header-actions { flex-wrap: wrap; }
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--status-muted);
}

.status-indicator.connected {
    background-color: var(--status-success);
    box-shadow: 0 0 10px var(--status-success);
}

.status-indicator.warning {
    background-color: var(--status-warning);
    box-shadow: 0 0 10px var(--status-warning);
}

.status-indicator.recording {
    background-color: var(--status-danger);
    box-shadow: 0 0 10px var(--status-danger);
    animation: pulse 1.5s infinite;
}

.status-indicator.thinking {
    background-color: var(--status-thinking);
    box-shadow: 0 0 12px rgba(167, 139, 250, 0.9);
    animation: thinking-indicator 1.15s ease-in-out infinite;
}

.dashboard-grid {
    display: flex;
    justify-content: center;
}

.panel {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: var(--shadow-premium);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.75rem;
}

.panel-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.question-display {
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 4px solid var(--accent-gold);
    line-height: 1.4;
}

.framework-guide {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    border-left: 3px solid var(--accent-green);
    border-radius: 0 10px 10px 0;
    background: rgba(16, 185, 129, 0.07);
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.framework-guide-label {
    flex: 0 0 auto;
    color: var(--accent-green);
    font-weight: 700;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}

textarea {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    padding: 1rem;
    font-size: 1rem;
    font-family: var(--font-primary);
    transition: var(--transition-smooth);
    resize: vertical;
}

textarea:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
    background-color: rgba(255, 255, 255, 0.05);
    outline: none;
}

textarea::-webkit-scrollbar {
    width: 8px;
}
textarea::-webkit-scrollbar-track {
    background: transparent;
}
textarea::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
textarea::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.interview-controls {
    display: grid;
    grid-template-columns: 1fr 1.12fr 1.3fr;
    gap: 0.75rem;
    margin-top: 0.35rem;
}

.interview-controls .btn {
    min-width: 0;
    min-height: 3.4rem;
    padding: 0.7rem 0.85rem;
    line-height: 1.2;
    text-align: left;
}

.control-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.55rem;
    height: 1.55rem;
    flex: 0 0 1.55rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    font-size: 0.78rem;
    font-weight: 700;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
}

.btn-record {
    border-color: rgba(52, 211, 153, 0.45);
    background: linear-gradient(135deg, #059669 0%, #34d399 100%);
    color: #f0fdf4;
}

.btn-record:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.38);
}

.btn-submit {
    border-color: rgba(253, 230, 138, 0.55);
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    color: #261807;
}

.btn-submit .control-step {
    background: rgba(38, 24, 7, 0.14);
}

.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(251, 191, 36, 0.38);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

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

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-red {
    background-color: var(--status-danger) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
    color: white !important;
}

.btn-red:hover:not(:disabled) {
    background-color: #dc2626 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.interview-controls .btn:disabled {
    opacity: 0.62;
}

.visualizer-container {
    height: 48px;
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    gap: 3px;
    border: 1px solid var(--border-color);
}

.visualizer-bar {
    width: 3px;
    height: 10px;
    background-color: var(--accent-green);
    border-radius: 2px;
    transition: height 0.1s ease;
}

.visualizer-container.active .visualizer-bar:nth-child(2n) { animation: wave 1.2s ease-in-out infinite alternate; }
.visualizer-container.active .visualizer-bar:nth-child(3n) { animation: wave 0.8s ease-in-out infinite alternate; }
.visualizer-container.active .visualizer-bar:nth-child(5n) { animation: wave 1.5s ease-in-out infinite alternate; }

@keyframes wave {
    0% { height: 8px; }
    100% { height: 36px; }
}

.tip-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.note-output {
    background-color: #050a08;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    font-size: 1rem;
    height: 60vh;
    overflow-y: auto;
    color: #e5e7eb;
}

.note-output h1, .note-output h2, .note-output h3 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    color: var(--accent-gold);
}

.note-output h3 {
    font-size: 1.2rem;
}

.note-output ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.note-output li {
    margin-bottom: 0.5rem;
}

.note-output p {
    margin-bottom: 1rem;
}

.note-output strong {
    color: #fff;
}

.processing-indicator {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.9rem;
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.08);
    color: var(--text-primary);
    font-size: 0.88rem;
}

.processing-indicator[data-mode="recording"] {
    border-color: rgba(239, 68, 68, 0.38);
    background: rgba(239, 68, 68, 0.1);
}

.processing-indicator[data-mode="transcribing"] {
    border-color: rgba(56, 189, 248, 0.38);
    background: rgba(56, 189, 248, 0.09);
}

.processing-indicator[data-mode="thinking"] {
    border-color: rgba(167, 139, 250, 0.55);
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.16), rgba(167, 139, 250, 0.08));
}

.processing-indicator[hidden] { display: none; }

.processing-dot {
    width: 0.65rem;
    height: 0.65rem;
    flex: 0 0 0.65rem;
    border-radius: 50%;
    background: var(--accent-gold);
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5);
    animation: processing-pulse 1.2s ease-in-out infinite;
}

.processing-indicator[data-mode="recording"] .processing-dot {
    background: var(--status-danger);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
}

.processing-indicator[data-mode="transcribing"] .processing-dot {
    background: #38bdf8;
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.5);
}

.processing-indicator[data-mode="thinking"] .processing-dot {
    background: var(--status-thinking);
    box-shadow: 0 0 0 0 rgba(167, 139, 250, 0.6);
    animation: thinking-pulse 1.15s ease-in-out infinite;
}

.evaluation-loading {
    padding: 2rem;
    text-align: center;
}

.evaluation-loading-title {
    color: var(--status-thinking);
    animation: thinking-text 1.15s ease-in-out infinite;
    font-size: 1.1rem;
    font-weight: 600;
}

@keyframes processing-pulse {
    50% { box-shadow: 0 0 0 0.45rem rgba(245, 158, 11, 0); }
}

@keyframes thinking-pulse {
    50% { box-shadow: 0 0 0 0.5rem rgba(167, 139, 250, 0); }
}

@keyframes thinking-indicator {
    50% { transform: scale(1.35); opacity: 0.75; }
}

@keyframes thinking-text {
    50% { opacity: 0.62; }
}

@media (max-width: 560px) {
    .framework-guide { flex-direction: column; gap: 0.25rem; }
    .interview-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.45rem; }
    .interview-controls .btn {
        flex-direction: column;
        min-height: 5.6rem;
        padding: 0.65rem 0.35rem;
        font-size: 0.76rem;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}

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