/* ElevenLabs Quiz Agent - Dark Theme */
/* Based on 11labs-Interview styling */

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

:root {
    --accent-cyan: #00D2FF;
    --accent-purple: #9333EA;
    --bg-dark: #0A0A0D;
    --bg-card: rgba(255, 255, 255, 0.05);
    --border-light: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-dark);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

/* Header */
header {
    background: linear-gradient(135deg, rgba(0, 210, 255, 0.1) 0%, rgba(147, 51, 234, 0.1) 100%);
    color: white;
    padding: 40px;
    text-align: center;
    border-bottom: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

/* Footer Logo */
.container-footer {
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
}

.footer-logo {
    height: 24px;
    width: auto;
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

.footer-logo:hover {
    opacity: 0.7;
}

header::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.15) 0%, transparent 70%);
    top: -200px;
    right: -150px;
    pointer-events: none;
    filter: blur(40px);
}

header::after {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(147, 51, 234, 0.1) 0%, transparent 70%);
    bottom: -150px;
    left: -150px;
    pointer-events: none;
    filter: blur(40px);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 800;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

.subtitle {
    opacity: 0.85;
    font-size: 1.1em;
    font-weight: 500;
    position: relative;
    z-index: 1;
}

main {
    padding: 30px;
    background: var(--bg-dark);
}

/* Settings Button */
.settings-button {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.2s ease;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

.settings-button:hover {
    background: rgba(0, 210, 255, 0.3);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(0, 210, 255, 0.4);
}

/* Tab Navigation */
.tab-navigation {
    margin-bottom: 30px;
}

.tab-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 0 20px;
}

.tab-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-step:hover .tab-number {
    transform: scale(1.1);
}

.tab-number {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1em;
    color: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.tab-step.active .tab-number {
    background: rgba(0, 210, 255, 0.2);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.3);
}

.tab-step.completed .tab-number {
    background: rgba(0, 210, 255, 0.1);
    border-color: rgba(0, 210, 255, 0.3);
    color: var(--accent-cyan);
}

.tab-label {
    font-size: 0.875em;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    text-align: center;
}

.tab-step.active .tab-label {
    color: var(--accent-cyan);
}

.tab-step.completed .tab-label {
    color: var(--text-secondary);
}

/* Tab Content */
.tab-content-container {
    position: relative;
    min-height: 500px;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Panel Styles */
.panel {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 500px;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.panel:hover {
    border-color: rgba(0, 210, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 210, 255, 0.1);
}

.panel-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-header h2 {
    font-size: 1.25em;
    color: var(--text-primary);
    margin: 0;
    font-weight: 700;
}

.panel-content {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

/* Form Elements */
.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.2);
    background: rgba(0, 210, 255, 0.05);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 200px;
    line-height: 1.6;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-hint {
    margin-top: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.char-count {
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

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

.btn-primary {
    background: rgba(0, 210, 255, 0.2);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 210, 255, 0.3);
}

.btn-primary:hover:not(:disabled) {
    background: rgba(0, 210, 255, 0.3);
    border-color: rgba(0, 210, 255, 0.5);
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.3);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

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

.btn-large {
    padding: 16px 32px;
    font-size: 1.1em;
}

/* Navigation Buttons */
.tab-navigation-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
}

/* Knowledge Areas Display */
.knowledge-areas-preview {
    margin-top: 24px;
    padding: 20px;
    background: rgba(0, 210, 255, 0.05);
    border: 1px solid rgba(0, 210, 255, 0.2);
    border-radius: 12px;
}

.knowledge-areas-preview h3 {
    color: var(--accent-cyan);
    margin-bottom: 16px;
    font-size: 1.1em;
}

.knowledge-area-tag {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(0, 210, 255, 0.15);
    border: 1px solid rgba(0, 210, 255, 0.3);
    border-radius: 20px;
    margin: 4px;
    font-size: 0.9em;
    color: var(--accent-cyan);
}

/* Widget Container */
.widget-container {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 40px;
}

.widget-placeholder {
    color: var(--text-muted);
    text-align: center;
}

.widget-error {
    text-align: center;
}

.widget-error p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

elevenlabs-convai {
    width: 100%;
    min-height: 350px;
}

/* Quiz Status */
.quiz-status {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid var(--border-light);
}

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

.status-indicator.ready {
    background: var(--accent-cyan);
    box-shadow: 0 0 10px var(--accent-cyan);
}

.status-indicator.active {
    background: #22c55e;
    box-shadow: 0 0 10px #22c55e;
    animation: pulse 1.5s infinite;
}

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

.status-text {
    font-weight: 500;
    color: var(--text-secondary);
}

.timer {
    margin-left: auto;
    font-family: 'Monaco', monospace;
    font-size: 1.2em;
    color: var(--accent-cyan);
}

/* Finish Section */
.finish-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.finish-hint {
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Scorecard Styles */
.scorecard {
    padding: 30px;
}

.scorecard-header {
    text-align: center;
    margin-bottom: 40px;
}

.overall-grade {
    font-size: 6em;
    font-weight: 800;
    color: var(--accent-cyan);
    line-height: 1;
    margin-bottom: 10px;
    text-shadow: 0 0 40px rgba(0, 210, 255, 0.5);
}

.overall-score {
    font-size: 1.5em;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.benchmark {
    padding: 16px 24px;
    background: rgba(147, 51, 234, 0.1);
    border: 1px solid rgba(147, 51, 234, 0.3);
    border-radius: 10px;
    color: var(--accent-purple);
    display: inline-block;
    font-weight: 500;
}

/* Area Scores */
.area-scores {
    margin-top: 40px;
}

.area-scores h3 {
    color: var(--text-primary);
    margin-bottom: 24px;
    font-size: 1.3em;
}

.area-score-item {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
}

.area-score-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.area-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1em;
}

.area-score-value {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--accent-cyan);
}

.score-bar-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.score-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.area-reasoning {
    color: var(--text-secondary);
    font-size: 0.95em;
    line-height: 1.6;
}

/* Summary Section */
.summary-section {
    margin-top: 40px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 12px;
}

.summary-section h3 {
    color: var(--text-primary);
    margin-bottom: 16px;
}

.summary-section p {
    color: var(--text-secondary);
    line-height: 1.7;
}

/* New Quiz Button */
.new-quiz-section {
    margin-top: 40px;
    text-align: center;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.03);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
}

.modal-content {
    padding: 24px;
}

.settings-section {
    margin-bottom: 24px;
}

.settings-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 210, 255, 0.2);
}

.settings-section .form-input {
    margin-bottom: 12px;
}

.save-settings-btn {
    width: 100%;
    margin-top: 24px;
    padding: 14px 24px;
}

/* Loading State */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(0, 210, 255, 0.2);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    margin-top: 16px;
    color: var(--text-secondary);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 210, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 210, 255, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    header {
        padding: 30px 20px;
    }
    
    header h1 {
        font-size: 1.75em;
    }
    
    main {
        padding: 20px;
    }
    
    .tab-number {
        width: 40px;
        height: 40px;
        font-size: 1em;
    }
    
    .tab-label {
        display: none;
    }
    
    .settings-button {
        top: 10px;
        right: 10px;
        padding: 10px 16px;
        font-size: 0.85em;
    }
    
    .overall-grade {
        font-size: 4em;
    }
    
    .tab-navigation-buttons {
        flex-direction: column;
        gap: 12px;
    }
    
    .tab-navigation-buttons .btn {
        width: 100%;
    }
}
