/*
 * D DentalCare - Laser & Implant Centre
 * Custom CSS Companion & Animations (style.css)
 */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-blue: #0ea5e9;
    --primary-blue-dark: #2563eb;
    --primary-pink: #ec4899;
    --primary-pink-dark: #db2777;
    --bg-white: #ffffff;
    --text-slate: #475569;
    --text-dark: #0f172a;
}

/* ==========================================
 * 1. Base Styles & Smooth Scroll
 * ========================================== */
html {
    scroll-behavior: smooth;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-slate);
    background-color: var(--bg-white);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6, .font-serif-elegant {
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.title-serif {
    font-family: 'Playfair Display', serif;
}

/* Custom premium scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f8fafc;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
    border: 3px solid #f8fafc;
}

::-webkit-scrollbar-thumb:hover {
    background: #0ea5e9;
}

/* ==========================================
 * 2. Premium Core Keyframe Animations
 * ========================================== */

/* Floating abstract blobs */
@keyframes float-blob {
    0% {
        transform: translate(0px, 0px) scale(1);
    }
    33% {
        transform: translate(30px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.95);
    }
    100% {
        transform: translate(0px, 0px) scale(1);
    }
}

.animate-blob {
    animation: float-blob 10s infinite ease-in-out;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

/* Pulsing rings for WhatsApp CTA and Emergencies */
@keyframes pulse-ring {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.4);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 15px rgba(14, 165, 233, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(14, 165, 233, 0);
    }
}

@keyframes pulse-ring-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 18px rgba(34, 197, 94, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.animate-pulse-ring {
    animation: pulse-ring 2.5s infinite;
}

.animate-pulse-ring-green {
    animation: pulse-ring-green 2s infinite;
}

/* Smooth Navigation Active Underline */
.nav-underline-anim {
    position: relative;
}

.nav-underline-anim::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: -4px;
    left: 0;
    background: linear-gradient(to right, var(--primary-blue), var(--primary-pink));
    transform-origin: bottom right;
    transition: transform 0.3s ease-out;
}

.nav-underline-anim:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* ==========================================
 * 3. Before/After Interactive Comparison Slider
 * ========================================== */
.ba-slider-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 20px 40px -15px rgba(15, 23, 42, 0.1);
    user-select: none;
    aspect-ratio: 4 / 3;
}

@media (min-width: 768px) {
    .ba-slider-container {
        aspect-ratio: 16 / 10;
    }
}

.ba-before-wrapper, .ba-after-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.ba-before-wrapper img, .ba-after-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ba-after-wrapper {
    clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
}

.ba-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    background-color: #ffffff;
    cursor: ew-resize;
    transform: translateX(-50%);
    z-index: 10;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.ba-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 3px solid var(--primary-blue);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    z-index: 20;
    cursor: ew-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.2s ease-out;
}

.ba-handle:hover {
    background-color: #f0f9ff;
    transform: translate(-50%, -50%) scale(1.1);
}

.ba-handle::before, .ba-handle::after {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
}

.ba-handle::before {
    border-width: 5px 6px 5px 0;
    border-color: transparent var(--primary-blue) transparent transparent;
    margin-right: 4px;
}

.ba-handle::after {
    border-width: 5px 0 5px 6px;
    border-color: transparent transparent transparent var(--primary-blue);
    margin-left: 4px;
}

.ba-label {
    position: absolute;
    bottom: 15px;
    padding: 6px 14px;
    background-color: rgba(15, 23, 42, 0.7);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
    z-index: 5;
    pointer-events: none;
}

.ba-label-before {
    left: 15px;
}

.ba-label-after {
    right: 15px;
}

/* ==========================================
 * 4. Custom Hover Glows & Elevations
 * ========================================== */
.hover-glow {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-glow:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -15px rgba(14, 165, 233, 0.15), 0 0 20px 0 rgba(236, 72, 153, 0.05);
    border-color: rgba(14, 165, 233, 0.2);
}

/* Glassmorphism templates */
.glass-panel {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.glass-panel-dark {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ==========================================
 * 5. Masonry Smile Gallery
 * ========================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    grid-auto-rows: 240px;
    grid-gap: 20px;
}

@media (min-width: 768px) {
    .gallery-item-long {
        grid-row: span 2;
    }
    
    .gallery-item-wide {
        grid-column: span 2;
    }
}

/* Custom transitions for FAQ active heights */
.faq-content {
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Service Detail Modal */
.service-modal-overlay {
    transition: opacity 0.3s ease-out;
}
