/* ==========================================================================
   Olivia Gomes Psicología - Mobile-First Redesign & Touch Optimization
   ========================================================================== */

/* Design Tokens & Custom Variables */
:root {
    --primary: #475b4c;
    --primary-container: #5f7464;
    --on-primary-container: #e2f9e5;
    --deep-forest: #3E4C41;
    --secondary: #705b3e;
    --secondary-container: #fbdeb9;
    --tertiary: #425a62;
    --tertiary-container: #5a737a;
    --background: #fbf9f7;
    --calm-ink: #2D312E;
    --warm-stone: #7E766F;
    --soft-clay: #EBE2D9;
    
    --font-serif: 'Outfit', system-ui, sans-serif;
    --font-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
    
    --shadow-soft: 0 10px 30px -10px rgba(95, 116, 100, 0.08), 0 1px 3px rgba(95, 116, 100, 0.03);
    --shadow-medium: 0 20px 40px -15px rgba(95, 116, 100, 0.12), 0 2px 8px rgba(95, 116, 100, 0.04);
    --shadow-premium: 0 30px 60px -20px rgba(62, 76, 65, 0.15), 0 4px 20px -5px rgba(62, 76, 65, 0.05);
}

/* Base Settings - Mobile First */
html {
    scroll-behavior: smooth;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent default tap highlight color on mobile */
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--background);
    color: var(--calm-ink);
    font-family: var(--font-sans);
    overflow-x: hidden;
    /* Safeguard bottom area on modern iPhones with home indicators */
    padding-bottom: env(safe-area-inset-bottom, 24px);
}

/* Custom Typography Helpers */
.font-serif-brand { font-family: var(--font-serif); }
.font-sans-brand { font-family: var(--font-sans); }

/* Premium Glassmorphism */
.glass-panel {
    background: rgba(251, 249, 247, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(235, 226, 217, 0.5);
}

.glass-panel-dark {
    background: rgba(45, 49, 46, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(235, 226, 217, 0.1);
}

/* Mobile Bottom TabBar */
.tabbar-mobile {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    height: 64px;
    z-index: 90;
    border-radius: 9999px;
    box-shadow: 0 8px 32px rgba(62, 76, 65, 0.12);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    will-change: transform, opacity;
}

/* SafeArea support for TabBar */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .tabbar-mobile {
        bottom: calc(16px + env(safe-area-inset-bottom));
    }
}

.tabbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    color: var(--warm-stone);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    height: 100%;
    transition: color 0.25s ease;
}

.tabbar-item.active {
    color: var(--primary);
}

.tabbar-item .material-symbols-outlined {
    font-size: 24px;
    margin-bottom: 2px;
    font-variation-settings: 'FILL' 0, 'wght' 400;
    transition: font-variation-settings 0.25s ease, transform 0.25s ease;
}

.tabbar-item.active .material-symbols-outlined {
    font-variation-settings: 'FILL' 1, 'wght' 500;
    transform: scale(1.05);
}

/* Horizontal Swipe Carousel Layout */
.carrusel-snap-x {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    gap: 16px;
    padding-bottom: 12px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}

.carrusel-snap-x::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.carrusel-item {
    flex-shrink: 0;
    scroll-snap-align: center;
    will-change: transform;
}

/* Page Dot Indicators for Carousels */
.carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--soft-clay);
    transition: all 0.3s ease;
}

.carousel-dot.active {
    width: 18px;
    background-color: var(--primary);
    border-radius: 9999px;
}

/* Bottom Sheet layout for mobile modals */
@media (max-width: 767px) {
    .bottom-sheet-mobile {
        position: fixed;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        top: auto !important;
        transform: translateY(100%);
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 1.5rem 1.5rem 0 0 !important;
        max-height: 92dvh !important;
        animation: sheetSlideUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.1) forwards !important;
    }
    
    @keyframes sheetSlideUp {
        from { transform: translateY(100%); }
        to { transform: translateY(0); }
    }
    
    .bottom-sheet-overlay {
        align-items: flex-end !important;
    }
}

/* GPU Accelerated Smooth Revelations */
.reveal-element {
    opacity: 0;
    transform: translate3d(0, 16px, 0);
    transition: opacity 0.75s cubic-bezier(0.16, 1, 0.3, 1), transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.reveal-element.active {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

/* Modals Animation Keyframes */
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalScaleUp {
    from { transform: scale(0.97) translate3d(0, 10px, 0); opacity: 0; }
    to { transform: scale(1) translate3d(0, 0, 0); opacity: 1; }
}

.modal-overlay {
    animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-content {
    animation: modalScaleUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Immersive Blog Reader Styles - Dynamic Heights */
.immersive-reader-container {
    max-width: 720px;
    margin: 0 auto;
    font-family: var(--font-sans);
}

.immersive-reader-text {
    font-family: var(--font-serif);
    line-height: 1.9;
    font-size: 1.15rem;
    color: var(--calm-ink);
}

.immersive-reader-text p {
    margin-bottom: 1.85rem;
    letter-spacing: -0.002em;
}

.immersive-reader-text h2 {
    font-family: var(--font-serif);
    font-weight: 500;
    color: var(--primary);
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    font-size: 1.65rem;
    line-height: 1.35;
}

.immersive-reader-text h3 {
    font-family: var(--font-serif);
    font-weight: 500;
    color: var(--primary-container);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.35rem;
    line-height: 1.35;
}

.immersive-reader-text blockquote {
    border-left: 3px solid var(--primary);
    padding-left: 1.25rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--primary-container);
    font-size: 1.25rem;
}

/* Typography Custom Sizes Controls for Reader */
.reader-size-sm .immersive-reader-text { font-size: 1.05rem; }
.reader-size-md .immersive-reader-text { font-size: 1.2rem; }
.reader-size-lg .immersive-reader-text { font-size: 1.35rem; }

/* Custom Premium Buttons Styles */
.btn-premium-primary {
    background-color: var(--primary);
    color: #ffffff;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 14px rgba(71, 91, 76, 0.15);
}

.btn-premium-primary:hover {
    background-color: var(--deep-forest);
    transform: translate3d(0, -2px, 0);
}

/* Multi-step appointment modal calendar active states */
.calendar-day-btn {
    transition: all 0.2s ease;
}

.calendar-day-btn:hover:not(:disabled) {
    background-color: var(--soft-clay);
    color: var(--calm-ink);
}

.calendar-day-btn.active {
    background-color: var(--primary) !important;
    color: #ffffff !important;
    font-weight: bold;
}

/* Scroll Progress Bar */
.scroll-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--secondary) 0%, var(--primary) 100%);
    width: 0%;
    z-index: 100;
    transition: width 0.1s ease-out;
}

/* Hide scrollbar helper */
.scrollbar-none::-webkit-scrollbar {
    display: none;
}
.scrollbar-none {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ==========================================================================
   Olivia Gomes - Premium Transitions & Organic Calming Animations
   ========================================================================== */

/* Floating Organic Blobs (Calming Nervous System Waves) */
.blob-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.blob-organic {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.07;
    will-change: transform;
    pointer-events: none;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

.blob-1 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, var(--primary) 0%, rgba(251, 249, 247, 0) 70%);
    top: -10%;
    right: -10%;
    animation: floatSlow 28s infinite alternate cubic-bezier(0.45, 0, 0.55, 1);
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--soft-clay) 0%, rgba(251, 249, 247, 0) 70%);
    bottom: 5%;
    left: -15%;
    animation: floatSlowReverse 32s infinite alternate cubic-bezier(0.45, 0, 0.55, 1);
}

.blob-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--secondary-container) 0%, rgba(251, 249, 247, 0) 70%);
    top: 40%;
    right: -10%;
    opacity: 0.05;
    animation: floatSlow 25s infinite alternate cubic-bezier(0.45, 0, 0.55, 1);
}

@keyframes floatSlow {
    0% {
        transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
    }
    50% {
        transform: translate3d(40px, 60px, 0) rotate(90deg) scale(1.1);
    }
    100% {
        transform: translate3d(-30px, 30px, 0) rotate(180deg) scale(0.95);
    }
}

@keyframes floatSlowReverse {
    0% {
        transform: translate3d(0, 0, 0) rotate(0deg) scale(0.95);
    }
    50% {
        transform: translate3d(-50px, -40px, 0) rotate(-120deg) scale(1.05);
    }
    100% {
        transform: translate3d(20px, 50px, 0) rotate(-240deg) scale(1);
    }
}

/* Elegant Card Micro-Interactions */
.card-interactive {
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.6s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, box-shadow, border-color;
}

.card-interactive:hover {
    transform: translate3d(0, -6px, 0);
    box-shadow: 0 20px 35px -10px rgba(71, 91, 76, 0.12), 0 4px 12px -2px rgba(71, 91, 76, 0.04);
    border-color: rgba(71, 91, 76, 0.25) !important;
}

/* Image Zoom Hover effect */
.image-zoom-container {
    overflow: hidden;
}

.image-zoom-container img {
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}

.card-interactive:hover .image-zoom-container img,
.group:hover .image-zoom-container img {
    transform: scale(1.04) translate3d(0, 0, 0);
}

/* Staggered entrance delay utilities */
.reveal-delay-100 { transition-delay: 100ms !important; }
.reveal-delay-200 { transition-delay: 200ms !important; }
.reveal-delay-300 { transition-delay: 300ms !important; }
.reveal-delay-400 { transition-delay: 400ms !important; }
.reveal-delay-500 { transition-delay: 500ms !important; }

/* Scale reveal */
.reveal-scale {
    opacity: 0;
    transform: scale(0.96) translate3d(0, 10px, 0);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity;
}
.reveal-scale.active {
    opacity: 1;
    transform: scale(1) translate3d(0, 0, 0);
}

/* Simple Fade reveal */
.reveal-fade {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity;
}
.reveal-fade.active {
    opacity: 1;
}

/* Hide on scroll helper for Mobile TabBar */
.tabbar-hidden {
    transform: translate3d(0, calc(100% + 40px), 0) !important;
    opacity: 0;
}

/* Hero Text Reveal */
.hero-title-reveal {
    overflow: hidden;
}
.hero-title-reveal span {
    display: inline-block;
    transform: translate3d(0, 100%, 0);
    animation: heroTextReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.hero-title-reveal:nth-child(2) span {
    animation-delay: 150ms;
}

@keyframes heroTextReveal {
    to {
        transform: translate3d(0, 0, 0);
    }
}

/* Immersive Reader Overlay transition */
#immersiveReaderModal {
    opacity: 0;
    transform: scale(0.97) translate3d(0, 10px, 0);
    transition: opacity 0.45s cubic-bezier(0.16, 1, 0.3, 1), transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
#immersiveReaderModal.reader-active {
    opacity: 1;
    transform: scale(1) translate3d(0, 0, 0);
}
