/* ========================================
   QuizMaster - Quiz Page Styles
   ======================================== */

/* Quiz Page Layout */
.quiz-page {
    min-height: calc(100vh - 80px);
    padding: 6rem 1.5rem 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-container {
    max-width: 700px;
    width: 100%;
}

/* Quiz Progress Header */
.quiz-progress-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.progress-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
}

.progress-bar {
    width: 120px;
    height: 6px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

/* ========================================
   Quiz Intro Card
   ======================================== */
.quiz-intro {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.quiz-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.quiz-badge svg {
    width: 16px;
    height: 16px;
}

.quiz-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-secondary);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.quiz-icon svg {
    width: 40px;
    height: 40px;
    color: var(--white);
}

.quiz-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.quiz-description {
    font-size: 1.0625rem;
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.quiz-meta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-500);
}

.meta-item svg {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.quiz-tags {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.tag {
    padding: 0.375rem 0.875rem;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-600);
}

.quiz-start-btn {
    margin-bottom: 1.5rem;
    /* Add bottom safe area for mobile to avoid anchor ads */
    margin-bottom: max(1.5rem, env(safe-area-inset-bottom, 20px));
}

.quiz-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--gray-400);
}

.quiz-note svg {
    width: 16px;
    height: 16px;
}

/* Related Quizzes */
.related-quizzes {
    margin-top: 3rem;
}

.related-quizzes .section-title {
    justify-content: center;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.related-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition);
}

.related-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.related-img {
    width: 48px;
    height: 48px;
    background: var(--gradient-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.related-img svg {
    width: 24px;
    height: 24px;
    color: var(--white);
}

.related-content h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.related-content span {
    font-size: 0.8125rem;
    color: var(--primary);
    font-weight: 500;
}

/* ========================================
   Question Page - Enhanced Design
   ======================================== */
.question-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 100px 1.5rem 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Animated background shapes */
.question-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
}

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

.quiz-container {
    max-width: 650px;
    width: 100%;
    position: relative;
    z-index: 1;
}

/* Progress indicator - Top */
.quiz-progress-top {
    margin-bottom: 2rem;
}

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

.progress-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.progress-percentage {
    font-size: 0.875rem;
    font-weight: 700;
    color: #FFD700;
}

.progress-track {
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 100px;
    overflow: hidden;
    position: relative;
}

.progress-track::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 100%;
    background: repeating-linear-gradient(
        90deg,
        transparent,
        transparent 10px,
        rgba(255,255,255,0.1) 10px,
        rgba(255,255,255,0.1) 20px
    );
}

.progress-fill-new {
    height: 100%;
    background: linear-gradient(90deg, #FFD700 0%, #FFA500 100%);
    border-radius: 100px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-fill-new::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Question Card - Enhanced */
.question-card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    padding: 2.5rem 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    animation: slideUp 0.6s ease-out;
}

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

/* Question badge - simple text only */
.question-badge-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.question-number-badge {
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 100px;
    font-size: 0.8125rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Question text */
.question-text {
    font-size: 1.625rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 2.5rem;
    line-height: 1.4;
    text-align: center;
}

/* Options list - Card Style (Reference Design) */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Ensure option items have full width and proper wrapping */
.option-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--white);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    -webkit-tap-highlight-color: transparent;
}

/* Bottom indicator bar - shows when selected */
.option-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: transparent;
    transition: background 0.25s ease;
}

/* Desktop hover state */
@media (hover: hover) {
    .option-item:hover {
        box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
        transform: translateY(-2px);
    }

    .option-item:hover::after {
        background: var(--primary);
    }
}

/* Selected State - Blue background with white text */
.option-item.selected {
    background: var(--primary);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
    transform: translateY(-2px);
}

.option-item.selected::after {
    background: var(--primary-dark);
}

/* Hide the original radio input */
.option-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Option letter badge */
.option-letter {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: var(--gray-100);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary);
    transition: all 0.25s ease;
}

.option-item.selected .option-letter {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

/* Option text */
.option-text {
    flex: 1;
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-800);
    line-height: 1.5;
    transition: color 0.25s ease;
}

.option-item.selected .option-text {
    color: var(--white);
}

/* Radio indicator circle */
.option-radio {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    transition: all 0.25s ease;
    position: relative;
}

.option-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.option-item.selected .option-radio {
    border-color: var(--white);
    background: var(--white);
}

.option-item.selected .option-radio::after {
    transform: translate(-50%, -50%) scale(1);
    background: var(--primary);
}

/* Hide Next Question button - now using auto-navigate */
.question-actions {
    display: none;
}

/* Mobile responsive */
@media (max-width: 640px) {
    .quiz-page:not(.question-page):not(.result-page) {
        padding: 100px 1rem 120px;
    }

    .quiz-intro {
        padding: 2rem 1.5rem 2.5rem;
    }

    .quiz-start-btn {
        width: 100%;
        margin-bottom: 2rem;
    }

    .question-page {
        padding: 90px 1rem 80px;
    }

    .question-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }

    .question-text {
        font-size: 1.375rem;
        margin-bottom: 1.5rem;
    }

    .options-list {
        gap: 0.875rem;
        margin-bottom: 1rem;
    }

    .option-item {
        padding: 1rem 1.25rem;
        gap: 0.875rem;
        border-radius: 10px;
    }

    .option-letter {
        width: 32px;
        height: 32px;
        min-width: 32px;
        font-size: 0.8125rem;
        border-radius: 8px;
    }

    .option-text {
        font-size: 0.9375rem;
        word-wrap: break-word;
        flex: 1;
    }

    .option-radio {
        width: 22px;
        height: 22px;
        min-width: 22px;
    }

    .option-radio::after {
        width: 8px;
        height: 8px;
    }

    /* Bottom indicator bar on mobile */
    .option-item::after {
        height: 3px;
    }
}

/* ========================================
   Result Page
   ======================================== */
.result-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 8rem 1.5rem 4rem;
}

.result-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-xl);
}

.result-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    border-radius: var(--radius-full);
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.result-badge svg {
    width: 16px;
    height: 16px;
}

.result-icon {
    width: 100px;
    height: 100px;
    background: var(--gradient-primary);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.result-icon svg {
    width: 50px;
    height: 50px;
    color: var(--white);
}

.result-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 1.5rem;
}

.result-score {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.score-circle {
    position: relative;
    width: 140px;
    height: 140px;
}

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

.score-bg {
    fill: none;
    stroke: var(--gray-200);
    stroke-width: 10;
}

.score-fill {
    fill: none;
    stroke: var(--gradient-primary);
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.score-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.score-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.score-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
}

.result-description {
    font-size: 1.0625rem;
    color: var(--gray-600);
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.result-traits,
.result-tips {
    text-align: left;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
}

.result-traits h3,
.result-tips h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.result-traits ul {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.result-traits li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
    color: var(--gray-700);
}

.result-traits li svg {
    width: 20px;
    height: 20px;
    color: #10B981;
    flex-shrink: 0;
}

.result-traits li svg:last-child {
    color: #EF4444;
}

.result-tips ol {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-left: 1.25rem;
}

.result-tips li {
    font-size: 0.9375rem;
    color: var(--gray-700);
    line-height: 1.5;
}

.result-share {
    margin-bottom: 2rem;
}

.result-share p {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 0.75rem;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.share-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
}

.share-btn svg {
    width: 20px;
    height: 20px;
}

.share-btn.facebook {
    background: #1877F2;
    color: var(--white);
}

.share-btn.facebook:hover {
    background: #166FE5;
}

.share-btn.twitter {
    background: #1DA1F2;
    color: var(--white);
}

.share-btn.twitter:hover {
    background: #1A91DA;
}

.share-btn.copy {
    background: var(--gray-200);
    color: var(--gray-600);
}

.share-btn.copy:hover {
    background: var(--gray-300);
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ========================================
   Responsive Styles
   ======================================== */
@media (min-width: 640px) {
    .quiz-intro,
    .question-card,
    .result-card {
        padding: 3.5rem 3rem;
    }

    .quiz-title {
        font-size: 2.25rem;
    }

    .question-text {
        font-size: 1.75rem;
    }

    .result-title {
        font-size: 2.25rem;
    }

    .result-actions {
        flex-direction: row;
        justify-content: center;
    }
}

@media (min-width: 768px) {
    .quiz-page {
        padding: 8rem 2rem 4rem;
    }

    .quiz-intro,
    .question-card,
    .result-card {
        padding: 4rem;
    }

    .options-list {
        gap: 1.25rem;
    }

    .option-item {
        padding: 1.5rem 2rem;
    }
}

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

.quiz-intro,
.question-card,
.result-card {
    animation: fadeInUp 0.6s ease-out forwards;
}

.result-card .result-badge {
    animation: fadeInUp 0.4s ease-out 0.1s forwards;
    opacity: 0;
}

.result-card .result-icon {
    animation: fadeInUp 0.4s ease-out 0.2s forwards;
    opacity: 0;
}
