/**
 * Components Styles
 * 
 * Contains styles for:
 * - Toast notifications
 * - Button styles
 * - Custom animations
 * - Utility classes
 * - Header controls
 * - Font size controls
 * - Loader components
 * - Choice cards
 */

/* Toast notifications */
.toast-notification {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    background-color: #ef4444;
    /* red-500 */
    color: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition: opacity 0.3s ease-in-out;
    z-index: 50;
}

.toast-notification.hide {
    opacity: 0;
}

/* Button styles */
.primary-button {
    display: flex;
    justify-content: center;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    background-color: #0d9488;
    /* deep teal */
    transition: background-color 0.2s ease-in-out, transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.primary-button:hover {
    background-color: #0f766e;
    /* darker teal */
    transform: scale(1.02);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.primary-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(253, 252, 247, 0.9), 0 0 0 4px #0d9488;
}

.success-button {
    background-color: #10b981;
    /* green-600 */
}

.success-button:hover {
    background-color: #059669;
    /* green-700 */
}

.success-button:focus {
    box-shadow: 0 0 0 2px rgba(253, 252, 247, 0.9), 0 0 0 4px #10b981;
}

/* Choice card styles */
.choice-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-left: 2px solid var(--color-primary-light);
    background: rgba(253, 252, 247, 0.7);
    backdrop-filter: blur(4px);
    transform: translateZ(0);
    /* Hardware acceleration */
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.choice-card:hover {
    transform: scale(1.01) translateZ(0);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.choice-card:active {
    transform: scale(0.98) translateZ(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Accessibility focus ring for choice cards */
.choice-card:focus {
    outline: none;
}

.choice-card:focus-visible {
    outline: none;
    box-shadow:
        0 0 0 2px rgba(253, 252, 247, 0.9),
        0 0 0 4px var(--color-primary);
}

.choice-card.disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.choice-card.selected {
    border-left: 2px solid var(--color-primary);
    background: rgba(253, 252, 247, 0.9);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

/* Choice image styles */
.choice-image-container {
    transition: all 0.3s ease-in-out;
    overflow: hidden;
    margin-top: 0.75rem;
    border-radius: 0.5rem;
}

.choice-image-container img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 0.5rem;
}

/* Chapter image styles */
.chapter-image-container {
    width: 100%;
    max-height: 300px;
    overflow: hidden;
    margin-bottom: 2.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    /* Removed transition to prevent image flicker between chapters */
}

.chapter-image-container img {
    width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 0.75rem;
}

@media (min-width: 768px) {
    .chapter-image-container {
        max-height: 600px;
        margin-bottom: 3rem;
    }
}

.choice-content {
    display: flex;
    flex-direction: column;
    flex: 1;
}

@media (min-width: 768px) {
    .choice-content {
        flex-direction: row;
    }

    .choice-text {
        flex: 2;
        padding-right: 1rem;
    }

    .choice-image-container {
        flex: 1;
        margin-top: 0;
    }
}

/* Ensure images display fully on mobile */
@media (max-width: 767px) {
    .choice-image-container img {
        width: 100%;
        height: auto;
        object-fit: contain;
    }
}

/* Image fade-in animation */
.fade-in {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.fade-in.show {
    opacity: 1;
}

/* Debug info styles */
.debug-info {
    margin-top: 1rem;
    padding: 0.5rem;
    background-color: rgba(253, 252, 247, 0.7);
    /* cream background */
    font-size: 0.75rem;
    text-align: left;
    border-radius: 0.375rem;
}

/* Compact parchment header for chapter orientation and progress. */
.reader-header {
    position: sticky;
    top: 0;
    z-index: 40;
    margin: -0.25rem -0.25rem 1.25rem;
    padding: 0.65rem 1rem 0.55rem;
    background: rgba(253, 252, 247, 0.96);
    border: 1px solid rgba(139, 120, 93, 0.14);
    border-radius: 0.75rem;
    box-shadow:
        0 8px 20px rgba(68, 57, 43, 0.08),
        0 1px 2px rgba(68, 57, 43, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.reader-header-main {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    align-items: center;
    gap: 1rem;
}

.reader-brand {
    grid-column: 1;
    grid-row: 1;
    color: var(--color-primary-dark);
    font-family: var(--font-reading);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    line-height: 1;
    white-space: nowrap;
}

.reader-brand:hover {
    color: var(--color-primary);
}

.reader-brand:focus-visible {
    outline: 2px solid var(--color-focus);
    outline-offset: 3px;
    border-radius: 0.2rem;
}

.adventure-context-ribbon {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    overflow: hidden;
    color: rgba(108, 91, 67, 0.78);
    font-family: var(--font-reading);
    font-size: 0.95rem;
    font-style: italic;
    letter-spacing: 0.015em;
    line-height: 1.2;
    text-align: center;
    opacity: 0;
    transition: opacity 0.35s ease-in;
}

.adventure-context-ribbon.visible {
    opacity: 1;
}

.adventure-context-ribbon.hidden {
    display: none;
}

.context-marquee {
    min-width: 0;
    overflow: hidden;
}

.context-marquee-track {
    display: flex;
    width: max-content;
    margin: 0 auto;
    will-change: transform;
}

.context-copy {
    display: inline-flex;
    flex: none;
    align-items: baseline;
    gap: 0.4em;
    padding-right: 0;
    white-space: nowrap;
}

.context-copy-duplicate {
    display: none;
}

.adventure-context-ribbon.is-overflowing .context-marquee {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 0.9rem, #000 calc(100% - 0.9rem), transparent);
    mask-image: linear-gradient(to right, transparent, #000 0.9rem, #000 calc(100% - 0.9rem), transparent);
}

.adventure-context-ribbon.is-overflowing .context-marquee-track {
    margin: 0;
    animation: context-ticker var(--context-ticker-duration, 18s) linear infinite;
}

.adventure-context-ribbon.is-overflowing .context-copy-duplicate {
    display: inline-flex;
}

.adventure-context-ribbon.is-overflowing .context-copy {
    padding-right: 2.5rem;
}

.adventure-context-ribbon.is-overflowing:hover .context-marquee-track {
    animation-play-state: paused;
}

.adventure-context-ribbon .context-separator {
    font-style: normal;
}

.adventure-context-ribbon .context-item,
.adventure-context-ribbon .context-world,
.adventure-context-ribbon .context-topic {
    white-space: nowrap;
}

.reader-chapter {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    color: var(--color-text-dark);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* A story thread: compact progress without turning the reader into a dashboard. */
.reader-progress {
    width: 100%;
    height: 3px;
    margin-top: 0.55rem;
    overflow: hidden;
    background: rgba(139, 120, 93, 0.12);
    border-radius: 999px;
}

.reader-progress-fill {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary-dark), var(--color-primary-light));
    border-radius: inherit;
    transition: width 0.35s ease-out;
}

@media (max-width: 768px) {
    .reader-header {
        margin: -0.25rem -0.5rem 1rem;
        padding: 0.6rem 0.75rem 0.5rem;
        border-radius: 0 0 0.65rem 0.65rem;
    }

    .reader-header-main {
        grid-template-columns: minmax(0, 1fr) max-content;
        gap: 0.4rem 0.75rem;
    }

    .reader-brand {
        font-size: 1rem;
    }

    .adventure-context-ribbon {
        grid-column: 1 / -1;
        grid-row: 2;
        font-size: 0.88rem;
        text-align: left;
    }

    .context-marquee {
        overflow: visible;
        -webkit-mask-image: none !important;
        mask-image: none !important;
    }

    .context-marquee-track,
    .adventure-context-ribbon.is-overflowing .context-marquee-track {
        display: block;
        width: 100%;
        margin: 0;
        animation: none;
        transform: none;
    }

    .context-copy {
        display: grid;
        gap: 0.05rem;
        padding-right: 0;
        white-space: normal;
    }

    .context-copy-duplicate,
    .adventure-context-ribbon.is-overflowing .context-copy-duplicate {
        display: none;
    }

    .adventure-context-ribbon .context-separator {
        display: none;
    }

    .adventure-context-ribbon .context-item,
    .adventure-context-ribbon .context-world,
    .adventure-context-ribbon .context-topic {
        white-space: normal;
    }
}

/* Header controls styling with paper fold effect */
.header-controls {
    transition: opacity 0.3s ease-in-out;
    padding: 8px 16px;
    margin-bottom: 16px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    position: relative;
    background: transparent;
}

/* Paper fold/crease effect instead of straight line */
.header-controls::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: linear-gradient(to right,
            transparent 0%,
            rgba(139, 120, 93, 0.1) 20%,
            rgba(139, 120, 93, 0.2) 50%,
            rgba(139, 120, 93, 0.1) 80%,
            transparent 100%);
    box-shadow:
        0 1px 2px rgba(139, 120, 93, 0.1),
        0 -1px 1px rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.header-controls-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Font size controls styling */
.font-size-controls {
    background: var(--color-bg-controls);
    border-radius: 8px;
    padding: 4px;
    backdrop-filter: blur(4px);
    align-items: center;
    gap: 0.5rem;
    display: none;
    /* Hidden by default, shown only on mobile */
    border: 1px solid rgba(139, 120, 93, 0.15);
}

/* Mobile-specific enhancements */
@media (max-width: 768px) {
    .font-size-controls {
        display: flex;
    }
}

@media (prefers-reduced-motion: reduce) {
    .adventure-context-ribbon,
    .reader-progress-fill {
        transition: none;
    }

    .adventure-context-ribbon.is-overflowing .context-marquee-track {
        animation: none;
        transform: none;
    }

    .adventure-context-ribbon.is-overflowing .context-marquee {
        overflow-x: auto;
        -webkit-mask-image: none;
        mask-image: none;
        scrollbar-width: none;
    }

    .adventure-context-ribbon.is-overflowing .context-marquee::-webkit-scrollbar,
    .adventure-context-ribbon.is-overflowing .context-copy-duplicate {
        display: none;
    }
}

@keyframes context-ticker {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

.font-size-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg-secondary);
    border-radius: 0.375rem;
    font-weight: bold;
    transition: all 0.2s ease-in-out;
    border: none;
    cursor: pointer;
}

.font-size-btn:hover {
    background-color: var(--color-accent-medium);
}

.font-size-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

.font-size-btn:disabled {
    opacity: var(--color-disabled);
    cursor: not-allowed;
}

.font-size-percentage {
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 3rem;
    text-align: center;
}

/* Mobile-only controls */
@media (max-width: 768px) {

    /* Enhanced swipe tip */
    .swipe-tip {
        background: var(--color-primary);
        border: none;
        box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    }
}

/* Loader Component Styles */

/* Base loader container */
.loader-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}

/* Default spinner style */
.loader {
    border: 3px solid #f3f3f3;
    border-radius: 50%;
    border-top: 3px solid #0d9488;
    /* Teal color matching paper theme */
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

/* Spinner animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

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

/* Utility class for hiding elements */
.loader-hidden {
    display: none;
}

/* Size variants */
.loader-sm {
    width: 24px;
    height: 24px;
    border-width: 2px;
}

.loader-lg {
    width: 56px;
    height: 56px;
    border-width: 4px;
}

/* Color variants - can be customized based on your theme */
.loader-primary {
    border-top-color: #0d9488;
    /* Teal */
}

.loader-secondary {
    border-top-color: #6b7280;
    /* Gray */
}

.loader-success {
    border-top-color: #10b981;
    /* Green */
}

/* Speed variants */
.loader-slow {
    animation-duration: 2s;
}

.loader-fast {
    animation-duration: 0.5s;
}

/* Fade Overlay Styles - NEW */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(253, 252, 247, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 300ms ease-in-out;
    pointer-events: none;
}

.loader-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.loader-overlay.hidden {
    display: none !important;
}

.loader-icon {
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.loader-triangle {
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 60px solid #0d9488;
    transform-origin: 50% 50%;
}

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

    50% {
        transform: rotate(180deg);
    }

    75% {
        transform: rotate(630deg);
    }

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

.loader-text {
    margin-top: 2rem;
    text-align: center;
}

.loading-phrase {
    font-family: 'Crimson Text', serif;
    font-weight: 600;
    font-size: 3.5rem;
    color: #0d9488;
    letter-spacing: 0.05em;
    min-height: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-phrase.green-gradient {
    background: linear-gradient(
        45deg,
        #0d9488,
        #e5e7eb,
        #0d9488,
        #e5e7eb,
        #0d9488
    );
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: green-sweep 8s linear infinite;
}

@keyframes green-sweep {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.loading-phrase.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

.loading-phrase.fade-in {
    opacity: 1;
    transition: opacity 0.5s ease-in;
}

@keyframes float {
    0% {
        translate: 0 -120px;
    }

    25% {
        translate: 120px 0;
    }

    50% {
        translate: 0 120px;
    }

    75% {
        translate: -120px 0;
    }

    100% {
        translate: 0 -120px;
    }
}

.animate-spin-accelerate {
    animation:
        spin-accelerate-decelerate 1.2s infinite ease-in-out,
        float 3.5s infinite cubic-bezier(0.45, 0.05, 0.55, 0.95);
    transform-origin: center;
}

/* Hide the old loader visually by default - but can be shown when needed */
.loader-container {
    display: none;
}

/* Selection screen primary action buttons: match intro primary size */
#category-continue-btn,
#lesson-start-btn {
    font-size: 1.5rem !important; /* same as intro primary (24px) */
    line-height: 1.4 !important;
}

/* ============================================
   Phase 1: Enhanced Loading Experience
   ============================================ */

/* Progress Steps Container */
.loader-progress {
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.loader-progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    max-width: 400px;
    margin: 0 auto;
}

/* Individual Step */
.loader-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.loader-step.active {
    opacity: 1;
}

.loader-step.completed {
    opacity: 1;
}

.loader-step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d1d5db;
    border: 2px solid #d1d5db;
    transition: all 0.3s ease;
}

.loader-step.active .loader-step-dot {
    background: #0d9488;
    border-color: #0d9488;
    animation: pulse-dot 1.5s ease-in-out infinite;
}

.loader-step.completed .loader-step-dot {
    background: #0d9488;
    border-color: #0d9488;
}

.loader-step-label {
    font-family: 'Andika', sans-serif;
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
}

.loader-step.active .loader-step-label,
.loader-step.completed .loader-step-label {
    color: #0d9488;
    font-weight: 500;
}

/* Connector Line */
.loader-step-line {
    width: 60px;
    height: 2px;
    background: #d1d5db;
    margin: 0 0.5rem;
    margin-bottom: 1.5rem; /* Align with dots, not labels */
    transition: background 0.3s ease;
}

.loader-step-line.active {
    background: linear-gradient(90deg, #0d9488 0%, #d1d5db 100%);
}

.loader-step-line.completed {
    background: #0d9488;
}

@keyframes pulse-dot {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.4);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 8px rgba(13, 148, 136, 0);
    }
}

/* Error/Retry Container */
.loader-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(254, 242, 242, 0.9);
    border-radius: 0.75rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.loader-error.hidden {
    display: none;
}

.loader-error-message {
    font-family: 'Andika', sans-serif;
    font-size: 1rem;
    color: #dc2626;
    margin: 0;
    text-align: center;
}

.loader-retry-btn {
    padding: 0.75rem 1.5rem;
    background: #0d9488;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-family: 'Andika', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.loader-retry-btn:hover {
    background: #0f766e;
    transform: scale(1.02);
}

.loader-retry-btn:active {
    transform: scale(0.98);
}

/* Mobile adjustments for loader */
@media (max-width: 640px) {
    .loader-progress-steps {
        max-width: 300px;
    }

    .loader-step-line {
        width: 40px;
    }

    .loader-step-label {
        font-size: 0.65rem;
    }

    .loading-phrase {
        font-size: 2rem;
    }
}

/* =============================================
   Breadcrumb Trail Back Button
   ============================================= */
.trail-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px 6px 8px;
    background: transparent;
    border: none;
    color: var(--color-primary);
    font-family: var(--font-reading);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 20px;
}

.trail-back:hover {
    background: rgba(13, 148, 136, 0.08);
    color: var(--color-primary-dark);
}

.trail-back:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(253, 252, 247, 0.9), 0 0 0 4px var(--color-primary);
}

.trail-back:hover .trail-arrow::before {
    transform: translateY(-50%) translateX(-3px);
}

/* Arrow */
.trail-arrow {
    position: relative;
    width: 20px;
    height: 16px;
    transition: transform 0.3s ease;
}

.trail-arrow::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 50%;
    width: 12px;
    height: 2px;
    background: currentColor;
    transform: translateY(-50%);
    border-radius: 1px;
    transition: transform 0.2s ease;
}

.trail-arrow::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 8px;
    height: 8px;
    border: 2px solid currentColor;
    border-right: none;
    border-bottom: none;
    transform: translateY(-50%) rotate(-45deg);
}

/* =============================================
   Chapter Marker Step Indicator
   ============================================= */
.chapter-marker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.chapter-marker:hover {
    background: rgba(13, 148, 136, 0.06);
}

.chapter-marker:focus {
    outline: none;
}

.chapter-marker:focus .marker-badge {
    box-shadow:
        0 0 0 2px var(--color-bg-primary),
        0 0 0 4px var(--color-primary);
}

/* The circular badge with checkmark */
.marker-badge {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--color-primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(13, 148, 136, 0.2);
}

.chapter-marker:hover .marker-badge {
    transform: scale(1.1) translateY(-2px);
    box-shadow:
        0 4px 8px rgba(13, 148, 136, 0.3),
        0 0 0 3px rgba(13, 148, 136, 0.1);
    background: var(--color-primary);
}

/* Checkmark inside badge */
.marker-badge::after {
    content: '';
    width: 7px;
    height: 12px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg) translate(-1px, -1px);
}

/* Label text */
.marker-label {
    font-family: var(--font-reading);
    color: var(--color-text-dark);
    font-size: 0.95rem;
    transition: all 0.3s ease;
    opacity: 0.85;
}

.chapter-marker:hover .marker-label {
    color: var(--color-primary);
    opacity: 1;
}

/* =============================================
   Journey Complete Summary Buttons
   ============================================= */

/* Container for journey complete section */
.journey-complete-container {
    text-align: center;
    padding: 1rem;
}

/* Heading style - larger for children's readability */
.journey-complete-heading {
    font-size: 1.75rem !important;
    font-weight: 700 !important;
    color: #166534 !important; /* green-800 */
    margin-bottom: 0.5rem;
    font-family: var(--font-heading), 'Crimson Text', serif;
}

/* Stats text - larger for readability */
.journey-stats {
    font-size: 1.15rem !important;
    color: #15803d !important; /* green-700 */
    line-height: 1.6;
}

.journey-stats p {
    margin: 0.25rem 0;
}

/* Button container */
.journey-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Memory Lane Button - Purple with shimmer effect */
.summary-btn-memory {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #7c3aed 0%, #9333ea 50%, #7c3aed 100%);
    background-size: 200% 200%;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
    position: relative;
    overflow: hidden;
}

.summary-btn-memory::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 0.5s ease;
}

.summary-btn-memory:hover {
    background-position: 100% 100%;
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(124, 58, 237, 0.4);
}

.summary-btn-memory:hover::before {
    left: 100%;
}

.summary-btn-memory:focus {
    outline: none;
    box-shadow:
        0 0 0 2px rgba(253, 252, 247, 0.9),
        0 0 0 4px #7c3aed;
}

.summary-btn-memory:active {
    transform: scale(0.98);
}

/* Memory Lane button text styles */
.summary-btn-memory .btn-title {
    display: block;
    font-size: 1.5rem !important;
    font-weight: 600;
    color: #ffffff !important;
    line-height: 1.3;
    font-family: var(--font-heading), 'Crimson Text', serif;
}

.summary-btn-memory .btn-subtitle {
    display: block;
    font-size: 1.1rem !important;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.95) !important;
    margin-top: 0.5rem;
    font-family: var(--font-reading), 'Andika', sans-serif;
}

/* New Journey Button - Green */
.summary-btn-new {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #16a34a 0%, #22c55e 50%, #16a34a 100%);
    background-size: 200% 200%;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
    font-size: 1.35rem !important;
    font-weight: 600;
    color: #ffffff !important;
    font-family: var(--font-heading), 'Crimson Text', serif;
}

.summary-btn-new:hover {
    background-position: 100% 100%;
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.4);
}

.summary-btn-new:focus {
    outline: none;
    box-shadow:
        0 0 0 2px rgba(253, 252, 247, 0.9),
        0 0 0 4px #16a34a;
}

.summary-btn-new:active {
    transform: scale(0.98);
}

/* Mobile adjustments for summary buttons */
@media (max-width: 640px) {
    .journey-complete-heading {
        font-size: 1.5rem !important;
    }

    .journey-stats {
        font-size: 1.05rem !important;
    }

    .summary-btn-memory .btn-title {
        font-size: 1.35rem !important;
    }

    .summary-btn-memory .btn-subtitle {
        font-size: 1rem !important;
    }

    .summary-btn-new {
        font-size: 1.2rem !important;
    }
}
