/* ==========================================
   DENTAL CORNELIO2 — Custom Styles
   ========================================== */

:root {
    --olive-50: #f7f8f3;
    --olive-100: #eef0e4;
    --olive-200: #d9dfc5;
    --olive-300: #bcc69e;
    --olive-400: #9baa74;
    --olive-500: #7d8f54;
    --olive-600: #627240;
    --olive-700: #4d5935;
    --olive-800: #3f482d;
    --olive-900: #363e28;
    --olive-950: #1b2013;
    --gold-400: #ddb666;
    --gold-500: #d4a04a;
    --cream: #faf9f5;
}

/* ---- Smooth scrolling ---- */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 5rem;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--cream);
}
::-webkit-scrollbar-thumb {
    background: var(--olive-300);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--olive-500);
}

/* ---- Hero grain texture ---- */
.hero-grain {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    background-repeat: repeat;
}

/* ---- Navbar transitions ---- */
#navbar {
    background: transparent;
}
#navbar.scrolled {
    background: rgba(250, 249, 245, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 3px rgba(27, 32, 19, 0.06), 0 4px 20px rgba(27, 32, 19, 0.04);
}
#navbar.scrolled .font-display {
    color: var(--olive-800);
}

/* ---- Animations ---- */
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(3deg); }
}
@keyframes float-delayed {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(-2deg); }
}
@keyframes bounce-slow {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(8px); }
}
@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(1.8); opacity: 0; }
}

.animate-float {
    animation: float 8s ease-in-out infinite;
}
.animate-float-delayed {
    animation: float-delayed 10s ease-in-out infinite 2s;
}
.animate-bounce-slow {
    animation: bounce-slow 3s ease-in-out infinite;
}

/* ---- WhatsApp pulse ---- */
.whatsapp-pulse {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    border: 3px solid #22c55e;
    animation: pulse-ring 2s ease-out infinite;
}

/* ---- Scroll reveal animations ---- */
@keyframes revealUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes revealLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes revealRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

.reveal-up, .reveal-left, .reveal-right {
    opacity: 0;
}
.reveal-up.revealed {
    animation: revealUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.reveal-left.revealed {
    animation: revealLeft 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.reveal-right.revealed {
    animation: revealRight 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ---- Gallery tabs ---- */
.gallery-tab {
    background: var(--olive-100);
    color: var(--olive-600);
}
.gallery-tab:hover {
    background: var(--olive-200);
    color: var(--olive-800);
}
.gallery-tab.active {
    background: var(--olive-700);
    color: white;
    box-shadow: 0 4px 12px rgba(77, 89, 53, 0.3);
}

/* ---- Lightbox ---- */
#lightbox {
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
#lightbox.active {
    display: flex;
    opacity: 1;
    pointer-events: all;
}
#lightbox img {
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
#lightbox.active img {
    transform: scale(1);
}

/* ---- Form select styling ---- */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='%239baa74'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 3rem;
}

/* ---- Focus visible outlines ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--olive-500);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---- Service card subtle glow on hover ---- */
.service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 1rem;
    background: radial-gradient(circle at 50% 0%, var(--olive-200), transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}
.service-card:hover::before {
    opacity: 0.5;
}

/* ---- Responsive adjustments ---- */
@media (max-width: 640px) {
    .font-display {
        letter-spacing: -0.01em;
    }
}

/* ---- Selection color ---- */
::selection {
    background: var(--olive-200);
    color: var(--olive-900);
}
