/* 
 * OPH AI Interview Survey Tool - Styles
 * A sophisticated, calming design for conversational feedback
 */

:root {
    /* Color Palette - Sophisticated teal and warm neutrals */
    --primary: #0d7377;
    --primary-light: #14a3a8;
    --primary-dark: #065a5c;
    --accent: #ff6b35;
    --accent-soft: #ff8c5a;
    
    /* Backgrounds */
    --bg-dark: #0a1628;
    --bg-card: #0f2137;
    --bg-elevated: #162d4d;
    --bg-glass: rgba(15, 33, 55, 0.7);
    
    /* Text */
    --text-primary: #f0f4f8;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Semantic */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    /* Effects */
    --glow-primary: 0 0 40px rgba(13, 115, 119, 0.4);
    --glow-accent: 0 0 30px rgba(255, 107, 53, 0.3);
    
    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* App Container */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Background Effects */
.bg-gradient {
    position: fixed;
    inset: 0;
    background: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(13, 115, 119, 0.3), transparent),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(255, 107, 53, 0.15), transparent),
        radial-gradient(ellipse 40% 30% at 0% 80%, rgba(13, 115, 119, 0.2), transparent);
    pointer-events: none;
    z-index: 0;
}

.bg-pattern {
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

/* Header */
.header {
    position: relative;
    z-index: 10;
    padding: var(--space-lg) var(--space-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-icon {
    width: 40px;
    height: 40px;
    color: var(--primary-light);
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* Progress Section */
.progress-section {
    position: relative;
    z-index: 10;
    padding: var(--space-lg) 0;
    max-width: 800px;
    margin: 0 auto;
    width: calc(100% - 4rem);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.progress-label {
    font-weight: 500;
    color: var(--text-primary);
}

.progress-time {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.progress-bar {
    position: relative;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    overflow: visible;
}

.progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-full);
    transition: width 0.5s ease-out;
    box-shadow: var(--glow-primary);
}

.progress-markers {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 2%;
}

.marker {
    width: 12px;
    height: 12px;
    background: var(--bg-card);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

.marker.active {
    background: var(--primary-light);
    border-color: var(--primary-light);
    box-shadow: 0 0 10px var(--primary-light);
}

.marker.completed {
    background: var(--success);
    border-color: var(--success);
}

.section-labels {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content */
.main-content {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

/* Screens */
.screen {
    display: none;
    width: 100%;
    max-width: 850px;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Welcome Screen */
.welcome-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
}

.welcome-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto var(--space-xl);
    color: var(--primary-light);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

.welcome-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
    background: linear-gradient(135deg, var(--text-primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.welcome-text {
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.welcome-points {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.point {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
}

.point-icon {
    font-size: 1.25rem;
}

/* Primary Button */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--glow-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 50px rgba(13, 115, 119, 0.5);
}

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

.btn-primary svg {
    width: 20px;
    height: 20px;
}

/* Interview Screen */
.message-container {
    text-align: center;
    margin-bottom: var(--space-2xl);
}

.ai-avatar {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto var(--space-lg);
}

.avatar-ring {
    position: absolute;
    inset: -4px;
    border: 2px solid var(--primary-light);
    border-radius: 50%;
    opacity: 0.5;
    animation: ringPulse 2s ease-in-out infinite;
}

@keyframes ringPulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.2; }
}

.avatar-icon {
    width: 100%;
    height: 100%;
    background: var(--bg-elevated);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    padding: 16px;
}

.message-bubble {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 800px;
    max-height: 60vh;
    overflow-y: auto;
    margin: 0 auto;
    text-align: left;
}

.message-bubble p {
    color: var(--text-primary);
    line-height: 1.8;
    white-space: pre-line;
}

/* Audio Visualizer */
.audio-visualizer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 40px;
    margin-top: var(--space-md);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.audio-visualizer.active {
    opacity: 1;
}

.visualizer-bar {
    width: 4px;
    height: 20px;
    background: var(--primary-light);
    border-radius: var(--radius-full);
    animation: visualize 0.5s ease-in-out infinite alternate;
}

.visualizer-bar:nth-child(1) { animation-delay: 0s; }
.visualizer-bar:nth-child(2) { animation-delay: 0.1s; }
.visualizer-bar:nth-child(3) { animation-delay: 0.2s; }
.visualizer-bar:nth-child(4) { animation-delay: 0.1s; }
.visualizer-bar:nth-child(5) { animation-delay: 0s; }

@keyframes visualize {
    from { height: 8px; }
    to { height: 30px; }
}

/* Recording Section */
.recording-section {
    text-align: center;
}

.recording-status {
    margin-bottom: var(--space-lg);
}

.status-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.recording-status.recording .status-text {
    color: var(--accent);
}

/* Record Button */
.record-btn {
    position: relative;
    width: 100px;
    height: 100px;
    background: none;
    border: none;
    cursor: pointer;
    margin-bottom: var(--space-md);
}

.record-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.record-btn-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
}

.record-btn:not(:disabled):hover .record-btn-inner {
    transform: scale(1.05);
    box-shadow: var(--glow-primary);
}

.record-btn.recording .record-btn-inner {
    background: linear-gradient(135deg, var(--accent), var(--accent-soft));
    box-shadow: var(--glow-accent);
}

.record-btn-inner svg {
    width: 40px;
    height: 40px;
}

.record-btn-ring {
    position: absolute;
    inset: -8px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    opacity: 0.3;
}

.record-btn.recording .record-btn-ring {
    border-color: var(--accent);
    animation: ringExpand 1.5s ease-out infinite;
}

@keyframes ringExpand {
    from {
        transform: scale(1);
        opacity: 0.5;
    }
    to {
        transform: scale(1.3);
        opacity: 0;
    }
}

.record-btn-pulse {
    position: absolute;
    inset: 0;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0;
}

.record-btn.recording .record-btn-pulse {
    animation: btnPulse 1s ease-in-out infinite;
}

@keyframes btnPulse {
    0%, 100% { opacity: 0; transform: scale(1); }
    50% { opacity: 0.3; transform: scale(1.1); }
}

.mic-icon, .stop-icon {
    transition: opacity 0.2s ease;
}

.hidden {
    display: none !important;
}

.recording-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* User Visualizer */
.user-visualizer {
    margin-top: var(--space-lg);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.user-visualizer:not(.hidden) {
    opacity: 1;
}

#audio-canvas {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
}

/* Completion Screen */
.completion-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
}

.completion-icon {
    width: 100px;
    height: 100px;
    margin: 0 auto var(--space-xl);
    color: var(--success);
}

.completion-title {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.completion-text {
    color: var(--text-secondary);
    max-width: 450px;
    margin: 0 auto var(--space-xl);
}

.completion-stats {
    display: flex;
    justify-content: center;
    gap: var(--space-2xl);
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-light);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Footer */
.footer {
    position: relative;
    z-index: 10;
    padding: var(--space-lg);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: var(--space-sm);
        text-align: center;
    }
    
    .progress-section {
        padding: var(--space-md);
    }
    
    .section-labels {
        font-size: 0.625rem;
    }
    
    .welcome-card,
    .completion-card {
        padding: var(--space-xl);
    }
    
    .welcome-title,
    .completion-title {
        font-size: 1.5rem;
    }
    
    .welcome-points {
        align-items: flex-start;
        text-align: left;
    }
    
    .completion-stats {
        flex-direction: column;
        gap: var(--space-lg);
    }
}

/* Loading State */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

/* Processing indicator */
.processing {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.processing-dots {
    display: flex;
    gap: 4px;
}

.processing-dots span {
    width: 6px;
    height: 6px;
    background: var(--primary-light);
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite;
}

.processing-dots span:nth-child(1) { animation-delay: 0s; }
.processing-dots span:nth-child(2) { animation-delay: 0.2s; }
.processing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

