/* IQ Results Enhanced Styling - PuzzleDepot.com */
/* Supplements iq-game.css for enhanced results display */

/* ========================================
   IQ SCORE DISPLAY
   ======================================== */

.iq-score-container {
    text-align: center;
    padding: 2rem 1rem;
    position: relative;
}

.iq-score-main {
    font-size: 6rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffdd57 0%, #ff9f43 50%, #ffdd57 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    line-height: 1;
    margin-bottom: 0.5rem;
    animation: scoreReveal 2s ease-out;
}

@keyframes scoreReveal {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.iq-score-label {
    font-size: 1.25rem;
    color: #b5b5b5;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 1rem;
}

.iq-classification {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    animation: fadeInUp 0.5s ease-out 0.5s both;
}

.iq-classification-bar {
    width: 200px;
    height: 4px;
    border-radius: 2px;
    margin: 0 auto 1rem;
    animation: barExpand 0.5s ease-out 0.7s both;
}

@keyframes barExpand {
    from {
        width: 0;
    }
    to {
        width: 200px;
    }
}

.iq-percentile {
    font-size: 1.25rem;
    color: #00d1b2;
    font-weight: 600;
    animation: fadeInUp 0.5s ease-out 0.9s both;
}

.iq-rarity {
    font-size: 1rem;
    color: #7957d5;
    margin-top: 0.5rem;
    animation: fadeInUp 0.5s ease-out 1.1s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   BELL CURVE VISUALIZATION
   ======================================== */

.bell-curve-container {
    background: rgba(26, 27, 38, 0.8);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bell-curve-title {
    text-align: center;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.bell-curve-wrapper {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
}

.bell-curve-svg {
    width: 100%;
    height: auto;
    display: block;
}

.bell-curve-label {
    font-size: 0.9rem;
}

/* Bell curve regions */
.bell-curve-region {
    opacity: 0.3;
}

.bell-curve-region.below-average {
    fill: #f14668;
}

.bell-curve-region.average {
    fill: #7957d5;
}

.bell-curve-region.above-average {
    fill: #48c774;
}

/* User marker pulse animation */
.user-marker {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        r: 8;
        opacity: 1;
    }
    50% {
        r: 12;
        opacity: 0.8;
    }
}

/* ========================================
   GLOBAL COMPARISON DISPLAY
   ======================================== */

.global-comparison {
    background: linear-gradient(135deg, rgba(50, 115, 220, 0.1) 0%, rgba(121, 87, 213, 0.1) 100%);
    border: 1px solid rgba(50, 115, 220, 0.3);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.global-comparison .title {
    color: #ffffff;
}

.global-comparison .heading {
    color: #b5b5b5;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.global-comparison .columns {
    margin-top: 1rem;
}

.global-comparison .column {
    padding: 0.5rem;
}

.comparison-stat {
    text-align: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin: 0.5rem 0;
}

.comparison-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #ffdd57;
}

.comparison-stat-label {
    font-size: 0.875rem;
    color: #b5b5b5;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Distribution bar chart */
.distribution-chart {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 100px;
    padding: 1rem 0;
    gap: 4px;
}

.distribution-bar {
    flex: 1;
    background: linear-gradient(to top, #3273dc, #7957d5);
    border-radius: 4px 4px 0 0;
    position: relative;
    min-height: 4px;
    transition: all 0.3s ease;
}

.distribution-bar:hover {
    filter: brightness(1.2);
}

.distribution-bar.user-bucket {
    background: linear-gradient(to top, #ffdd57, #ff9f43);
    box-shadow: 0 0 10px rgba(255, 221, 87, 0.5);
}

.distribution-label {
    font-size: 0.7rem;
    color: #b5b5b5;
    text-align: center;
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

/* ========================================
   CATEGORY PERFORMANCE BREAKDOWN
   ======================================== */

.category-breakdown {
    margin: 2rem 0;
}

.category-breakdown-title {
    text-align: center;
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.category-performance {
    margin-bottom: 1rem;
}

.category-performance .is-flex {
    align-items: center;
}

.category-performance .progress {
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.category-performance .progress::-webkit-progress-bar {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.category-performance .progress::-webkit-progress-value {
    border-radius: 4px;
    background: var(--progress-color, #3273dc);
    transition: width 1s ease-out;
}

.category-performance .progress::-moz-progress-bar {
    border-radius: 4px;
    background: var(--progress-color, #3273dc);
}

/* Radial progress for category scores */
.radial-progress {
    width: 80px;
    height: 80px;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.radial-progress svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.radial-progress circle {
    fill: none;
    stroke-width: 6;
}

.radial-progress .bg {
    stroke: rgba(255, 255, 255, 0.1);
}

.radial-progress .progress-ring {
    stroke: var(--ring-color, #3273dc);
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease-out;
}

.radial-progress .value {
    position: absolute;
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
}

/* Category cards grid */
.category-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.category-card {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

.category-card .category-badge {
    margin-bottom: 0.75rem;
}

.category-card .score {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
}

.category-card .percentage {
    font-size: 0.875rem;
    color: #b5b5b5;
}

/* ========================================
   RESULTS SUMMARY STATS
   ======================================== */

.results-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

@media screen and (max-width: 768px) {
    .results-stats {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-card-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.stat-card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 0.25rem;
}

.stat-card-label {
    font-size: 0.875rem;
    color: #b5b5b5;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========================================
   SHARE CARD / CERTIFICATE
   ======================================== */

.share-card {
    background: linear-gradient(135deg, #1a1b26 0%, #2d2d44 100%);
    border: 2px solid #ffdd57;
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem auto;
    max-width: 500px;
    position: relative;
    overflow: hidden;
}

.share-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #48c774, #3273dc, #9b59b6, #ff6b6b, #f39c12);
}

.share-card-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.share-card-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffdd57;
}

.share-card-title {
    font-size: 1.5rem;
    color: #ffffff;
    margin-top: 0.5rem;
}

.share-card-score {
    text-align: center;
    padding: 1.5rem 0;
}

.share-card-iq {
    font-size: 4rem;
    font-weight: 800;
    color: #ffdd57;
}

.share-card-classification {
    font-size: 1.25rem;
    color: #00d1b2;
}

.share-card-details {
    display: flex;
    justify-content: space-around;
    padding: 1rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin: 1rem 0;
}

.share-card-detail {
    text-align: center;
}

.share-card-detail-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
}

.share-card-detail-label {
    font-size: 0.75rem;
    color: #b5b5b5;
    text-transform: uppercase;
}

.share-card-footer {
    text-align: center;
    font-size: 0.875rem;
    color: #7f7f7f;
}

/* ========================================
   REVIEW SCREEN STYLING
   ======================================== */

.review-question {
    background: rgba(26, 27, 38, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.review-question-image {
    max-width: 300px;
    border-radius: 8px;
    margin: 0 auto;
    display: block;
}

.review-answers {
    margin: 1rem 0;
}

.review-answer {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.review-answer.correct {
    border-color: #48c774;
    background: rgba(72, 199, 116, 0.15);
}

.review-answer.incorrect {
    border-color: #f14668;
    background: rgba(241, 70, 104, 0.15);
}

.review-answer.user-selected {
    font-weight: 600;
}

.explanation-box {
    background: rgba(50, 115, 220, 0.1);
    border-left: 4px solid #3273dc;
    border-radius: 0 8px 8px 0;
    padding: 1rem;
    margin-top: 1rem;
}

.explanation-box p {
    color: #e0e6f0;
}

/* ========================================
   NOTIFICATIONS
   ======================================== */

.iq-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
    max-width: 350px;
    animation: slideIn 0.3s ease-out;
}

.iq-notification.fade-out {
    animation: slideOut 0.3s ease-out forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* ========================================
   ACTION BUTTONS
   ======================================== */

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

.results-actions .button {
    min-width: 150px;
}

.button.is-share {
    background: linear-gradient(135deg, #3273dc, #7957d5);
    border: none;
    color: #ffffff;
}

.button.is-share:hover {
    filter: brightness(1.1);
}

.button.is-certificate {
    background: linear-gradient(135deg, #ffdd57, #ff9f43);
    border: none;
    color: #1a1b26;
}

.button.is-certificate:hover {
    filter: brightness(1.1);
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media screen and (max-width: 768px) {
    .iq-score-main {
        font-size: 4rem;
    }

    .iq-classification {
        font-size: 1.25rem;
    }

    .global-comparison .columns {
        flex-direction: column;
    }

    .category-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .share-card {
        padding: 1.5rem;
        margin: 1rem;
    }

    .share-card-iq {
        font-size: 3rem;
    }

    .share-card-details {
        flex-direction: column;
        gap: 0.75rem;
    }

    .results-actions {
        flex-direction: column;
    }

    .results-actions .button {
        width: 100%;
    }
}

/* ========================================
   DARK THEME COMPATIBILITY
   ======================================== */

.dark-theme .box {
    background: rgba(26, 27, 38, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-theme .title,
.dark-theme .subtitle {
    color: #ffffff;
}

.dark-theme .has-text-grey,
.dark-theme .has-text-grey-dark {
    color: #b5b5b5 !important;
}

/* ========================================
   LOADING STATE
   ======================================== */

.results-loading {
    text-align: center;
    padding: 3rem;
}

.results-loading .loader {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #ffdd57;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.results-loading-text {
    color: #b5b5b5;
    font-size: 1.1rem;
}

/* ========================================
   PRINT STYLES (for certificate)
   ======================================== */

@media print {
    body {
        background: #ffffff !important;
    }

    .share-card {
        border: 2px solid #333;
        box-shadow: none;
    }

    .share-card-score,
    .share-card-classification {
        color: #333 !important;
    }

    .no-print {
        display: none !important;
    }
}
