/* =============================================================================
   Oral Examination Portal - Academic Theme
   Clean, professional design for student interviews
   ============================================================================= */

/* CSS Custom Properties */
:root {
    /* Academic Color Palette */
    --primary: #1e3a5f;
    /* Deep navy blue */
    --primary-light: #2d5a8a;
    --primary-dark: #0f2240;
    --accent: #c9a227;
    /* Academic gold */
    --accent-light: #e8c84a;

    /* Neutral Tones */
    --bg-primary: #f8f9fc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eef1f6;
    --border: #e2e6ed;
    --border-light: #f0f2f5;

    /* Text Colors */
    --text-primary: #1a1f2e;
    --text-secondary: #4a5568;
    --text-muted: #718096;
    --text-light: #a0aec0;

    /* State Colors */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;

    /* Typography */
    --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;

    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

/* 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-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Background Pattern */
.bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 400px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, var(--primary) 100%);
    z-index: -1;
}

.bg-pattern::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    background: linear-gradient(to bottom, transparent, var(--bg-primary));
}

/* Header */
.header {
    padding: var(--space-lg) var(--space-xl);
    color: white;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.logo-icon i {
    font-size: 1.75rem;
    color: var(--accent);
}

.logo-text h1 {
    font-family: var(--font-primary);
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 2px;
}

.logo-text .tagline {
    font-size: 0.875rem;
    opacity: 0.8;
    font-weight: 400;
}

.header-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: rgba(255, 255, 255, 0.1);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-xl);
    font-size: 0.875rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 0 var(--space-xl) var(--space-xl);
    margin-top: -20px;
}

.content-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: var(--space-xl);
    align-items: start;
}

/* Panels */
.panel {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

/* Login Panel */
.login-panel {
    padding: var(--space-xl);
}

.login-panel .panel-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.panel-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.panel-icon i {
    font-size: 1.5rem;
    color: white;
}

.panel-title h2 {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.panel-title p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Form Styles */
.exam-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.form-group label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group label i {
    font-size: 1rem;
    color: var(--primary);
}

.form-group input,
.form-group select {
    height: 48px;
    padding: 0 var(--space-md);
    font-size: 0.9375rem;
    font-family: var(--font-primary);
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    background: var(--bg-secondary);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(30, 58, 95, 0.1);
}

.form-group input::placeholder {
    color: var(--text-light);
}

/* Custom Select */
.select-wrapper {
    position: relative;
}

.select-wrapper select {
    width: 100%;
    appearance: none;
    cursor: pointer;
    padding-right: 40px;
}

.select-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* Primary Button */
.btn-primary {
    height: 52px;
    padding: 0 var(--space-xl);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-primary);
    color: white;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: var(--space-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

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

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

.btn-content i {
    font-size: 1.25rem;
}

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

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Connection Status */
.connection-status {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-light);
    transition: var(--transition-fast);
}

.status-indicator.connected {
    background: var(--success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.status-indicator.connecting {
    background: var(--warning);
    animation: pulse 1s infinite;
}

.status-indicator.error {
    background: var(--error);
}

/* Exam Interface */
.exam-interface {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

/* Voice Panel */
.voice-panel {
    padding: var(--space-xl);
    text-align: center;
}

.voice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
}

.voice-header h3 {
    font-family: var(--font-primary);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.exam-timer {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Voice Orb Visualization */
.voice-visualization {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-xl) 0;
}

.voice-orb {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.orb-core {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    box-shadow: var(--shadow-lg);
}

.orb-core i {
    font-size: 2rem;
    color: white;
}

.orb-ring {
    position: absolute;
    border: 2px solid var(--primary);
    border-radius: 50%;
    opacity: 0;
    animation: ripple 3s ease-out infinite;
}

.voice-orb.active .orb-ring {
    animation: ripple-active 1.5s ease-out infinite;
}

.ring-1 {
    width: 100%;
    height: 100%;
    animation-delay: 0s;
}

.ring-2 {
    width: 100%;
    height: 100%;
    animation-delay: 0.5s;
}

.ring-3 {
    width: 100%;
    height: 100%;
    animation-delay: 1s;
}

@keyframes ripple {
    0% {
        transform: scale(0.8);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes ripple-active {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.voice-status {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Progress Bar */
.exam-progress {
    margin-top: var(--space-lg);
}

.progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: var(--space-sm);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
}

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

/* Transcript Panel */
.transcript-panel {
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.panel-header.compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
}

.panel-header.compact h3 {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-primary);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.panel-header.compact h3 i {
    color: var(--primary);
}

.live-badge {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 4px 10px;
    background: var(--error);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    border-radius: var(--radius-sm);
}

.live-dot {
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    animation: pulse 1s infinite;
}

/* Chat Container */
.chat-container {
    flex: 1;
    padding: var(--space-lg);
    overflow-y: auto;
    max-height: 350px;
}

.chat-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
}

.placeholder-icon {
    width: 64px;
    height: 64px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
}

.placeholder-icon i {
    font-size: 1.75rem;
    color: var(--text-light);
}

.chat-placeholder p {
    font-size: 1rem;
    margin-bottom: var(--space-sm);
}

.placeholder-hint {
    font-size: 0.8125rem;
    color: var(--text-light);
}

/* Chat Messages */
.chat-message {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-message.agent {
    flex-direction: row;
}

.chat-message.student {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.agent .message-avatar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
}

.student .message-avatar {
    background: var(--accent);
    color: white;
}

.message-content {
    max-width: 75%;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.agent .message-content {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.student .message-content {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Footer */
.footer {
    padding: var(--space-lg) var(--space-xl);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-left p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.tech-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.tech-badge i {
    color: var(--accent);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
    }

    .login-panel {
        order: 1;
    }

    .exam-interface {
        order: 2;
    }
}

@media (max-width: 640px) {
    .header-content {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .footer-content {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }
}

/* Scrollbar Styling */
.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: var(--text-light);
    border-radius: 3px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}