@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.quiz-option {
    background: rgba(30, 41, 59, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.125rem 1.25rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.875rem;
    position: relative;
    overflow: hidden;
}

.quiz-option:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.quiz-option.selected {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.3);
}

.quiz-option .icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}

.quiz-option .text {
    flex: 1;
    text-align: left;
    font-size: 0.9375rem;
    font-weight: 500;
    color: white;
}

.quiz-option .checkmark {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
}

.quiz-option.selected .checkmark {
    display: flex;
}

#continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

#back-btn:hover {
    background: rgba(100, 116, 139, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

@media (max-width: 1024px) {

    #quiz-container,
    #loading-container,
    #results-container {
        max-width: 750px !important;
    }

    #options-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    #quiz-container {
        padding: 1.5rem 1rem !important;
    }

    #options-container {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem;
    }

    .quiz-option {
        padding: 0.75rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
        justify-content: center;
        min-height: 80px;
    }

    .quiz-option .text {
        font-size: 0.8rem;
        text-align: center;
        line-height: 1.3;
    }

    .quiz-option .checkmark {
        top: 0.5rem;
        right: 0.5rem;
        width: 20px;
        height: 20px;
    }

    .quiz-option .checkmark .material-icons {
        font-size: 14px !important;
    }
}

.personality-card-link:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12) !important;
}

.personality-card-link a:hover {
    background: #0F172A !important;
}

@media (max-width: 1024px) {
    #options-container {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    #options-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .option-card {
        min-height: 140px !important;
        padding: 1.5rem 1rem !important;
    }
}

/* Carousel Styles */
#personalities-carousel {
    display: flex;
    overflow-x: auto;
    gap: 2rem;
    padding: 2rem 1rem;
    /* Padding for hover effect and scroll snapping */
    -ms-overflow-style: none;
    scrollbar-width: none;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
}

#personalities-carousel::-webkit-scrollbar {
    display: none;
}

.personality-slide {
    flex: 0 0 360px;
    scroll-snap-align: center;
}

@media (max-width: 768px) {
    .personality-slide {
        flex: 0 0 300px;
        scroll-snap-align: start;
    }

    #personalities-carousel {
        padding: 2rem 1.5rem;
        /* More horizontal padding for mobile peek */
        gap: 1rem;
    }
}

.carousel-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid #E2E8F0;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #64748B;
}

.carousel-btn:hover {
    background: #F8FAFC;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    color: #0F172A;
}

.carousel-btn:active {
    transform: translateY(0);
}

/* REFACTORED INLINE STYLES */

.personality-hero-section {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
    padding: 4rem 0;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    border-radius: 0 0 40px 40px;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
    margin-top: -1rem;
    /* Fix gap on mobile */
}

@media (min-width: 1024px) {
    .personality-hero-section {
        margin-top: -2rem;
        /* Fix gap on desktop */
    }
}

.hero-blob-top {
    position: absolute;
    top: -100px;
    right: -100px;
    width: 300px;
    height: 300px;
    background: rgba(124, 58, 237, 0.1);
    border-radius: 50%;
    filter: blur(80px);
}

.hero-blob-bottom {
    position: absolute;
    bottom: -100px;
    left: -100px;
    width: 300px;
    height: 300px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 50%;
    filter: blur(80px);
}

.hero-content-wrapper {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.5rem 1rem;
    border-radius: 999px;
    margin-bottom: 1.5rem;
    /* backdrop-filter removed for performance */
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-badge-icon {
    font-size: 1.1rem;
}

.hero-badge-text {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.hero-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: white;
}

.hero-title-highlight {
    background: linear-gradient(135deg, #A78BFA 0%, #C084FC 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.quiz-subtitle {
    font-size: 1.125rem;
    color: #94A3B8;
    max-width: 600px;
    margin: 0 auto 3rem;
}

.quiz-container-box {
    max-width: 950px;
    margin: 0 auto;
    background: rgba(30, 41, 59, 0.95);
    /* backdrop-filter removed for performance */
    border-radius: 20px;
    padding: 2.5rem 3rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.progress-header {
    margin-bottom: 1.5rem;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.progress-text {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #94A3B8;
}

.progress-bar-bg {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #3B82F6 0%, #8B5CF6 100%);
    border-radius: 999px;
    transition: width 0.5s ease;
}

.quiz-question-text {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: white;
    line-height: 1.3;
}

.quiz-question-subtitle {
    font-size: 0.9rem;
    color: #94A3B8;
    margin-bottom: 1.75rem;
}

.quiz-options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.875rem;
    margin-bottom: 1.75rem;
}

.quiz-nav-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.quiz-back-btn {
    display: none;
    padding: 0.875rem 1.5rem;
    background: rgba(100, 116, 139, 0.3);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.quiz-continue-btn {
    display: none;
    padding: 0.875rem 2rem;
    background: white;
    color: #1E293B;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-size: 1rem;
}

.quiz-continue-btn:disabled {
    background: #E2E8F0;
    color: #94A3B8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    opacity: 0.8;
}

.loading-container-box {
    display: none;
    max-width: 950px;
    margin: 0 auto;
    background: rgba(30, 41, 59, 0.95);
    /* backdrop-filter removed for performance */
    border-radius: 20px;
    padding: 4rem 3rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.loading-spinner {
    margin: 0 auto 2rem;
    width: 80px;
    height: 80px;
    border: 4px solid rgba(139, 92, 246, 0.2);
    border-top: 4px solid #8B5CF6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: white;
}

.loading-subtitle {
    font-size: 1rem;
    color: #94A3B8;
}

.results-container-box {
    display: none;
    max-width: 950px;
    margin: 0 auto;
    background: rgba(30, 41, 59, 0.95);
    /* backdrop-filter removed for performance */
    border-radius: 20px;
    padding: 3.5rem 3rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.result-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #94A3B8;
    margin-bottom: 2rem;
}

.result-avatar-wrapper {
    margin: 0 auto 2rem;
    width: 160px;
    height: 160px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 12px rgba(168, 85, 247, 0.2), 0 0 60px rgba(168, 85, 247, 0.4);
    position: relative;
}

.result-avatar-img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.result-avatar-glow {
    position: absolute;
    inset: -20px;
    background: radial-gradient(circle, rgba(168, 85, 247, 0.4) 0%, transparent 70%);
    filter: blur(20px);
    z-index: -1;
}

.result-title-name {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: white;
}

.result-description-text {
    font-size: 1.125rem;
    color: #CBD5E1;
    max-width: 600px;
    margin: 0 auto 3rem;
    line-height: 1.6;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.view-stack-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

.restart-quiz-btn {
    padding: 1rem 2rem;
    background: rgba(100, 116, 139, 0.3);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.assigned-personality-section {
    padding: 2rem 0 1rem;
}

.assigned-personality-card {
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid #E9D5FF;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.15);
}

.assigned-icon-box {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 8px 16px rgba(168, 85, 247, 0.3);
}

.assigned-icon-img {
    width: 65%;
    height: 65%;
    object-fit: contain;
}

.assigned-label {
    font-size: 0.75rem;
    color: #7C3AED;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.assigned-name {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0 0 0.5rem 0;
    color: #1F2937;
}

.assigned-description {
    color: #64748B;
    line-height: 1.6;
    margin: 0;
    font-size: 0.9375rem;
    max-width: 600px;
}

.assigned-view-btn {
    padding: 1rem 1.5rem;
    background: white;
    color: #7C3AED;
    border: 2px solid #A855F7;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.explore-personalities-section {
    background: #F9FAFB;
    padding: 4rem 0;
}

.explore-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 1rem;
}

.explore-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0F172A;
    margin: 0;
}

.carousel-controls {
    display: flex;
    gap: 0.75rem;
}

.carousel-container-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

/* Personality Slide Item Styles */
.personality-card-inner {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    border: 1px solid #E5E7EB;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
}

.personality-avatar-box {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.1), 0 0 30px rgba(59, 130, 246, 0.15), 0 8px 20px rgba(0, 0, 0, 0.08);
}

.personality-img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.personality-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    color: #1F2937;
}

.personality-desc {
    color: #64748B;
    line-height: 1.6;
    margin: 0 0 1.5rem 0;
    font-size: 0.9375rem;
    flex-grow: 1;
}

.tags-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.tag-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tag-travel {
    background: #EEF2FF;
    color: #6366F1;
}

.tag-freak {
    background: #F5F3FF;
    color: #A855F7;
}

.tag-save {
    background: #ECFDF5;
    color: #10B981;
}

.tag-luxury {
    background: #FDF2F8;
    color: #EC4899;
}

.tag-efficient {
    background: #F1F5F9;
    color: #475569;
}

.tag-rewards {
    background: #EEF2FF;
    color: #6366F1;
}

.card-stack-preview {
    position: relative;
    width: 100%;
    height: 140px;
    margin-bottom: 1.5rem;
}

.stack-card-base {
    position: absolute;
    bottom: 0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: white;
}

.stack-card-content {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.stack-card-issuer {
    font-size: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.stack-card-number {
    font-size: 0.6rem;
    letter-spacing: 0.05em;
}

/* Card Stack Specifics */
.stack-card-1 {
    left: 10%;
    width: 35%;
    height: 90px;
    transform: rotate(-8deg);
    z-index: 1;
}

.stack-card-2 {
    bottom: 10px;
    left: 25%;
    width: 35%;
    height: 90px;
    transform: rotate(-2deg);
    z-index: 2;
}

.stack-card-3 {
    bottom: 20px;
    left: 40%;
    width: 35%;
    height: 90px;
    transform: rotate(4deg);
    z-index: 3;
}

/* Stack Background Gradients */
.bg-grad-freak {
    background: linear-gradient(135deg, #8B9BA7 0%, #6B7B88 100%);
}

.bg-grad-jetsetter-blue {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
}

.bg-grad-jetsetter-dark {
    background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
}

.bg-grad-jetsetter-grey {
    background: linear-gradient(135deg, #8B9BA7 0%, #6B7B88 100%);
}

.bg-grad-hunter {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.bg-grad-hunter-teal {
    background: linear-gradient(135deg, #14B8A6 0%, #0D9488 100%);
}

.bg-grad-hunter-cyan {
    background: linear-gradient(135deg, #06B6D4 0%, #0891B2 100%);
}

.bg-grad-indigo {
    background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
}

.bg-grad-purple {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
}

.bg-grad-pink {
    background: linear-gradient(135deg, #EC4899 0%, #DB2777 100%);
}

.view-strategy-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    margin-top: auto;
    background: #1E293B;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.empty-personalities-state {
    text-align: center;
    padding: 4rem 2rem;
    width: 100%;
}

.empty-personalities-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    opacity: 0.3;
}