/* Assessment Page Styles */

/* Custom scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--color-bg); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: var(--color-bg-lighter); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--color-border); }
* { scrollbar-width: thin; scrollbar-color: var(--color-bg-lighter) var(--color-bg); }

/* Assessment Layout */
.assessment-layout {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    min-height: calc(100vh - 80px);
    gap: 0;
}

/* Sidebar */
.sidebar {
    background: var(--color-bg-light);
    border-right: 1px solid var(--color-border);
    padding: 1.5rem;
    height: calc(100vh - 80px);
    overflow-y: auto;
    position: sticky;
    top: 80px;
}

.sidebar-sticky {
    position: sticky;
    top: 2rem;
}

.assessment-info h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.assessment-info .domain-label {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.assessment-info p {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

/* Maturity Levels Legend */
.maturity-levels-legend {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--color-border);
}

.maturity-levels-legend h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.level-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    font-size: 0.8rem;
}

.level-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.level-dot.level-1 { background: #f87171; }
.level-dot.level-2 { background: #fbbf24; }
.level-dot.level-3 { background: #34d399; }

.level-legend-name {
    font-weight: 600;
    color: var(--color-text);
}

/* Progress Section */
.progress-section {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--color-border);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
}

.progress-percentage { color: var(--color-primary); }

.progress-bar {
    height: 8px;
    background: var(--color-bg-lighter);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

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

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

/* Results Section */
.results-section {
    opacity: 1;
    transition: opacity 0.3s;
}

.results-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.maturity-score {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    border: 3px solid var(--color-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
}

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

/* Area Scores */
.area-scores {
    margin-bottom: 1rem;
}

.area-score-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.75rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    margin-bottom: 0.375rem;
    font-size: 0.85rem;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.area-score-link:hover {
    background: var(--color-bg-lighter);
    border-color: var(--color-primary);
}

.area-score-link.active {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--color-primary);
}

.area-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    flex: 1;
    min-width: 0;
}

.area-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.area-progress .complete-check {
    color: var(--color-success);
    font-weight: 700;
}

.area-value {
    font-weight: 700;
    color: var(--color-primary);
    font-size: 1rem;
    flex-shrink: 0;
    margin-left: 0.5rem;
}

/* Chart Container */
.chart-container {
    position: relative;
    margin: 1rem 0;
    background: var(--color-bg);
    border-radius: 0.75rem;
    padding: 0.75rem;
    min-height: 180px;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 0.625rem 1rem;
    border-radius: 0.5rem;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.btn-secondary {
    background: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-bg-lighter);
}

.export-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.export-buttons .btn {
    flex: 1;
    margin-bottom: 0;
}

.btn-reset {
    background: var(--color-bg);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-reset:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
}

/* Main Content */
.main-content {
    padding: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.assessment-header {
    margin-bottom: 2rem;
}

.assessment-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.assessment-header .assessment-description {
    font-size: 1rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 0;
}

/* Area Sections */
.area-section {
    margin-bottom: 2.5rem;
}

.area-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-border);
}

.area-abbreviation {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
    background: var(--color-primary);
}

.area-title {
    flex: 1;
}

.area-title h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.area-description {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

.area-progress-badge {
    background: var(--color-bg-light);
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    flex-shrink: 0;
}

/* Question Cards */
.questions-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.question-card {
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    padding: 1.25rem;
    transition: all 0.2s;
}

.question-card.answered {
    border-color: var(--color-primary);
    background: rgba(99, 102, 241, 0.03);
    position: relative;
}

.question-card.answered::after {
    content: '\2713';
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background: var(--color-success);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: checkPop 0.3s ease;
}

@keyframes checkPop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.question-card.highlight {
    animation: highlightPulse 3s ease-out;
    border-color: #ef4444 !important;
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.7);
        background: rgba(239, 68, 68, 0.15);
    }
    70% {
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.4);
        background: rgba(239, 68, 68, 0.1);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
        background: transparent;
    }
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.question-code {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--color-text-muted);
    background: var(--color-bg);
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
}

.question-text {
    font-size: 0.95rem;
    color: var(--color-text);
    line-height: 1.5;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.question-hint {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin-bottom: 1rem;
    font-style: italic;
    padding-left: 0.75rem;
    border-left: 2px solid var(--color-border);
}

/* Answer Options — stacked radio-style cards */
.answer-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.answer-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
    font-family: inherit;
    font-size: inherit;
}

.answer-card:hover {
    border-color: var(--color-primary);
    background: rgba(99, 102, 241, 0.05);
}

.answer-card.selected {
    border-color: var(--color-primary);
    background: rgba(99, 102, 241, 0.1);
}

.answer-card.selected.level-1 {
    border-color: #f87171;
    background: rgba(248, 113, 113, 0.1);
}

.answer-card.selected.level-2 {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}

.answer-card.selected.level-3 {
    border-color: #34d399;
    background: rgba(52, 211, 153, 0.1);
}

.answer-radio {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    flex-shrink: 0;
    margin-top: 0.1rem;
    transition: all 0.2s;
    position: relative;
}

.answer-card.selected .answer-radio {
    border-color: var(--color-primary);
}

.answer-card.selected.level-1 .answer-radio { border-color: #f87171; }
.answer-card.selected.level-2 .answer-radio { border-color: #fbbf24; }
.answer-card.selected.level-3 .answer-radio { border-color: #34d399; }

.answer-card.selected .answer-radio::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-primary);
}

.answer-card.selected.level-1 .answer-radio::after { background: #f87171; }
.answer-card.selected.level-2 .answer-radio::after { background: #fbbf24; }
.answer-card.selected.level-3 .answer-radio::after { background: #34d399; }

.answer-content {
    flex: 1;
    min-width: 0;
}

.answer-level {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.2rem;
    display: block;
}

.answer-card.level-1 .answer-level { color: #f87171; }
.answer-card.level-2 .answer-level { color: #fbbf24; }
.answer-card.level-3 .answer-level { color: #34d399; }

.answer-text {
    font-size: 0.825rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

/* Recommendations Sidebar */
.recommendations-sidebar {
    background: var(--color-bg-light);
    border-left: 1px solid var(--color-border);
    padding: 1.5rem;
    height: calc(100vh - 80px);
    overflow-y: auto;
    position: sticky;
    top: 80px;
}

.recommendations-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.recommendations-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.recommendations-body {
    font-size: 0.875rem;
}

.empty-state {
    text-align: center;
    color: var(--color-text-muted);
    padding: 2rem 1rem;
}

.congratulations {
    text-align: center;
    padding: 2rem 1rem;
}

.congrats-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--color-success);
    color: white;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.congratulations h3 {
    color: var(--color-success);
    margin-bottom: 0.5rem;
}

.congratulations p {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
}

/* Next Best Actions */
.next-actions {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--color-border);
}

.next-actions-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.2rem;
}

.next-actions-subtitle {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.next-action-card {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.next-action-card:hover {
    border-color: var(--color-primary);
    background: rgba(99, 102, 241, 0.05);
}

.next-action-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
}

.next-action-area {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

.next-action-target {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.125rem 0.4rem;
    border-radius: 0.25rem;
    white-space: nowrap;
}

.next-action-target.level-2 {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.next-action-target.level-3 {
    background: rgba(52, 211, 153, 0.2);
    color: #34d399;
}

.next-action-question {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text);
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.next-action-target-text {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
    line-height: 1.4;
    padding: 0.5rem;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 0.375rem;
    border-left: 2px solid var(--color-primary);
}

.target-label {
    font-weight: 700;
    color: var(--color-primary);
}

.recommendation-group {
    margin-bottom: 1.25rem;
}

.rec-group-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    display: inline-block;
}

.rec-group-title.level-1 {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

.rec-group-title.level-2 {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.recommendation-card {
    background: var(--color-bg);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--color-primary);
    transition: all 0.2s;
    cursor: pointer;
}

.recommendation-card:hover {
    background: var(--color-bg-lighter);
    transform: translateX(4px);
}

.recommendation-card.priority-1 {
    border-left-color: #f87171;
}

.recommendation-card.priority-2 {
    border-left-color: #fbbf24;
}

.rec-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
}

.rec-area {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.rec-code {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--color-text-muted);
    background: var(--color-bg-light);
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}

.rec-question {
    font-size: 0.8rem;
    color: var(--color-text);
    line-height: 1.4;
    margin-bottom: 0.375rem;
}

.rec-footer {
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

/* Loading Skeleton */
.loading-skeleton {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    min-height: calc(100vh - 80px);
    gap: 0;
}

.skeleton-sidebar {
    background: var(--color-bg-light);
    padding: 1.5rem;
    border-right: 1px solid var(--color-border);
}

.skeleton-sidebar:last-child {
    border-right: none;
    border-left: 1px solid var(--color-border);
}

.skeleton-main {
    padding: 2rem;
}

.skeleton-line {
    background: var(--color-bg-lighter);
    border-radius: 6px;
    animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--color-bg-lighter);
    margin: 1rem auto;
    animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-card {
    height: 140px;
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: 1rem;
    margin-bottom: 1rem;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

@media (max-width: 1024px) {
    .loading-skeleton {
        grid-template-columns: 1fr;
    }
    .skeleton-sidebar {
        display: none;
    }
}

.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    color: var(--color-text-muted);
    text-align: center;
    gap: 1rem;
}

.error-state a {
    color: var(--color-primary);
    text-decoration: none;
}

.error-state a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 1400px) {
    .assessment-layout {
        grid-template-columns: 280px 1fr 280px;
    }
}

@media (max-width: 1200px) {
    .assessment-layout {
        grid-template-columns: 260px 1fr 260px;
    }
}

@media (max-width: 1024px) {
    .assessment-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        top: 0;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        order: 1;
    }

    .main-content {
        order: 2;
    }

    .recommendations-sidebar {
        position: relative;
        top: 0;
        height: auto;
        border-left: none;
        border-top: 1px solid var(--color-border);
        order: 3;
    }

    .sidebar-sticky {
        position: static;
    }

    .sidebar-sticky {
        max-width: 500px;
        margin-left: auto;
        margin-right: auto;
    }

    .chart-container {
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media print {
    .sidebar, .recommendations-sidebar, .header, .background-pattern {
        display: none !important;
    }

    .assessment-layout {
        grid-template-columns: 1fr !important;
        min-height: auto;
    }

    .main-content {
        padding: 0 !important;
    }

    .question-card {
        page-break-inside: avoid;
    }

    .area-section {
        page-break-inside: avoid;
    }

    .answer-card.selected {
        border-width: 2px;
    }
}

@media (max-width: 768px) {
    .area-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-content {
        padding: 1rem;
    }

    .assessment-header h1 {
        font-size: 1.75rem;
    }
}
