/* Modern Mobile Story Interface - Clean App Design */
/* Inspired by premium mobile apps like Notion, Linear, and Apple's design language */

/* Show mobile version by default on all devices */
.mobile-story-container {
    display: block !important;
    padding: 0;
    background: #f8f9fc !important;
    position: relative;
    min-height: auto;
}

/* Hide desktop version on all devices */
.desktop-story-container {
    display: none !important;
}

/* Force hide any remaining desktop elements with high specificity */
.tc-sticky-container,
.tc-panel,
.tc-content-wrapper,
.tc-floating-element,
.tc-progress-indicator {
    display: none !important;
    visibility: hidden !important;
}

/* Ensure mobile story container is always visible with highest priority */
section#teaching-collaborative-piano .mobile-story-container {
    display: block !important;
    visibility: visible !important;
    position: relative !important;
    z-index: 999 !important;
}

/* Force light background - high specificity override */
body .teaching-collaboration,
.teaching-collaboration,
section.teaching-collaboration {
    background: #f8f9fc !important;
    background-color: #f8f9fc !important;
    padding-top: 4rem !important;
}
    
/* Make main section title visible - consistent with other sections */
.teaching-collaboration .section-title {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: var(--color-text) !important;
    background: transparent !important;
    font-family: var(--font-primary) !important;
    font-size: 2.2rem !important;
    font-weight: 300 !important;
    margin-bottom: 2rem !important;
    text-align: center !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Section title decorative line */
.teaching-collaboration .section-title::after {
    content: '' !important;
    display: block !important;
    width: 60px !important;
    height: 2px !important;
    background-color: var(--color-accent) !important;
    margin: var(--spacing-xs) auto !important;
}

/* Ensure all child elements inherit light theme */
.mobile-story-container * {
    background-color: transparent;
}

/* Mobile-specific spacing adjustments for even hierarchy */
@media (max-width: 768px) {
    .teaching-collaboration .section-title {
        margin-bottom: 3.5rem !important; /* Increased spacing from title to navigation */
    }
}

@media (max-width: 480px) {
    .teaching-collaboration .section-title {
        margin-bottom: 3rem !important; /* Slightly reduced for smaller screens */
    }
}

/* Global interface design - no device restrictions */

/* Seamlessly Integrated Navigation - No Container Feel */
.mobile-story-container .mobile-story-tabs,
body .mobile-story-container .mobile-story-tabs {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    background: linear-gradient(180deg, rgba(248, 249, 252, 0.95) 0%, rgba(248, 249, 252, 0.8) 70%, transparent 100%) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-bottom: none !important; /* Remove border */
    padding: env(safe-area-inset-top) 0 0 0 !important;
    box-shadow: none !important; /* Remove container shadow */
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    color: #1d1d1f !important;
}

/* Seamless Progress Container - No Background */
.mobile-story-container .mobile-story-progress-container,
body .mobile-story-container .mobile-story-progress-container {
    padding: 1rem 1.5rem 1rem !important; /* Reduced bottom padding for even spacing */
    position: relative !important;
    background: transparent !important;
    color: #1d1d1f !important;
}

/* Enhanced Journey Path */
.mobile-story-progress-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, 
        transparent 0%, 
        rgba(196, 181, 253, 0.1) 20%,
        rgba(139, 92, 246, 0.15) 50%,
        rgba(99, 102, 241, 0.1) 80%,
        transparent 100%
    );
    transform: translateY(-50%);
    border-radius: 3px;
    z-index: 1;
    box-shadow: 
        inset 0 1px 2px rgba(139, 92, 246, 0.1),
        0 0 8px rgba(196, 181, 253, 0.05);
}

.mobile-story-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, 
        #c4b5fd 0%, 
        #a78bfa 25%,
        #8b5cf6 50%, 
        #7c3aed 75%,
        #6366f1 100%
    );
    border-radius: 3px;
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    width: 0%;
    box-shadow: 
        0 0 15px rgba(139, 92, 246, 0.4), 
        0 0 25px rgba(196, 181, 253, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    z-index: 2;
    position: relative;
    overflow: hidden;
}

/* Enhanced wave effect */
.mobile-story-progress-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%,
        rgba(255, 255, 255, 0.1) 25%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0.1) 75%,
        transparent 100%
    );
    animation: progressWave 3s ease-in-out infinite;
}

/* Particle shimmer effect */
.mobile-story-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.4), 
        transparent
    );
    animation: shimmer 2.5s infinite;
}

@keyframes progressWave {
    0%, 100% {
        left: -100%;
        opacity: 0;
    }
    50% {
        left: 0%;
        opacity: 1;
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

/* Integrated Navigation - Dots on Progress Line */
.mobile-story-container .mobile-story-nav-dots,
body .mobile-story-container .mobile-story-nav-dots {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    position: relative !important;
    margin-bottom: 0.75rem !important;
    padding: 0 2rem !important; /* Space for line ends */
    background: transparent !important;
    height: 28px !important; /* Give height for positioning */
    width: 50% !important; /* Only 50% of window width */
    margin-left: auto !important; /* Center the container */
    margin-right: auto !important; /* Center the container */
}

/* Journey Milestones - Enhanced Design */
.mobile-story-container .mobile-story-nav-dot,
body .mobile-story-container .mobile-story-nav-dot {
    width: 18px !important;
    height: 18px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #f8f9fc, #e0e7ff) !important;
    border: 2px solid rgba(139, 92, 246, 0.2) !important;
    cursor: pointer !important;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1) !important;
    -webkit-tap-highlight-color: transparent !important;
    position: relative !important;
    z-index: 3 !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 
        0 2px 8px rgba(139, 92, 246, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}

/* Milestone inner glow */
.mobile-story-container .mobile-story-nav-dot::before,
body .mobile-story-container .mobile-story-nav-dot::before {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background: linear-gradient(135deg, transparent, rgba(139, 92, 246, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Milestone icons (will be added via pseudo-elements) */
.mobile-story-container .mobile-story-nav-dot::after,
body .mobile-story-container .mobile-story-nav-dot::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(139, 92, 246, 0.3);
    border-radius: 50%;
    transition: all 0.3s ease;
}

/* Completed Milestones */
.mobile-story-container .mobile-story-nav-dot.completed,
body .mobile-story-container .mobile-story-nav-dot.completed {
    background: linear-gradient(135deg, #8b5cf6, #6366f1) !important;
    border-color: #8b5cf6 !important;
    transform: scale(1) !important;
    box-shadow: 
        0 0 0 3px rgba(139, 92, 246, 0.1),
        0 0 8px rgba(139, 92, 246, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

.mobile-story-container .mobile-story-nav-dot.completed::after,
body .mobile-story-container .mobile-story-nav-dot.completed::after {
    background: rgba(255, 255, 255, 0.9);
    width: 8px;
    height: 8px;
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
}

.mobile-story-container .mobile-story-nav-dot.completed::before,
body .mobile-story-container .mobile-story-nav-dot.completed::before {
    opacity: 1;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.2));
}

/* Active Milestone - Current Chapter */
.mobile-story-container .mobile-story-nav-dot.active,
body .mobile-story-container .mobile-story-nav-dot.active {
    background: linear-gradient(135deg, #c4b5fd, #8b5cf6) !important;
    border-color: #8b5cf6 !important;
    transform: scale(1.2) !important;
    box-shadow: 
        0 0 0 4px rgba(139, 92, 246, 0.15),
        0 0 12px rgba(196, 181, 253, 0.3),
        0 0 20px rgba(139, 92, 246, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
    animation: journeyPulse 2s ease-in-out infinite !important;
}

.mobile-story-container .mobile-story-nav-dot.active::after,
body .mobile-story-container .mobile-story-nav-dot.active::after {
    background: linear-gradient(135deg, #ffffff, #f0f0ff);
    width: 10px;
    height: 10px;
    box-shadow: 
        0 0 6px rgba(255, 255, 255, 0.8),
        0 0 12px rgba(139, 92, 246, 0.3);
    animation: milestoneGlow 2s ease-in-out infinite;
}

.mobile-story-container .mobile-story-nav-dot.active::before,
body .mobile-story-container .mobile-story-nav-dot.active::before {
    opacity: 1;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.3));
    animation: innerGlow 2s ease-in-out infinite;
}

/* Hover States */
.mobile-story-container .mobile-story-nav-dot:hover,
body .mobile-story-container .mobile-story-nav-dot:hover {
    transform: scale(1.1) !important;
    border-color: rgba(139, 92, 246, 0.6) !important;
    background: linear-gradient(135deg, #e0e7ff, #c4b5fd) !important;
    box-shadow: 
        0 0 0 2px rgba(139, 92, 246, 0.1),
        0 0 12px rgba(196, 181, 253, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
}

.mobile-story-container .mobile-story-nav-dot:hover::before,
body .mobile-story-container .mobile-story-nav-dot:hover::before {
    opacity: 1;
}

.mobile-story-container .mobile-story-nav-dot:hover::after,
body .mobile-story-container .mobile-story-nav-dot:hover::after {
    background: rgba(139, 92, 246, 0.7);
    width: 8px;
    height: 8px;
}

.mobile-story-container .mobile-story-nav-dot.active:hover,
body .mobile-story-container .mobile-story-nav-dot.active:hover {
    transform: scale(1.2) !important;
}

/* Beautiful Tooltip System */
.mobile-story-container .mobile-story-nav-dot[aria-label],
body .mobile-story-container .mobile-story-nav-dot[aria-label] {
    position: relative;
}

/* Override the ::after for tooltips */
.mobile-story-container .mobile-story-nav-dot[aria-label]:hover::after,
body .mobile-story-container .mobile-story-nav-dot[aria-label]:hover::after {
    content: attr(aria-label);
    position: absolute;
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.95), rgba(99, 102, 241, 0.95));
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 
        0 4px 20px rgba(139, 92, 246, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    z-index: 10;
    pointer-events: none;
    font-family: 'Lato', sans-serif;
    letter-spacing: 0.01em;
    width: auto;
    height: auto;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.95), rgba(99, 102, 241, 0.95));
    animation: tooltipFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes tooltipFadeIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(8px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Chapter Header - Perfect Screen Centering */
.mobile-story-container .mobile-chapter-header,
body .mobile-story-container .mobile-chapter-header {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin-bottom: 1.5rem !important;
    position: relative !important;
    width: 100% !important;
    min-height: 80px !important; /* Match arrow height for alignment */
    padding: 0 !important; /* Remove all padding */
}

/* Chapter title with fixed large sizing */
.mobile-story-container .mobile-chapter-title,
body .mobile-story-container .mobile-chapter-title {
    position: absolute !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    text-align: center !important;
    margin: 0 !important;
    z-index: 1 !important;
    font-style: italic !important;
    
    /* Fixed large font size for readability */
    font-size: 1.75rem !important; /* Larger fixed size */
    max-width: calc(100vw - 48px) !important; /* Maximum space with arrows at screen edges */
    
    /* Prefer single line, allow wrapping only if absolutely necessary */
    white-space: nowrap !important;
    overflow: visible !important;
    line-height: 1.3 !important;
    
    /* Only break if title is extremely long */
    word-break: keep-all !important;
    hyphens: none !important;
}


/* Chapter Navigation Arrows - Large & Highly Visible */
.mobile-story-container .chapter-nav-arrow,
body .mobile-story-container .chapter-nav-arrow {
    width: 24px !important; /* Keep same narrow width */
    height: 80px !important; /* Tall for excellent touch target */
    border: none !important;
    background: transparent !important; /* No bubble background */
    color: #8b5cf6 !important; /* Purple accent color */
    font-size: 3rem !important; /* Even larger for maximum visibility */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    -webkit-tap-highlight-color: transparent !important;
    opacity: 1 !important;
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-weight: 700 !important; /* Very bold for maximum visibility */
    border-radius: 0 !important; /* No rounding - clean edges */
    padding: 0 !important; /* Zero padding */
    margin: 0 !important; /* Zero margin */
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8) !important; /* Subtle shadow for contrast */
}

/* Extra specificity to ensure arrow size takes effect */
.mobile-story-container .mobile-chapter-header .chapter-nav-arrow,
body .mobile-story-container .mobile-chapter-header .chapter-nav-arrow {
    font-size: 3rem !important; /* Force large size with high specificity */
    font-weight: 700 !important;
    color: #8b5cf6 !important;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.3) !important;
}

/* Position arrows at absolute screen edges */
.mobile-story-container .chapter-nav-arrow.left,
body .mobile-story-container .chapter-nav-arrow.left {
    left: 0 !important; /* Flush with left screen edge */
}

.mobile-story-container .chapter-nav-arrow.right,
body .mobile-story-container .chapter-nav-arrow.right {
    right: 0 !important; /* Flush with right screen edge */
}

/* Arrow hover states - minimal without background */
.mobile-story-container .chapter-nav-arrow:hover,
body .mobile-story-container .chapter-nav-arrow:hover {
    background: transparent !important; /* Keep transparent */
    color: #6366f1 !important; /* Accent color on hover */
    transform: translateY(-50%) scale(1.1) !important; /* Subtle scale for feedback */
    text-shadow: 0 0 15px rgba(99, 102, 241, 0.5) !important;
}

.mobile-story-container .chapter-nav-arrow:active,
body .mobile-story-container .chapter-nav-arrow:active {
    transform: translateY(-50%) scale(0.95) !important; /* Slight press effect */
    color: #7c3aed !important; /* Deeper purple on press */
    background: transparent !important;
    text-shadow: 0 0 8px rgba(124, 58, 237, 0.4) !important;
}

/* Disable arrows at boundaries - minimal design */
.mobile-story-container .chapter-nav-arrow.disabled,
body .mobile-story-container .chapter-nav-arrow.disabled {
    opacity: 0.25 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background: transparent !important; /* Keep transparent */
    color: rgba(0, 0, 0, 0.25) !important;
}


/* Premium swipe hint styling */
.mobile-swipe-hint {
    position: fixed !important;
    bottom: calc(env(safe-area-inset-bottom, 2rem) + 2rem) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    font-size: 0.75rem !important;
    font-family: var(--font-tertiary, 'Lato', sans-serif) !important;
    font-weight: 500 !important;
    color: rgba(0, 0, 0, 0.4) !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    opacity: 1 !important;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    pointer-events: none !important;
    z-index: 1000 !important;
    background: rgba(255, 255, 255, 0.9) !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

.mobile-swipe-hint.hidden {
    opacity: 0 !important;
    transform: translateX(-50%) translateY(10px) !important;
}

/* Main Content Area - Clean and Spacious - High Specificity */
.mobile-story-container .mobile-story-content,
body .mobile-story-container .mobile-story-content {
    padding-top: calc(env(safe-area-inset-top) + 80px) !important; /* Reduced for better spacing balance */
    padding-bottom: calc(env(safe-area-inset-bottom, 2rem) + 2rem) !important; /* No bottom nav */
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
    min-height: auto !important;
    background: #f8f9fc !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    color: #1d1d1f !important;
}

/* Story Panels - Dynamic Height Set by JavaScript */
.mobile-story-container .mobile-story-panels,
body .mobile-story-container .mobile-story-panels {
    position: relative !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 auto !important;
    overflow: visible !important; /* Changed from hidden to prevent content cutoff */
    /* Height will be set dynamically by JavaScript based on first panel */
    min-height: 600px !important; /* Increased fallback minimum for better content accommodation */
    height: auto !important;
    flex: none !important;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: center !important;
    max-width: 800px !important;
    width: 100% !important;
}

.mobile-story-container .mobile-story-panel,
body .mobile-story-container .mobile-story-panel {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateX(0) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
    background: transparent !important;
    color: #1d1d1f !important;
    max-width: 800px !important;
    margin: 0 auto !important;
    width: 100% !important;
    min-height: fit-content !important;
    height: auto !important;
}

.mobile-story-container .mobile-story-panel.active,
body .mobile-story-container .mobile-story-panel.active {
    display: block !important;
    position: absolute !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
    background: transparent !important;
    color: #1d1d1f !important;
}

/* Fade out transition - higher specificity to override active class */
.mobile-story-container .mobile-story-panel.fade-out,
body .mobile-story-container .mobile-story-panel.fade-out {
    display: block !important;
    opacity: 0 !important;
    visibility: visible !important;
    transform: translateX(0) !important;
}

/* Typography - Clean and Readable - High Specificity */
.mobile-story-container .mobile-panel-content,
body .mobile-story-container .mobile-panel-content {
    max-width: 800px !important;
    padding: 0 !important;
    margin: 0 auto !important;
    background: transparent !important;
}

/* Chapter Titles within Content - Beautiful Typography */
.mobile-story-container .mobile-chapter-title,
body .mobile-story-container .mobile-chapter-title {
    font-family: var(--font-primary, 'Cormorant Garamond', serif) !important;
    font-size: 2rem !important;
    font-weight: 400 !important;
    font-style: italic !important;
    color: #1d1d1f !important;
    margin: 0 0 1.5rem 0 !important;
    text-align: left !important;
    letter-spacing: -0.015em !important;
    line-height: 1.25 !important;
    background: transparent !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.mobile-story-container .mobile-panel-content p,
body .mobile-story-container .mobile-panel-content p {
    font-family: 'Spectral', serif !important; /* Match biography section */
    font-size: 1rem !important; /* Match biography section */
    line-height: 1.7 !important; /* Match biography section */
    color: #1d1d1f !important;
    margin: 0 0 1.5rem 0 !important;
    text-align: left !important;
    font-weight: 400 !important; /* Match biography section */
    letter-spacing: 0.01em !important;
    text-rendering: optimizeLegibility !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    opacity: 1 !important;
    background: transparent !important;
    display: block !important;
    visibility: visible !important;
}

.mobile-panel-content p:last-child {
    margin-bottom: 0;
}

/* Links - Subtle and Elegant */
.mobile-dissertation-link {
    color: #007AFF !important;
    text-decoration: underline;
    text-decoration-color: rgba(0, 122, 255, 0.4);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    font-weight: 500;
}

.mobile-dissertation-link:hover,
.mobile-dissertation-link:active {
    color: #0056CC !important;
    text-decoration-color: rgba(0, 86, 204, 0.6);
}

/* Beautiful Animations for Progress and Dots */
@keyframes swipeHintFade {
    0%, 80% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(10px); }
}

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

/* Enhanced Journey Animations */
@keyframes journeyPulse {
    0%, 100% { 
        box-shadow: 
            0 0 0 4px rgba(139, 92, 246, 0.15),
            0 0 12px rgba(196, 181, 253, 0.3),
            0 0 20px rgba(139, 92, 246, 0.1),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
    50% { 
        box-shadow: 
            0 0 0 6px rgba(139, 92, 246, 0.2),
            0 0 16px rgba(196, 181, 253, 0.4),
            0 0 28px rgba(139, 92, 246, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.5);
    }
}

@keyframes milestoneGlow {
    0%, 100% {
        box-shadow: 
            0 0 6px rgba(255, 255, 255, 0.8),
            0 0 12px rgba(139, 92, 246, 0.3);
    }
    50% {
        box-shadow: 
            0 0 8px rgba(255, 255, 255, 1),
            0 0 16px rgba(139, 92, 246, 0.4);
    }
}

@keyframes innerGlow {
    0%, 100% {
        background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.3));
    }
    50% {
        background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.4));
    }
}

/* Legacy pulse - keeping for compatibility */
@keyframes pulseGlow {
    0%, 100% { 
        box-shadow: 
            0 0 0 6px rgba(139, 92, 246, 0.2), 
            0 0 16px rgba(196, 181, 253, 0.4),
            0 0 24px rgba(139, 92, 246, 0.1); 
    }
    50% { 
        box-shadow: 
            0 0 0 8px rgba(139, 92, 246, 0.3), 
            0 0 20px rgba(196, 181, 253, 0.6),
            0 0 32px rgba(139, 92, 246, 0.2); 
    }
}

@keyframes progressFill {
    0% { width: 0%; }
    100% { width: var(--target-width); }
}

@keyframes dotTransition {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(var(--target-scale)); }
}

/* Smooth chapter arrow animations */
.mobile-story-container .chapter-nav-arrow {
    will-change: opacity, transform !important;
}

/* Focus states for accessibility */
.mobile-story-container .mobile-story-nav-dot:focus {
    outline: 2px solid rgba(139, 92, 246, 0.6) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(196, 181, 253, 0.3) !important;
}

.mobile-story-container .mobile-story-nav-dot:focus:not(:focus-visible) {
    outline: none !important;
}

.mobile-story-container .chapter-nav-arrow:focus {
    outline: 2px solid rgba(139, 92, 246, 0.6) !important;
    outline-offset: 2px !important;
    opacity: 1 !important;
    transform: scale(1) !important;
    text-shadow: 0 0 12px rgba(139, 92, 246, 0.4) !important;
}

.mobile-story-container .chapter-nav-arrow:focus:not(:focus-visible) {
    outline: none !important;
}

/* Swipe Indicator - Clean & Subtle */
.mobile-swipe-hint {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 2rem) + 90px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.8125rem;
    font-family: var(--font-tertiary, 'Lato', sans-serif);
    font-weight: 500;
    color: rgba(0, 0, 0, 0.4);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    opacity: 1;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
}

.mobile-swipe-hint.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
}

/* Responsive Adjustments - Enhanced for better mobile experience */
@media (max-width: 767px) {
    .mobile-story-container .mobile-story-content,
    body .mobile-story-container .mobile-story-content {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
        padding-top: calc(env(safe-area-inset-top) + 120px) !important; /* Reduced for better spacing balance */
    }
    
    .mobile-story-container .mobile-panel-content p,
    body .mobile-story-container .mobile-panel-content p {
        font-size: 1rem !important; /* Match biography on all devices */
        line-height: 1.7 !important; /* Match biography line height */
        margin-bottom: 1.75rem !important; /* Increased spacing for mobile readability */
    }
    
    .mobile-story-container .mobile-panel-content,
    body .mobile-story-container .mobile-panel-content {
        padding-bottom: 2rem !important; /* Extra bottom padding for mobile */
    }
    
    .mobile-story-container .mobile-story-progress-container,
    body .mobile-story-container .mobile-story-progress-container {
        padding: 0.875rem 1.25rem 1rem !important; /* Reduced bottom padding for even spacing */
    }
    
    /* Responsive segment typography */
    .mobile-story-container .segment-title,
    body .mobile-story-container .segment-title {
        font-size: 0.625rem !important;
    }
    
    .mobile-story-container .mobile-chapter-segment,
    body .mobile-story-container .mobile-chapter-segment {
        min-height: 55px !important;
        padding: 10px 6px !important;
    }
    
    /* Chapter titles consistent sizing */
    .mobile-story-container .mobile-chapter-title,
    body .mobile-story-container .mobile-chapter-title {
        font-size: 1.75rem !important; /* Keep same size */
        margin-bottom: 1.25rem !important;
    }
    
    /* "Life-Changing Discovery" title - 10% smaller */
    .mobile-story-container #mobile-panel-2 .mobile-chapter-title,
    body .mobile-story-container #mobile-panel-2 .mobile-chapter-title {
        font-size: 1.575rem !important; /* 10% smaller */
    }
    
    /* Responsive navigation dots */
    .mobile-story-container .mobile-story-nav-dots,
    body .mobile-story-container .mobile-story-nav-dots {
        padding: 0 1.5rem !important;
        width: 50% !important; /* Maintain 50% width on tablets */
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    .mobile-story-container .mobile-story-nav-dot,
    body .mobile-story-container .mobile-story-nav-dot {
        width: 16px !important;
        height: 16px !important;
    }
    
    .mobile-story-container .mobile-story-nav-dot::after,
    body .mobile-story-container .mobile-story-nav-dot::after {
        width: 5px;
        height: 5px;
    }
    
    /* Mobile-specific height adjustments for better content accommodation */
    .mobile-story-container .mobile-story-panels,
    body .mobile-story-container .mobile-story-panels {
        min-height: 700px !important; /* Increased minimum for mobile/tablet */
        overflow: visible !important; /* Ensure content is never cut off */
    }
    
    /* Title consistent sizing for tablets */
    .mobile-story-container .mobile-chapter-title,
    body .mobile-story-container .mobile-chapter-title {
        font-size: 1.75rem !important; /* Keep same size */
        max-width: calc(100vw - 48px) !important; /* Maximum space with arrows at edges */
    }
    
    
    /* Arrow positioning at absolute screen edges for tablets */
    .mobile-story-container .chapter-nav-arrow.left,
    body .mobile-story-container .chapter-nav-arrow.left {
        left: 0 !important; /* Flush with screen edge */
    }
    
    .mobile-story-container .chapter-nav-arrow.right,
    body .mobile-story-container .chapter-nav-arrow.right {
        right: 0 !important; /* Flush with screen edge */
    }
}

@media (max-width: 480px) {
    .mobile-story-container .mobile-story-content,
    body .mobile-story-container .mobile-story-content {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-top: calc(env(safe-area-inset-top) + 100px) !important; /* Reduced for better spacing balance */
    }
    
    .mobile-story-container .mobile-panel-content p,
    body .mobile-story-container .mobile-panel-content p {
        font-size: 1rem !important; /* Keep consistent with biography */
        line-height: 1.7 !important; /* Match biography line height */
        margin-bottom: 1.5rem !important; /* Increased for small mobile */
    }
    
    .mobile-story-container .mobile-panel-content,
    body .mobile-story-container .mobile-panel-content {
        padding-bottom: 2.5rem !important; /* Extra bottom padding for small mobile */
    }
    
    .mobile-story-container .mobile-story-progress-container,
    body .mobile-story-container .mobile-story-progress-container {
        padding: 0.75rem 1rem 0.75rem !important; /* Reduced bottom padding for even spacing */
    }
    
    /* Compact segments for small phones */
    .mobile-story-container .mobile-chapter-segment,
    body .mobile-story-container .mobile-chapter-segment {
        min-height: 50px !important;
        padding: 8px 4px !important;
    }
    
    .mobile-story-container .segment-number,
    body .mobile-story-container .segment-number {
        font-size: 0.6875rem !important;
    }
    
    .mobile-story-container .segment-title,
    body .mobile-story-container .segment-title {
        font-size: 0.5625rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
    }
    
    /* Chapter titles for small screens */
    .mobile-story-container .mobile-chapter-title,
    body .mobile-story-container .mobile-chapter-title {
        font-size: 1.65rem !important; /* Slightly smaller but still readable */
        margin-bottom: 1rem !important;
    }
    
    
    /* Compact navigation for small screens */
    .mobile-story-container .mobile-story-nav-dots,
    body .mobile-story-container .mobile-story-nav-dots {
        padding: 0 1rem !important;
        height: 20px !important;
        width: 50% !important; /* Maintain 50% width on small screens */
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    .mobile-story-container .mobile-story-nav-dot,
    body .mobile-story-container .mobile-story-nav-dot {
        width: 14px !important;
        height: 14px !important;
    }
    
    .mobile-story-container .mobile-story-nav-dot::after,
    body .mobile-story-container .mobile-story-nav-dot::after {
        width: 4px;
        height: 4px;
    }
    
    .mobile-story-container .mobile-story-nav-dot.active,
    body .mobile-story-container .mobile-story-nav-dot.active {
        transform: scale(1.15) !important;
    }
    
    .mobile-story-container .mobile-story-nav-dot.active::after,
    body .mobile-story-container .mobile-story-nav-dot.active::after {
        width: 6px;
        height: 6px;
    }
    
    /* Small mobile height adjustments for content accommodation */
    .mobile-story-container .mobile-story-panels,
    body .mobile-story-container .mobile-story-panels {
        min-height: 800px !important; /* Even higher minimum for small phones */
        overflow: visible !important; /* Ensure content is never cut off */
    }
    
    /* Maintain arrow visibility on mobile */
    .mobile-story-container .chapter-nav-arrow,
    body .mobile-story-container .chapter-nav-arrow {
        width: 32px !important;
        height: 32px !important;
        font-size: 1.25rem !important; /* Keep good visibility */
    }
    
    /* Title consistent sizing for small phones */
    .mobile-story-container .mobile-chapter-title,
    body .mobile-story-container .mobile-chapter-title {
        font-size: 1.5rem !important; /* Fixed readable size */
        max-width: calc(100vw - 48px) !important; /* Maximum space with arrows at edges */
    }
    
    
    /* Keep arrows at absolute screen edges on small screens */
    .mobile-story-container .chapter-nav-arrow.left,
    body .mobile-story-container .chapter-nav-arrow.left {
        left: 0 !important; /* Flush with screen edge */
    }
    
    .mobile-story-container .chapter-nav-arrow.right,
    body .mobile-story-container .chapter-nav-arrow.right {
        right: 0 !important; /* Flush with screen edge */
    }
}

/* Slide counter removed - cleaner UX */

/* Focus states for accessibility */
.mobile-story-nav-dot:focus {
    outline: 2px solid rgba(139, 92, 246, 0.6);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(196, 181, 253, 0.3);
}

.mobile-story-nav-dot:focus:not(:focus-visible) {
    outline: none;
}

/* Performance optimizations */
.mobile-story-container {
    will-change: transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.mobile-story-panel {
    contain: layout style;
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .mobile-story-tabs {
        background: rgba(0, 0, 0, 0.95);
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    /* Bottom navigation removed */
}