/* ==========================================
   DocIndex Endocrino - Landing Page Styles
   Parallax Effects & Smooth Animations
   ========================================== */

/* ==========================================
   CSS Custom Properties
   ========================================== */
:root {
    --primary: #137fec;
    --background-light: #f6f7f8;
    --background-dark: #101922;
    --surface-light: #ffffff;
    --surface-dark: #1e293b;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;

    /* Animation Timing */
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* Parallax Speeds */
    --parallax-slow: 0.3;
    --parallax-medium: 0.5;
    --parallax-fast: 0.7;
}

/* ==========================================
   Base Styles & Smooth Scrolling
   ========================================== */
html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Mobile touch optimization - prevent 300ms double-tap-to-zoom delay */
button,
a,
input[type="submit"],
[role="button"] {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    opacity: 0.3;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    opacity: 0.5;
}

/* Hide scrollbar for chat */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ==========================================
   Glass Navigation
   ========================================== */
.glass-nav {
    background-color: rgba(246, 247, 248, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.dark .glass-nav {
    background-color: rgba(16, 25, 34, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==========================================
   Scroll Progress Indicator
   ========================================== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #60a5fa);
    width: 0%;
    z-index: 100;
    transition: width 0.1s linear;
}

/* ==========================================
   Section Navigation Dots
   ========================================== */
.nav-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.2);
    transition: all 0.3s var(--ease-out-quart);
    cursor: pointer;
}

.dark .nav-dot {
    background: rgba(255, 255, 255, 0.2);
}

.nav-dot:hover {
    background: rgba(0, 0, 0, 0.4);
    transform: scale(1.2);
}

.dark .nav-dot:hover {
    background: rgba(255, 255, 255, 0.4);
}

.nav-dot.active {
    background: var(--primary);
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(19, 127, 236, 0.5);
}

/* ==========================================
   Parallax Sections
   ========================================== */
.parallax-section {
    position: relative;
    will-change: transform;
    transition: opacity 0.6s var(--ease-out-quart);
}

.parallax-content {
    will-change: transform, opacity;
    transform: translateY(0);
    transition: transform 0.1s linear;
}

/* ==========================================
   Fade-In Animations on Scroll
   ========================================== */
.fade-element {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s var(--ease-out-expo),
                transform 0.8s var(--ease-out-expo);
}

.fade-element.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays for child elements */
.fade-element:nth-child(1) { transition-delay: 0s; }
.fade-element:nth-child(2) { transition-delay: 0.1s; }
.fade-element:nth-child(3) { transition-delay: 0.2s; }
.fade-element:nth-child(4) { transition-delay: 0.3s; }
.fade-element:nth-child(5) { transition-delay: 0.4s; }

/* ==========================================
   Scroll Indicator Animation
   ========================================== */
.scroll-indicator {
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* ==========================================
   Typing Dots Animation
   ========================================== */
.typing-dot {
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-6px);
    }
}

/* ==========================================
   Phone Mockup - Problem Section
   ========================================== */
.phone-mockup {
    animation: phoneFloat 6s ease-in-out infinite;
    transform: rotate(-1deg);
    transition: transform 0.5s var(--ease-out-quart);
}

.phone-mockup:hover {
    transform: rotate(0deg);
}

@keyframes phoneFloat {
    0%, 100% {
        transform: rotate(-1deg) translateY(0);
    }
    50% {
        transform: rotate(-1deg) translateY(-10px);
    }
}

/* Chat Messages */
.chat-message {
    opacity: 0;
    transform: translateY(10px);
    animation: chatFadeIn 0.6s var(--ease-out-expo) forwards;
}

.chat-message:nth-child(2) { animation-delay: 0.3s; }
.chat-message:nth-child(3) { animation-delay: 0.8s; }

@keyframes chatFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Wall Highlight Pulse */
.wall-highlight {
    animation: wallPulse 2s ease-in-out infinite;
}

@keyframes wallPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

/* ==========================================
   Solution Section - Data Flow
   ========================================== */
.data-pulse {
    animation: dataPulse 2s ease-in-out infinite;
}

@keyframes dataPulse {
    0% {
        opacity: 0;
        transform: translateY(-50%) translateX(-100%);
    }
    50% {
        opacity: 0.8;
    }
    100% {
        opacity: 0;
        transform: translateY(-50%) translateX(100%);
    }
}

.json-badge {
    animation: jsonFloat 3s ease-in-out infinite;
}

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

.node-circle {
    transition: transform 0.3s var(--ease-out-quart),
                box-shadow 0.3s var(--ease-out-quart);
}

.node-circle:hover {
    transform: scale(1.05);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.15);
}

/* Code Float Animation */
.code-float {
    animation: codeFloat 20s ease-in-out infinite;
}

@keyframes codeFloat {
    0%, 100% {
        transform: rotate(-12deg) translateY(0);
    }
    50% {
        transform: rotate(-12deg) translateY(-10px);
    }
}

/* ==========================================
   Calendar Widget - Value Section
   ========================================== */
.calendar-widget {
    transform-origin: center;
    transition: transform 0.5s var(--ease-out-quart);
}

.calendar-widget:hover {
    transform: scale(1.02);
}

.calendar-day {
    transition: transform 0.2s var(--ease-spring),
                background-color 0.2s ease;
}

.calendar-day:hover {
    transform: scale(1.1);
    background-color: rgba(19, 127, 236, 0.1);
}

.selected-day {
    animation: selectedPulse 2s ease-in-out infinite;
}

/* Booked day - cell highlight animation */
.booked-day {
    position: relative;
    transition: background-color 0.3s var(--ease-out-quart),
                transform 0.2s var(--ease-spring);
}

.booked-day::before {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 9999px;
    background-color: rgba(19, 127, 236, 0.15);
    opacity: 0;
    transform: scale(0.6);
    transition: opacity 0.3s var(--ease-spring), transform 0.3s var(--ease-spring);
}

.dark .booked-day::before {
    background-color: rgba(19, 127, 236, 0.25);
}

.booked-day.visible::before {
    opacity: 1;
    transform: scale(1);
}

/* Appointments counter */
.appointments-counter {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.appointments-counter.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes selectedPulse {
    0%, 100% {
        box-shadow: 0 4px 14px rgba(19, 127, 236, 0.4);
    }
    50% {
        box-shadow: 0 6px 20px rgba(19, 127, 236, 0.6);
    }
}

/* ==========================================
   CTA Buttons
   ========================================== */
.cta-button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s var(--ease-out-quart);
}

.cta-button::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;
}

.cta-button:hover::before {
    left: 100%;
}

.final-cta {
    animation: ctaGlow 3s ease-in-out infinite;
}

@keyframes ctaGlow {
    0%, 100% {
        box-shadow: 0 4px 14px rgba(19, 127, 236, 0.39);
    }
    50% {
        box-shadow: 0 8px 24px rgba(19, 127, 236, 0.5);
    }
}

/* ==========================================
   Parallax Background Elements
   ========================================== */
.parallax-bg {
    position: absolute;
    will-change: transform;
    pointer-events: none;
}

.parallax-bg--slow {
    animation: parallaxDrift 30s ease-in-out infinite;
}

.parallax-bg--medium {
    animation: parallaxDrift 20s ease-in-out infinite reverse;
}

@keyframes parallaxDrift {
    0%, 100% {
        transform: translateY(0) translateX(0);
    }
    25% {
        transform: translateY(-10px) translateX(5px);
    }
    50% {
        transform: translateY(-5px) translateX(-5px);
    }
    75% {
        transform: translateY(-15px) translateX(3px);
    }
}

/* ==========================================
   iOS Blur Effect
   ========================================== */
.ios-blur {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

/* ==========================================
   Perspective for 3D Effects
   ========================================== */
.perspective-1000 {
    perspective: 1000px;
}

/* ==========================================
   Reduced Motion Preferences
   ========================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .parallax-content {
        transform: none !important;
    }

    .fade-element {
        opacity: 1;
        transform: none;
    }
}

/* ==========================================
   Responsive Adjustments
   ========================================== */
@media (max-width: 768px) {
    .parallax-content {
        /* Reduce parallax on mobile for better performance */
        transform: none !important;
    }

    .phone-mockup {
        width: 260px;
        height: 500px;
    }
}

/* ==========================================
   Dark Mode Transitions
   ========================================== */
.dark body {
    transition: background-color 0.3s ease;
}

/* ==========================================
   Material Symbols Filled
   ========================================== */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.filled-icon {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ==========================================
   Smooth Entry Animation for Page Load
   ========================================== */
@keyframes pageEntry {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.parallax-section:first-child .parallax-content {
    animation: pageEntry 0.8s var(--ease-out-expo) forwards;
}

/* ==========================================
   Intersection Observer Trigger Classes
   ========================================== */
.in-view {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* ==========================================
   Shimmer Effect for Buttons
   ========================================== */
@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.shimmer-effect {
    animation: shimmer 2s infinite;
}

/* ==========================================
   Deadline CTA Section - Glass Panel & Timeline
   ========================================== */
.glass-panel {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
}

.dark .glass-panel {
    background: rgba(30, 41, 59, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-track-glow {
    background: linear-gradient(90deg, rgba(19, 127, 236, 0) 0%, rgba(19, 127, 236, 0.3) 50%, rgba(19, 127, 236, 0) 100%);
    filter: blur(4px);
}

.pulse-dot {
    box-shadow: 0 0 0 0 rgba(19, 127, 236, 0.7);
    animation: pulse-blue 2s infinite;
}

@keyframes pulse-blue {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(19, 127, 236, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(19, 127, 236, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(19, 127, 236, 0);
    }
}

.breathing-btn {
    animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
    0% {
        box-shadow: 0 0 15px rgba(19, 127, 236, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 25px rgba(19, 127, 236, 0.6);
        transform: scale(1.01);
    }
    100% {
        box-shadow: 0 0 15px rgba(19, 127, 236, 0.3);
        transform: scale(1);
    }
}
