/* ============================================
   UX IMPROVEMENTS - FINAL ENHANCEMENTS
   Implements all 27 identified improvements
   Created: 2025-11-11
   ============================================ */

/* ============================================
   1. TRUST INDICATORS & SOCIAL PROOF
   ============================================ */

.hero-trust {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    gap: 24px;
    align-items: center;
    flex-wrap: wrap;
}

.trust-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 500;
}

.trust-stars {
    color: #FFD700;
    font-size: 20px;
    letter-spacing: -2px;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    opacity: 0.95;
}

@media (max-width: 768px) {
    .hero-trust {
        justify-content: center;
        text-align: center;
        gap: 16px;
    }

    .trust-badge {
        font-size: 13px;
    }
}

/* ============================================
   2. IMPROVED PRICING DISPLAY
   ============================================ */

.daily-cost {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
    font-weight: 400;
}

.featured .daily-cost {
    color: #00843D;
    font-weight: 500;
}

/* ============================================
   3. BETTER MODE BADGES
   ============================================ */

.mode-badges {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-free {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-quick {
    background: #e3f2fd;
    color: #1565c0;
}

.badge-exam {
    background: #fff3e0;
    color: #e65100;
}

.badge-time {
    background: #f3e5f5;
    color: #6a1b9a;
}

/* ============================================
   4. SKIP NAVIGATION LINK
   ============================================ */

.skip-link {
    position: absolute;
    left: -10000px;
    top: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
    background: #00843D;
    color: white;
    padding: 10px 15px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
}

.skip-link:focus {
    position: fixed;
    left: 10px;
    top: 10px;
    width: auto;
    height: auto;
    outline: 3px solid #FFD700;
    outline-offset: 2px;
}

/* ============================================
   5. IMPROVED COLOR CONTRAST
   ============================================ */

:root {
    --primary-color: #00742F; /* Darker green for WCAG AA compliance */
    --primary-hover: #00843D;
    --text-dark: #1a1a1a;
    --text-light: #4a4a4a;
}

.btn-primary {
    background: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-hover);
}

/* ============================================
   6. SUCCESS CELEBRATION MODAL
   ============================================ */

.success-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.success-modal.active {
    opacity: 1;
}

.success-content {
    background: white;
    padding: 48px;
    border-radius: 16px;
    text-align: center;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: successBounce 0.5s ease;
}

@keyframes successBounce {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.success-icon {
    font-size: 72px;
    margin-bottom: 16px;
    animation: iconPulse 1s ease infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.success-content h2 {
    color: var(--primary-color);
    font-size: 32px;
    margin: 16px 0;
}

.success-score {
    font-size: 48px;
    font-weight: bold;
    color: var(--primary-color);
    margin: 24px 0;
}

.success-message {
    font-size: 18px;
    color: var(--text-dark);
    margin-bottom: 32px;
}

.success-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.success-actions button {
    flex: 1;
    min-height: 48px;
}

/* Confetti Animation */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    z-index: 10000;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ============================================
   7. INSTANT ANSWER FEEDBACK
   ============================================ */

.choice-btn {
    transition: all 0.15s ease;
}

.choice-btn:active {
    transform: scale(0.98);
    background: rgba(0, 132, 61, 0.05);
}

.choice-btn.selecting {
    animation: selectPulse 0.3s ease;
}

@keyframes selectPulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.98); background: rgba(0, 132, 61, 0.1); }
    100% { transform: scale(1); }
}

/* ============================================
   8. KEYBOARD FOCUS INDICATORS
   ============================================ */

.choice-btn:focus,
.btn:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

.choice-btn:focus-visible {
    box-shadow: 0 0 0 4px rgba(0, 132, 61, 0.2);
}

/* ============================================
   9. TOAST NOTIFICATIONS
   ============================================ */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 500px;
    pointer-events: auto;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid #4caf50;
}

.toast.error {
    border-left: 4px solid #f44336;
}

.toast.warning {
    border-left: 4px solid #ff9800;
}

.toast.info {
    border-left: 4px solid #2196f3;
}

.toast-icon {
    font-size: 24px;
}

.toast-message {
    flex: 1;
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
}

@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;
    }
}

/* ============================================
   10. PROGRESS RINGS
   ============================================ */

.progress-ring {
    width: 120px;
    height: 120px;
    position: relative;
}

.progress-ring svg {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 8;
}

.progress-ring-fill {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dasharray 0.5s ease;
}

.progress-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

/* ============================================
   11. ONBOARDING OVERLAY
   ============================================ */

.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.onboarding-spotlight {
    position: absolute;
    border: 3px solid var(--primary-color);
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.8);
    animation: spotlightPulse 2s ease infinite;
}

@keyframes spotlightPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

.onboarding-tooltip {
    position: absolute;
    background: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 300px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.onboarding-tooltip h3 {
    margin: 0 0 10px;
    color: var(--primary-color);
}

.onboarding-tooltip p {
    margin: 0 0 16px;
    color: var(--text-dark);
}

.onboarding-actions {
    display: flex;
    gap: 10px;
}

/* ============================================
   12. ACHIEVEMENT BADGES
   ============================================ */

.achievement-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: white;
    padding: 32px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    animation: achievementPop 0.5s ease forwards;
}

@keyframes achievementPop {
    0% { transform: translate(-50%, -50%) scale(0); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.achievement-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.achievement-title {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.achievement-description {
    color: var(--text-light);
    margin-bottom: 20px;
}

/* ============================================
   13. LANDSCAPE MODE OPTIMIZATIONS
   ============================================ */

@media (orientation: landscape) and (max-height: 500px) {
    .quiz-header {
        position: relative;
        padding: 8px 16px;
    }

    .quiz-container {
        padding-top: 16px;
    }

    .quiz-progress {
        position: relative;
        margin-bottom: 16px;
    }

    .choice-btn {
        min-height: 48px;
        padding: 12px 16px;
    }
}

/* ============================================
   14. DESKTOP SCREEN OPTIMIZATION
   ============================================ */

@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
    }

    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .quiz-container {
        max-width: 900px;
        margin: 0 auto;
    }

    .pricing-cards {
        gap: 32px;
        max-width: 1000px;
        margin: 0 auto;
    }
}

/* ============================================
   15. BUTTON HIERARCHY
   ============================================ */

.btn-tertiary {
    background: none;
    color: var(--primary-color);
    border: none;
    text-decoration: underline;
    padding: 8px 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-tertiary:hover {
    text-decoration: none;
    background: rgba(0, 132, 61, 0.05);
}

/* ============================================
   16. STUDY PLAN CARD
   ============================================ */

.study-plan-card {
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
}

.study-plan-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.study-plan-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary-color);
}

.study-plan-days {
    background: var(--primary-color);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
}

.study-plan-content {
    display: grid;
    gap: 12px;
}

.study-plan-item {
    background: white;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.study-plan-item.completed {
    opacity: 0.7;
    background: #f5f5f5;
}

.study-plan-item.current {
    border: 2px solid var(--primary-color);
}

.study-plan-check {
    width: 24px;
    height: 24px;
    border: 2px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.study-plan-item.completed .study-plan-check {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ============================================
   17. URGENCY INDICATORS
   ============================================ */

.urgency-banner {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border-left: 4px solid #ff6f00;
    padding: 12px 16px;
    margin: 16px 0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.urgency-icon {
    font-size: 24px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .success-content {
        padding: 32px 20px;
    }

    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    .study-plan-card {
        padding: 16px;
    }
}