@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

:root {
    /* Colors */
    --color-primary-navy: #151b2c;
    --color-secondary-blue: #3b72f0;
    --color-accent-gold: #c5a47e;
    --color-text-main: #222222;
    --color-text-white: #ffffff;
    --color-bg-light: #f5f7fa;
    --color-card-gradient-start: #e0edff;
    --color-card-gradient-end: #eff6ff;

    /* Spacing */
    --container-max-width: 600px;
    /* Mobile-first layout constraint as per image aspect */
    --header-height: 60px;
}

@media (min-width: 1024px) {
    :root {
        --container-max-width: 100%;
    }

    body {
        background-color: #ffffff;
    }

    .app-container {
        max-width: 100%;
        box-shadow: none;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background-color: #f0f0f0;
    /* Outer background */
    color: var(--color-text-main);
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

/* Maintain a mobile app-like aspect ratio if viewed on desktop, 
   but fully responsive on mobile */
.app-container {
    width: 100%;
    max-width: var(--container-max-width);
    background-color: #ffffff;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
    overflow-x: hidden;
}

/* Header */
header {
    background-color: var(--color-primary-navy);
    color: var(--color-text-white);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--color-text-white);
    text-decoration: none;
}

.header-icons {
    display: flex;
    gap: 15px;
}

.icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    /* Placeholder shape */
}

/* Footer */
footer {
    background-color: var(--color-primary-navy);
    color: #8890a8;
    padding: 40px 20px;
    font-size: 0.8rem;
    line-height: 1.5;
}

footer .footer-logo {
    color: var(--color-text-white);
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 20px;
    display: block;
}

footer .footer-info p {
    margin-bottom: 8px;
}

footer .sns-links {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

/* Utilities */
.section {
    padding: 40px 20px;
}

.bg-navy {
    background-color: var(--color-primary-navy);
    color: var(--color-text-white);
}

.text-center {
    text-align: center;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
}


.btn-primary {
    background-color: var(--color-accent-gold);
    color: var(--color-text-white);
}

/* --- Icons --- */
.icon-i {
    font-size: 1.2rem;
    color: var(--color-text-white);
    margin-left: 15px;
    cursor: pointer;
}

/* --- Hero Section --- */
.hero-section {
    padding: 60px 20px 40px;
    background: linear-gradient(135deg, var(--color-primary-navy) 0%, #2a3b5e 100%);
    position: relative;
    overflow: hidden;
}

.hero-text {
    position: relative;
    z-index: 2;
    margin-bottom: 30px;
}

.hero-text .sub-title {
    color: var(--color-accent-gold);
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.hero-text h1 {
    font-size: 2rem;
    line-height: 1.3;
    font-weight: 700;
}

.hero-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 30px;
}

.grid-item {
    background-color: #ddd;
    border-radius: 8px;
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
}

.grid-item.img-1 {
    background-image: url('https://via.placeholder.com/300x200/555/fff?text=Exam');
    grid-column: 1 / 3;
}

.grid-item.img-2 {
    background-image: url('https://via.placeholder.com/150x150/777/fff?text=Consult');
}

.grid-item.img-3 {
    background-image: url('https://via.placeholder.com/150x150/888/fff?text=Smile');
}

.hero-stats {
    display: flex;
    gap: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
}

.stat-box {
    display: flex;
    flex-direction: column;
}

.stat-box .count {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-white);
}

.stat-box .label {
    font-size: 0.8rem;
    color: #8890a8;
}

/* --- Common Section Styles --- */
.section-header {
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-secondary-blue);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-title.gold {
    color: var(--color-accent-gold);
}

.section-desc {
    font-size: 1.1rem;
    color: var(--color-text-main);
    font-weight: 600;
    line-height: 1.4;
}

/* --- Doctor Card --- */
.doctor-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.doctor-card {
    background: linear-gradient(100deg, var(--color-card-gradient-start), var(--color-card-gradient-end));
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 10px rgba(59, 114, 240, 0.1);
    position: relative;
    overflow: hidden;
}

.doctor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('path/to/pattern.png');
    /* Pattern overlay if needed */
    opacity: 0.05;
}

.doctor-card.reverse {
    flex-direction: row-reverse;
}

.doc-info {
    z-index: 1;
    flex: 1;
}

.doc-info.text-right {
    text-align: right;
}

.doc-dept {
    font-size: 0.8rem;
    color: var(--color-secondary-blue);
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.doc-name {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.doc-en {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 15px;
}

.doc-logo {
    width: 24px;
    opacity: 0.5;
}

.doc-img-container {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    background-color: #fff;
}

.doc-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Slider Section --- */
.slider-container {
    padding: 20px 0;
}

.ba-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    cursor: ew-resize;
    height: 300px;
}

.ba-slider img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    user-select: none;
}

.img-after {
    display: block;
}

.img-before-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 50%;
    overflow: hidden;
    border-right: 2px solid white;
}

.img-before {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    /* Important: image width needs to match container width to not be squished */
    width: var(--container-max-width);
    max-width: 100vw;
    object-fit: cover;
}

.slider-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background-color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 10;
    pointer-events: none;
    /* Let clicks pass to container */
}

.case-caption {
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    margin-top: 10px;
}

/* --- Interior & Contact --- */
.bg-gray-100 {
    background-color: #f7f8fa;
}

.interior-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
}

.interior-grid img {
    width: 200px;
    height: 140px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    scroll-snap-align: start;
}

.map-placeholder {
    width: 100%;
    height: 200px;
    background-color: #e0e0e0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
    margin-bottom: 20px;
    font-size: 0.9rem;
    gap: 10px;
}

.contact-info p {
    margin-bottom: 6px;
}

.contact-info .closed {
    color: #e74c3c;
    margin-top: 10px;
    font-size: 0.9rem;
}

/* --- Fixed CTA --- */
.fixed-cta {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 560px;
    background-color: var(--color-accent-gold);
    color: white;
    text-align: center;
    padding: 16px;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(197, 164, 126, 0.4);
    z-index: 900;
    transition: transform 0.2s;
}

.fixed-cta:active {
    transform: translateX(-50%) scale(0.98);
}

/* --- Scroll Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Slide from Left */
.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: all 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.active {
    opacity: 1;
    transform: translateX(0);
}

/* Slide from Right */
.reveal-right {
    opacity: 0;
    transform: translateX(60px);
    transition: all 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.active {
    opacity: 1;
    transform: translateX(0);
}

/* Scale Up */
.reveal-scale {
    opacity: 0;
    transform: scale(0.85);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Rotate In */
.reveal-rotate {
    opacity: 0;
    transform: rotate(-5deg) translateY(30px);
    transition: all 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-rotate.active {
    opacity: 1;
    transform: rotate(0) translateY(0);
}

/* Blur In */
.reveal-blur {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-blur.active {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
}

/* Staggered Delay Utilities */
.delay-100 {
    transition-delay: 100ms;
}

.delay-200 {
    transition-delay: 200ms;
}

.delay-300 {
    transition-delay: 300ms;
}

.delay-400 {
    transition-delay: 400ms;
}

.delay-500 {
    transition-delay: 500ms;
}

.delay-600 {
    transition-delay: 600ms;
}

.delay-700 {
    transition-delay: 700ms;
}

.delay-800 {
    transition-delay: 800ms;
}

/* Parallax Effect Class */
.parallax-bg {
    transition: transform 0.1s linear;
}

/* =============================================
   HERO SLIDER ANIMATION SYSTEM
   ============================================= */

/* Base state: all slide children start hidden */
.hero-slide__tag,
.hero-slide__title,
.hero-slide__desc {
    opacity: 0;
    transition-property: opacity, transform, filter;
    transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Default hidden positions --- */
.hero-slide__tag {
    transform: translateY(-12px);
    transition-duration: 0.6s;
}

.hero-slide__title {
    transform: translateX(-30px);
    filter: blur(4px);
    transition-duration: 0.8s;
}

.hero-slide__desc {
    transform: translateY(20px);
    transition-duration: 0.7s;
}

/* --- ENTRANCE: staggered reveal --- */
.hero-slide.is-active .hero-slide__tag {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.1s;
}

.hero-slide.is-active .hero-slide__title {
    opacity: 1;
    transform: translateX(0);
    filter: blur(0);
    transition-delay: 0.25s;
}

.hero-slide.is-active .hero-slide__desc {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.5s;
}

/* --- EXIT: distinct outgoing animation --- */
.hero-slide.is-exiting .hero-slide__tag {
    opacity: 0;
    transform: translateY(10px);
    transition-duration: 0.3s;
    transition-delay: 0s;
}

.hero-slide.is-exiting .hero-slide__title {
    opacity: 0;
    transform: translateX(20px);
    filter: blur(2px);
    transition-duration: 0.4s;
    transition-delay: 0.05s;
}

.hero-slide.is-exiting .hero-slide__desc {
    opacity: 0;
    transform: translateY(14px);
    transition-duration: 0.35s;
    transition-delay: 0.1s;
}

/* --- PROGRESS BAR in indicator dots --- */
@keyframes hero-dot-fill {
    from {
        width: 0%;
    }

    to {
        width: 100%;
    }
}

.hero-dot__fill {
    width: 0%;
    transition: width 0.3s ease;
}

.hero-dot.is-active .hero-dot__fill {
    animation: hero-dot-fill 4s linear forwards;
}

.hero-dot.is-visited .hero-dot__fill {
    width: 100%;
    animation: none;
}

.hero-dot.is-upcoming .hero-dot__fill {
    width: 0%;
    animation: none;
}

/* === Review Card Mobile Fix === */
#review-scroll>div {
    max-width: calc(100vw - 40px);
    overflow-wrap: break-word;
    word-break: keep-all;
}

#review-scroll>div p {
    overflow-wrap: break-word;
    word-break: keep-all;
    white-space: normal;
}

/* 스크롤바 숨기기 */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}