/* ===== Custom Styles for Dr. Michael Justin ===== */

/* Base & Typography */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
}

/* Selection Color */
::selection {
    background-color: rgba(123, 45, 59, 0.2);
    color: inherit;
}

/* ===== Navigation ===== */
.nav-link {
    position: relative;
    color: rgba(254, 243, 224, 0.75);
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: #f0c05a;
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: #fde8b8;
}

.nav-link:hover::after {
    width: 100%;
}

/* Scrolled state nav links */
.nav-scrolled .nav-link {
    color: rgba(62, 23, 30, 0.7);
}

.nav-scrolled .nav-link:hover {
    color: #7B2D3B;
}

.nav-scrolled .nav-link::after {
    background: #d4900a;
}

/* Header background transitions */
header {
    transition: background-color 0.5s ease, backdrop-filter 0.5s ease, box-shadow 0.5s ease;
}

header.scrolled {
    background-color: rgba(39, 15, 19, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.3);
}

header.scrolled .nav-link {
    color: rgba(62, 23, 30, 0.7);
}

header.scrolled .nav-link:hover {
    color: #7B2D3B;
}

header.scrolled .nav-link::after {
    background: #d4900a;
}

header.scrolled .mobile-link {
    color: #fde8b8;
}

/* ===== Mobile Menu ===== */
.mobile-link {
    color: #fde8b8;
}

#mobile-menu.open {
    opacity: 1;
    pointer-events: all;
}

/* ===== Service Cards ===== */
.service-card {
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.4s ease,
                border-color 0.4s ease;
}

.service-card:hover {
    transform: translateY(-4px);
}

/* ===== Scroll Reveal Animations ===== */
.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }
.reveal-delay-6 { transition-delay: 0.6s; }

/* ===== Focus Styles ===== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #d4900a;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .service-card:hover {
        transform: none;
    }

    header {
        transition: none;
    }
}

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

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

::-webkit-scrollbar-thumb {
    background: #dbb3bf;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #c48a9a;
}

/* ===== Select Arrow ===== */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237B2D3B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ===== Form Validation ===== */
input:invalid:not(:placeholder-shown):not(:focus),
textarea:invalid:not(:placeholder-shown):not(:focus) {
    border-color: #dc2626;
}

input:valid:not(:placeholder-shown),
textarea:valid:not(:placeholder-shown) {
    border-color: #16a34a;
}

/* ===== Image Loading ===== */
img {
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* ===== Print Styles ===== */
@media print {
    header,
    #site-header,
    .service-card,
    .reveal {
        display: block !important;
        opacity: 1 !important;
        transform: none !important;
    }

    footer {
        background: #270f13 !important;
        color: white !important;
    }
}
