/* ==========================================================================
   Очирт Мед Уламжлалт Анагаах Ухааны Эмнэлэг - Custom Stylesheet
   ========================================================================== */

:root {
    --primary-emerald: #14532d;   /* гүн ногоон — үндсэн */
    --emerald-accent:  #15803d;
    --emerald-light:   #f0fdf4;
    --amber-gold:      #c98a2c;   /* алтлаг — өргөлт */
    --amber-light:     #fdf8eb;
    --bg-cream:        #faf8f5;   /* цөцгий — дэвсгэр */
    --text-main:       #292524;
    --text-muted:      #78716c;
}

/* Global Smooth Scroll & Font Settings */
html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

/* Base Body Styles (Хэвтээ гүйлтийн шалтгааныг арилгасан тул overflow-x: hidden авав) */
body {
    background-color: var(--bg-cream);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
}

/* Base Image & Media Responsive Rules */
img, svg, video, canvas, audio, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

/* Custom Accessible Focus States (WCAG 2.1 AA) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--primary-emerald);
    outline-offset: 2px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f5f2eb;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Glassmorphism Classes */
.glass-header {
    background: rgba(250, 248, 245, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.glass-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

/* Custom Glows & Shadows */
.shadow-glow-emerald {
    box-shadow: 0 0 35px -5px rgba(22, 101, 52, 0.2);
}

.shadow-glow-gold {
    box-shadow: 0 0 30px -5px rgba(201, 138, 44, 0.25);
}

/* Mobile Input Styling: Prevent iOS Auto-Zoom */
@media screen and (max-width: 767px) {
    input[type="text"],
    input[type="tel"],
    input[type="email"],
    input[type="date"],
    input[type="password"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ==========================================================================
   Responsive Card View for Admin Appointments Table on Mobile (< 768px)
   ========================================================================== */
@media screen and (max-width: 767px) {
    #admin-dashboard table,
    #admin-dashboard tbody,
    #admin-dashboard tr,
    #admin-dashboard td {
        display: block;
        width: 100%;
    }

    /* thead-ийг дэлгэц уншигчид хадгалж, харагдах байдлаар нуух (display: none ашиглахгүй) */
    #admin-dashboard thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
        border: 0;
    }

    #appointments-tbody tr {
        background-color: #ffffff;
        border: 1px solid #e7e5e4;
        border-radius: 1.25rem;
        padding: 1rem;
        margin-bottom: 1rem;
        box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.05);
    }

    #appointments-tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.625rem 0;
        border-bottom: 1px dashed #f5f5f4;
        text-align: right;
    }

    #appointments-tbody td:last-child {
        border-bottom: none;
        padding-bottom: 0;
        justify-content: flex-end;
    }

    #appointments-tbody td:first-child {
        padding-top: 0;
    }

    #appointments-tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: #78716c;
        text-align: left;
        margin-right: 1rem;
        flex-shrink: 0;
    }

    #appointments-tbody td[data-label="Зовиур"] {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    #appointments-tbody td[data-label="Зовиур"]::before {
        margin-bottom: 0.25rem;
    }
}

/* Animated Pulse Effect for Live Badges */
@keyframes softPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.75;
        transform: scale(1.03);
    }
}

.animate-soft-pulse {
    animation: softPulse 3s infinite ease-in-out;
}

/* FAQ Accordion Transitions */
.faq-toggle svg {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.faq-toggle.active svg {
    transform: rotate(180deg);
}

/* Subtle Card Hover Effects */
.service-card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 30px -10px rgba(20, 83, 45, 0.08);
}

/* Responsive adjustment for date picker icon */
input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    filter: invert(0.2) sepia(0.5) saturate(5) hue-rotate(90deg);
    padding: 4px;
}

/* Accessibility: Respect 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;
        scroll-behavior: auto !important;
    }
}

/* --------------------------------------------------------------------------
   Гарчгийн онцлох зураас.
   Өмнө нь text-decoration: wavy байсан нь браузерын зөв бичгийн АЛДААНЫ
   тэмдэглэгээтэй яг ижил харагддаг тул хэрэглэгчид алдаа мэт ойлгогдож
   байсан. Оронд нь маркераар татсан мэт цэвэр шугам ашиглав.
   -------------------------------------------------------------------------- */
.brush-underline {
    background-image: linear-gradient(to right,
        rgba(201, 138, 44, 0.75), rgba(201, 138, 44, 0.95));
    background-repeat: no-repeat;
    background-size: 100% 0.14em;
    background-position: 0 96%;
    padding-bottom: 0.08em;
}
