/* Educational Assessment Styles - Complete Layout + Educational Features */

/* =============================================================================
   CORE ASSESSMENT LAYOUT (shared with guessing-game)
   ============================================================================= */

.assessment-wrapper {
    width: 100%;
    background: var(--light-gray);
}

.assessment-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: block;
}

.assessment-page .main-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    align-items: start;
}

/* Assessment Panel */
.assessment-panel {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.assessment-header {
    background: linear-gradient(135deg, var(--primary-orange), var(--light-orange));
    color: var(--white);
    padding: 25px;
    text-align: center;
}

.assessment-header h2 {
    color: var(--white);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.assessment-header p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 15px;
}

/* Progress Bar */
.progress-container {
    margin-top: 15px;
}

.progress-bar {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    height: 10px;
    position: relative;
    overflow: hidden;
}

.progress-fill {
    background: var(--white);
    height: 100%;
    border-radius: 20px;
    transition: var(--transition);
    width: 0%;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.progress-text {
    font-size: 0.9rem;
    display: block;
    opacity: 0.9;
}

.section-indicator {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Question Card */
.question-card {
    padding: 30px;
    transition: var(--transition);
    opacity: 1;
}

.question-card.fading {
    opacity: 0;
    transform: translateY(10px);
}

.question-header {
    margin-bottom: 20px;
}

.question-number {
    color: var(--primary-orange);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.section-info {
    margin-bottom: 10px;
}

.section-name {
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
}

.question-text {
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 25px;
    line-height: 1.5;
}

/* Answer Options */
.answer-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.answer-btn {
    background: var(--white);
    border: 2px solid var(--medium-gray);
    border-radius: var(--border-radius);
    padding: 15px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.95rem;
}

.answer-btn:hover {
    border-color: var(--light-orange);
    background: rgba(255, 107, 53, 0.05);
    transform: translateY(-1px);
}

.answer-btn.selected {
    border-color: var(--primary-orange);
    background: rgba(255, 107, 53, 0.1);
}

.answer-value {
    background: var(--primary-orange);
    color: var(--white);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.answer-desc {
    color: var(--text-dark);
    line-height: 1.4;
}

/* Navigation Buttons */
.question-nav {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

/* Sidebar Styles */
.assessment-page .sidebar {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 0;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.sidebar-header {
    background: linear-gradient(135deg, var(--dark-orange), var(--primary-orange));
    color: var(--white);
    padding: 20px;
    text-align: center;
}

.sidebar-header h3 {
    color: var(--white);
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.progress-status, .analysis-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9rem;
    opacity: 0.9;
}

.status-indicator {
    animation: pulse 2s infinite;
}

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

/* Analysis Cards */
.analysis-card {
    padding: 20px;
    border-bottom: 1px solid var(--medium-gray);
}

.analysis-card:last-child {
    border-bottom: none;
}

.analysis-card h4 {
    color: var(--primary-orange);
    font-size: 1rem;
    margin-bottom: 15px;
    font-weight: 600;
}

/* Loading and Error States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-content {
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--medium-gray);
    border-top: 4px solid var(--primary-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

.loading-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.loading-subtitle {
    color: var(--text-light);
    font-size: 0.9rem;
}

.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--white);
    border: 2px solid var(--danger-red);
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: var(--box-shadow);
    z-index: 9999;
    display: none;
    max-width: 400px;
}

.error-content {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.error-icon {
    font-size: 1.2rem;
    color: var(--danger-red);
}

.error-body {
    flex: 1;
}

.error-text {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.error-actions {
    margin-top: 0.5rem;
}

.error-close {
    background: var(--danger-red);
    color: var(--white);
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

/* =============================================================================
   EDUCATIONAL-SPECIFIC STYLES
   ============================================================================= */

/* Introduction Card */
.introduction-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 30px;
}

.intro-content h3 {
    color: var(--primary-orange);
    margin-bottom: 1rem;
    text-align: center;
}

.intro-content p {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-light);
}

.intro-actions {
    text-align: center;
    margin-top: 2rem;
}

/* Classification Grid */
.classification-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.classification-axis h4 {
    color: var(--primary-orange);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.axis-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.axis-option {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-orange);
}

/* Section Explainer Card */
.section-explainer-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 30px;
    display: none;
}

.explainer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #eee;
}

.section-score {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.score-label {
    font-weight: 500;
    color: var(--text-dark);
}

.score-value {
    font-weight: bold;
    color: var(--primary-orange);
    font-size: 1.2rem;
}

.explainer-content {
    margin-bottom: 1.5rem;
}

.explainer-content h4 {
    color: var(--primary-orange);
    margin-bottom: 1rem;
}

.explainer-content p {
    color: var(--text-dark);
    line-height: 1.6;
}

.explainer-actions {
    text-align: center;
}

/* Results Section */
.results-section {
    padding: 30px;
    display: none;
}

.results-header {
    text-align: center;
    margin-bottom: 2rem;
}

.results-header h2 {
    color: var(--primary-orange);
    margin-bottom: 1rem;
}

.results-header p {
    color: var(--text-light);
}

/* Classification Result */
.classification-result {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.classification-level {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.level-number {
    background: var(--primary-orange);
    color: white;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

.level-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.classification-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.classification-details {
    background: var(--white);
    padding: 1rem;
    border-radius: 8px;
    text-align: left;
}

.classification-details p {
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

/* Current Classification Sidebar */
.current-classification {
    text-align: center;
}

.classification-card .classification-level {
    flex-direction: column;
    gap: 0.5rem;
}

.classification-card .level-number {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.2rem;
}

.classification-card .level-name {
    font-size: 1rem;
    font-weight: 500;
}

.classification-card .classification-description {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Section Progress List */
.sections-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.section-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    transition: background-color 0.3s ease;
}

.section-item.current {
    background: #fff3e0;
    border-left: 4px solid var(--primary-orange);
}

.section-item.completed {
    background: #e8f5e8;
}

.section-status {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.section-title {
    font-size: 0.9rem;
    color: #555;
}

.section-item.completed .section-status {
    color: #4caf50;
}

.section-item.current .section-status {
    color: var(--primary-orange);
}

/* Assessment Info */
.assessment-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.info-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    color: var(--primary-orange);
}

.info-text {
    font-size: 0.9rem;
    color: #555;
}

/* Recommendations Section */
.recommendations-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.recommendations-section h3 {
    color: var(--primary-orange);
    margin-bottom: 1.5rem;
    text-align: center;
}

.recommendation-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--primary-orange);
}

.recommendation-icon {
    font-size: 1.2rem;
    margin-top: 0.2rem;
    color: var(--primary-orange);
}

.recommendation-text {
    color: #555;
    line-height: 1.5;
}

.results-actions {
    text-align: center;
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Level-specific colors */
.level-number.level-1 { background: #4caf50; }
.level-number.level-2 { background: #8bc34a; }
.level-number.level-3 { background: #ff9800; }
.level-number.level-4 { background: #ff5722; }
.level-number.level-5 { background: #f44336; }

/* =============================================================================
   RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 1024px) {
    .assessment-page .main-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .assessment-page .sidebar {
        position: static;
        max-height: none;
        order: -1;
    }
    
    .classification-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .assessment-page {
        padding: 15px;
    }
    
    .question-card, .introduction-card, .section-explainer-card {
        padding: 20px;
    }
    
    .question-nav {
        flex-direction: column;
    }
    
    .nav-btn {
        width: 100%;
    }
    
    .classification-level {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .explainer-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .results-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .introduction-card, .section-explainer-card {
        padding: 1.5rem;
        margin: 15px;
    }
    
    .classification-grid {
        gap: 1rem;
    }
    
    .axis-option {
        padding: 0.75rem;
    }
    
    .results-section {
        padding: 20px;
    }
}

/* Enhanced explainer content styling */
.explainer-wrapper {
    line-height: 1.7;
    max-width: 100%;
    color: #333;
}

/* Section containers with subtle background */
.explainer-section {
    margin-bottom: 2em;
    padding: 1.5em;
    background: linear-gradient(135deg, #fff8f5 0%, #fef7f3 100%);
    border-left: 4px solid #ff6b35;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.08);
}

/* Section headers */
.explainer-header {
    color: #ff6b35;
    font-size: 1.2em;
    font-weight: 700;
    margin: 0 0 1em 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
}

.explainer-header::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, #ff6b35, #ff8c5a);
    border-radius: 1px;
}

/* Standalone headers (less prominent) */
.explainer-standalone-header {
    color: #d4531f;
    font-size: 1.1em;
    font-weight: 600;
    margin: 1.5em 0 0.8em 0;
    padding-left: 1em;
    border-left: 3px solid #ff6b35;
}

/* Content within sections */
.explainer-content {
    color: #444;
    line-height: 1.6;
    font-size: 0.95em;
}

/* Regular paragraphs */
.explainer-paragraph {
    margin-bottom: 1.2em;
    line-height: 1.6;
    color: #444;
}

/* Paragraphs that start with emphasis */
.explainer-emphasis {
    margin-bottom: 1.2em;
    line-height: 1.6;
    padding: 1em;
    background: #fff;
    border: 1px solid #ffe8dc;
    border-radius: 6px;
    position: relative;
}

.explainer-emphasis::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #ff6b35, #ff8c5a);
    border-radius: 0 0 0 6px;
}

/* Enhanced strong/bold styling */
.explainer-wrapper strong {
    font-weight: 700;
    color: #d4531f;
    position: relative;
    padding: 0 2px;
}

/* Subtle highlight effect for important terms */
.explainer-section strong {
    background: linear-gradient(120deg, transparent 0%, transparent 95%, #ffe8dc 95%);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: 0 0;
}

/* Improved readability */
.explainer-wrapper p:last-child {
    margin-bottom: 0;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .explainer-section {
        padding: 1.2em;
        margin-bottom: 1.5em;
    }
    
    .explainer-header {
        font-size: 1.1em;
    }
    
    .explainer-content {
        font-size: 0.9em;
    }
}

/* Integration with existing styles */
.intro-content .explainer-wrapper {
    text-align: left !important;
}

.intro-content .explainer-wrapper * {
    text-align: left !important;
}

/* Special styling for key concepts */
.explainer-wrapper .key-concept {
    background: #fff;
    border: 2px solid #ff6b35;
    border-radius: 8px;
    padding: 1.2em;
    margin: 1.5em 0;
    position: relative;
}

.explainer-wrapper .key-concept::before {
    content: '💡';
    position: absolute;
    top: -10px;
    left: 15px;
    background: #fff;
    padding: 0 8px;
    font-size: 1.2em;
}

.intro-content .explainer-wrapper {
    text-align: left !important;
}

.intro-content .explainer-wrapper * {
    text-align: left !important;
}

/* Override any center alignment for the intro content sections */
.introduction-card .explainer-section {
    margin-bottom: 2em;
    padding: 1.5em;
    background: linear-gradient(135deg, #fff8f5 0%, #fef7f3 100%);
    border-left: 4px solid #ff6b35;
    border-radius: 0 8px 8px 0;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.08);
    text-align: left !important;
}

.introduction-card .explainer-header {
    color: #ff6b35;
    font-size: 1.2em;
    font-weight: 700;
    margin: 0 0 1em 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    text-align: left !important;
}

.introduction-card .explainer-content {
    color: #444;
    line-height: 1.6;
    font-size: 0.95em;
    text-align: left !important;
}

.introduction-card .explainer-paragraph,
.introduction-card .explainer-emphasis {
    text-align: left !important;
}