/* Make sure canvas doesn't grow out of control */
#results-chart {
    max-height: 360px !important;
    width: 100% !important;
}/* 
======================
CHARACTER QUIZ STYLES
======================
*/

/* 
======================
QUIZ HERO SECTION
======================
*/
.quiz-hero {
    background-position: center;
    height: 60vh;
}

.quiz-hero .hero-background {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), url('/assets/images/cc-bg.png');
    opacity: 1 !important;
    background-size: cover;
    background-position: center;
}

.quiz-hero .magical-overlay {
    background: 
        radial-gradient(circle at 30% 70%, rgba(127, 14, 189, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 70% 30%, rgba(195, 10, 61, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(127, 14, 189, 0.3) 0%, transparent 70%);
}

/* 
======================
QUIZ CONTAINER
======================
*/
.quiz-container {
    max-width: 900px;
    margin: 0 auto;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(127, 14, 189, 0.1);
    min-height: 500px;
}

.quiz-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient-purple);
    z-index: 1;
}

/* 
======================
QUIZ INTRO
======================
*/
.quiz-intro {
    padding: 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.character-silhouettes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
}

.silhouette {
    width: 100px;
    height: 100px;
    background-color: rgba(127, 14, 189, 0.1);
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.silhouette img {
    max-width: 80%;
    max-height: 80%;
    opacity: 0.6;
    filter: contrast(0%) brightness(0.5);
    transition: all 0.3s ease;
}

.silhouette:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(127, 14, 189, 0.2);
}

.silhouette:hover img {
    opacity: 0.8;
    filter: contrast(0%) brightness(0.7);
}

.silhouette::after {
    content: '?';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: rgba(127, 14, 189, 0.3);
    font-weight: bold;
    opacity: 0.8;
    pointer-events: none;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

#start-quiz {
    margin-top: 20px;
}

/* 
======================
QUIZ QUESTIONS
======================
*/
.quiz-questions {
    padding: 30px;
    display: none;
}

.quiz-progress {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: rgba(127, 14, 189, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-purple);
    width: 0;
    transition: width 0.5s ease;
}

.progress-text {
    text-align: center;
    font-size: 0.9rem;
    color: var(--primary-purple);
    font-weight: 600;
}

.question-container {
    min-height: 300px;
    margin-bottom: 30px;
}

.question {
    display: none;
    animation: fadeIn 0.5s ease;
}

.question.active {
    display: block;
}

.question-text {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: var(--primary-purple-dark);
    line-height: 1.5;
    text-align: center;
    padding: 0 20px;
}

.answers {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.answer-option {
    background-color: white;
    border: 2px solid rgba(127, 14, 189, 0.2);
    border-radius: 10px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.answer-option:hover {
    border-color: var(--primary-purple);
    background-color: rgba(127, 14, 189, 0.05);
    transform: translateY(-2px);
}

.answer-option.selected {
    border-color: var(--primary-purple);
    background-color: rgba(127, 14, 189, 0.1);
    box-shadow: 0 5px 15px rgba(127, 14, 189, 0.2);
}

.answer-option.selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-purple);
}

.answer-option:first-child {
    border-color: rgba(11, 42, 169, 0.3);
}

.answer-option:first-child:hover, 
.answer-option:first-child.selected {
    border-color: var(--primary-blue);
    background-color: rgba(11, 42, 169, 0.05);
}

.answer-option:first-child.selected::after {
    color: var(--primary-blue);
}

.answer-option:nth-child(2) {
    border-color: rgba(127, 14, 189, 0.3);
}

.answer-option:nth-child(2):hover, 
.answer-option:nth-child(2).selected {
    border-color: var(--primary-purple);
    background-color: rgba(127, 14, 189, 0.05);
}

.answer-option:nth-child(3) {
    border-color: rgba(195, 10, 61, 0.3);
}

.answer-option:nth-child(3):hover, 
.answer-option:nth-child(3).selected {
    border-color: var(--primary-red);
    background-color: rgba(195, 10, 61, 0.05);
}

.answer-option:nth-child(3).selected::after {
    color: var(--primary-red);
}

.answer-option:nth-child(4) {
    border-color: rgba(11, 42, 169, 0.3);
}

.answer-option:nth-child(4):hover, 
.answer-option:nth-child(4).selected {
    border-color: var(--primary-blue);
    background-color: rgba(11, 42, 169, 0.05);
}

.answer-option:nth-child(4).selected::after {
    color: var(--primary-blue);
}

.answer-option:nth-child(5) {
    border-color: rgba(127, 14, 189, 0.3);
}

.answer-option:nth-child(5):hover, 
.answer-option:nth-child(5).selected {
    border-color: var(--primary-purple);
    background-color: rgba(127, 14, 189, 0.05);
}

.answer-option:nth-child(6) {
    border-color: rgba(195, 10, 61, 0.3);
}

.answer-option:nth-child(6):hover, 
.answer-option:nth-child(6).selected {
    border-color: var(--primary-red);
    background-color: rgba(195, 10, 61, 0.05);
}

.answer-option:nth-child(6).selected::after {
    color: var(--primary-red);
}

.answer-text {
    line-height: 1.4;
    font-weight: 500;
}

.quiz-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

/* 
======================
QUIZ RESULTS
======================
*/
.quiz-results {
    padding: 40px;
    display: none;
    text-align: center;
}

.results-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-top: 30px;
}

.primary-result {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.result-card {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(127, 14, 189, 0.2);
    overflow: hidden;
    width: 100%;
    max-width: 400px;
    animation: fadeInUp 0.8s ease;
    border: 2px solid rgba(127, 14, 189, 0.3);
    height: 100%;
}

.result-header {
    background: var(--gradient-purple);
    padding: 20px;
    color: white;
    text-align: center;
    position: relative;
}

.result-header h3 {
    margin: 0;
    font-size: 1.8rem;
    color: white;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.match-percentage {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.1rem;
}

.character-image {
    padding: 20px;
    display: flex;
    justify-content: center;
    background-color: rgba(127, 14, 189, 0.05);
}

.character-image img {
    max-width: 200px;
    animation: bounce 1s ease infinite alternate;
}

@keyframes bounce {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-10px);
    }
}

.character-traits {
    padding: 20px;
    text-align: left;
    border-bottom: 1px solid rgba(127, 14, 189, 0.1);
}

.character-traits h4 {
    margin-top: 0;
    color: var(--primary-purple);
}

.character-traits ul {
    margin: 0;
    padding-left: 20px;
}

.character-traits li {
    margin-bottom: 8px;
}

.character-description {
    padding: 20px;
    text-align: left;
    line-height: 1.6;
}

.additional-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
}

.radar-chart-container {
    background-color: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    animation: fadeInRight 0.8s ease;
    height: 450px; /* Fixed height */
    max-height: 450px; /* Maximum height */
    overflow: hidden; /* Prevent overflow */
    border: 1px solid rgba(127, 14, 189, 0.1);
    margin-bottom: 20px;
    position: relative; /* For proper canvas positioning */
}

.radar-chart-container h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--primary-purple);
}

.result-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: fadeInUp 1s ease;
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.btn-share {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-share:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.twitter {
    background-color: #1DA1F2;
}

.instagram {
    background: linear-gradient(45deg, #405DE6, #5851DB, #833AB4, #C13584, #E1306C, #FD1D1D);
}

.facebook {
    background-color: #4267B2;
}

.discord {
    background-color: #7289DA;
}

#retake-quiz {
    animation: fadeInUp 1.2s ease;
}

/* Animation keyframes */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

/* 
======================
RESULT CARD STYLING (for download)
======================
*/
.result-card-download {
    background-color: white;
    width: 1200px;
    height: 630px;
    position: relative;
    overflow: hidden;
}

.result-card-download::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(127, 14, 189, 0.2), rgba(11, 42, 169, 0.2));
    z-index: 1;
}

.card-header {
    background: var(--gradient-purple);
    padding: 30px;
    text-align: center;
    color: white;
}

.card-content {
    display: flex;
    padding: 40px;
}

.card-character {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card-character img {
    max-width: 250px;
    margin-bottom: 20px;
}

.card-info {
    flex: 2;
    padding-left: 40px;
}

.card-qr {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 120px;
    height: 120px;
    background-color: white;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.card-logo {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 120px;
    height: auto;
}

/* 
======================
RESPONSIVE STYLES
======================
*/
@media (max-width: 992px) {
    .results-container {
        grid-template-columns: 1fr;
    }
    
    .result-card {
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .quiz-container {
        border-radius: 0;
        box-shadow: none;
    }
    
    .quiz-intro,
    .quiz-questions,
    .quiz-results {
        padding: 20px;
    }
    
    .character-silhouettes {
        gap: 10px;
    }
    
    .silhouette {
        width: 80px;
        height: 80px;
    }
    
    .question-text {
        font-size: 1.1rem;
    }
    
    .answer-option {
        padding: 12px 15px;
    }
}

@media (max-width: 480px) {
    .quiz-navigation {
        flex-direction: column-reverse;
    }
    
    .result-actions {
        flex-direction: column;
        gap: 15px;
    }
    
    .character-image img {
        max-width: 150px;
    }
}