/* =============================================================================
   IQ Test Analysis Page — Styles
   ============================================================================= */

/* Lock Screen */
.analysis-lock {
    text-align: center;
    padding: 64px 24px;
    max-width: 480px;
    margin: 0 auto;
}

.analysis-lock-icon {
    width: 88px;
    height: 88px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.analysis-lock-icon svg {
    stroke: #94a3b8;
}

.analysis-lock-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 12px;
}

.analysis-lock-desc {
    color: #64748b;
    line-height: 1.7;
    margin: 0 0 32px;
    font-size: 0.95rem;
}

.analysis-lock-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 0 auto 36px;
    max-width: 300px;
}

.analysis-step {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
    font-size: 0.95rem;
    color: #334155;
}

.analysis-step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Header */
.analysis-header {
    text-align: center;
    padding: 36px 16px 24px;
}

.analysis-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.analysis-title svg {
    stroke: #f97316;
    flex-shrink: 0;
}

.analysis-subtitle {
    color: #64748b;
    font-size: 0.95rem;
    margin: 0;
}

/* Question List */
.analysis-list {
    padding: 0 8px;
}

/* Loading */
.analysis-loading {
    text-align: center;
    padding: 48px 16px;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.analysis-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #f97316;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Single Question Card */
.analysis-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: box-shadow 0.3s;
}

.analysis-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.analysis-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #fff7ed, #fef3c7);
    border-bottom: 1px solid #fed7aa;
    cursor: pointer;
    user-select: none;
}

.analysis-card-header:hover {
    background: linear-gradient(135deg, #ffedd5, #fde68a);
}

.analysis-card-num {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.analysis-card-answer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 4px 14px;
    border-radius: 20px;
}

.analysis-card-toggle {
    width: 24px;
    height: 24px;
    stroke: #94a3b8;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.analysis-card.expanded .analysis-card-toggle {
    transform: rotate(180deg);
}

.analysis-card-body {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
}

.analysis-card.expanded .analysis-card-body {
    max-height: 3000px;
    padding: 20px;
}

/* Question Image */
.analysis-question-img {
    text-align: center;
    margin-bottom: 16px;
}

.analysis-question-img img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.analysis-question-img-label {
    display: block;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 6px;
}

/* Answer Options Preview */
.analysis-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.analysis-option {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    transition: border-color 0.2s;
}

.analysis-option.correct {
    border-color: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.analysis-option img {
    width: 100%;
    height: auto;
    display: block;
}

.analysis-option-label {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
}

.analysis-option.correct .analysis-option-label {
    background: #22c55e;
}

/* Analysis Text */
.analysis-text {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 18px;
    font-size: 0.92rem;
    line-height: 1.8;
    color: #334155;
    white-space: pre-wrap;
    word-break: break-word;
}

.analysis-text-title {
    font-weight: 700;
    color: #f97316;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
}

/* Footer */
.analysis-footer {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 32px 16px 48px;
}

/* Expand/Collapse All Button */
.analysis-toolbar {
    display: flex;
    justify-content: flex-end;
    padding: 0 8px 16px;
}

.analysis-toolbar-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 0.85rem;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.analysis-toolbar-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* User Answer Status */
.analysis-card.status-correct { border-left: 4px solid #22c55e; }
.analysis-card.status-wrong { border-left: 4px solid #ef4444; }
.analysis-card.status-skip { border-left: 4px solid #94a3b8; }

.analysis-card-status {
    font-size: 0.78rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
}
.analysis-card-status.status-correct { background: #dcfce7; color: #16a34a; }
.analysis-card-status.status-wrong { background: #fee2e2; color: #dc2626; }
.analysis-card-status.status-skip { background: #f1f5f9; color: #64748b; }

.analysis-card-user-ans {
    font-size: 0.8rem;
    color: #ef4444;
    font-weight: 600;
}

.analysis-option.wrong {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}
.analysis-option.wrong .analysis-option-label {
    background: #ef4444;
}

/* Stats bar */
.analysis-stats {
    display: flex;
    gap: 12px;
    align-items: center;
    flex: 1;
}
.analysis-stats span {
    font-size: 0.85rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
}
.stat-correct { background: #dcfce7; color: #16a34a; }
.stat-wrong { background: #fee2e2; color: #dc2626; }
.stat-skip { background: #f1f5f9; color: #64748b; }

/* Responsive */
@media (max-width: 600px) {
    .analysis-header {
        padding: 24px 12px 16px;
    }

    .analysis-title {
        font-size: 1.2rem;
    }

    .analysis-card-body {
        padding: 0 14px;
    }

    .analysis-card.expanded .analysis-card-body {
        padding: 14px;
    }

    .analysis-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .analysis-lock {
        padding: 40px 16px;
    }

    .analysis-footer {
        flex-direction: column;
        align-items: center;
    }
}
