/* 루트 대시보드 전용 고급 스타일링 */
:root {
    --bg-color: #f5f5f7;
    --dark-text: #1d1d1f;
    --card-bg: rgba(255, 255, 255, 0.8);
    --primary: #d8969b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans KR', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--dark-text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    /* 은은한 배경 패턴 */
    background-image: radial-gradient(circle at top right, rgba(216, 150, 155, 0.1) 0%, transparent 40%),
                      radial-gradient(circle at bottom left, rgba(140, 114, 132, 0.1) 0%, transparent 40%);
}

.dashboard-container {
    width: 100%;
    max-width: 1400px; /* Slightly wider but with more padding */
    padding: 2rem 8%; /* Increased horizontal padding */
}

.dashboard-header {
    text-align: center;
    margin-bottom: 4rem;
}

.dashboard-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    color: #2c2930;
}

.dashboard-header p {
    color: #8c7284;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

/* 카드 갤러리 레이아웃 - PC에서 3열 그리드 적용 */
.card-layout {
    display: grid;
    grid-template-columns: 100%;
    justify-content: center; /* 카드들을 가로 중앙에 배치 */
    justify-items: center;   /* 개별 카드 아이템을 셀 안에서 중앙 정렬 */
    gap: 2.5rem;
    perspective: 1000px;
    width: 100%;
}

/* Tablet: 2 columns */
@media (min-width: 768px) {
    .card-layout {
        grid-template-columns: repeat(2, 360px); /* 태블릿 2열 고정 */
    }
}

/* Desktop: 3 columns */
@media (min-width: 1200px) {
    .card-layout {
        grid-template-columns: repeat(3, 360px); /* PC 3열 고정 */
    }
}

/* Entry Card 디자인 (글래스모피즘 + 호버 입체 효과) */
.entry-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 360px;    /* 가로 너비 360px로 최적화 */
    margin: 0 auto;
    text-decoration: none;
    color: inherit;
    background: var(--card-bg);
    border-radius: 2.5rem;
    overflow: hidden;
    height: 550px; /* 560px에서 550px로 최종 축소하여 가장 콤팩트한 비율 확보 */
    width: 360px;  /* 가로 너비는 360px로 고정하여 가로 스크롤 방지 */
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.6);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    transform-style: preserve-3d;
    cursor: pointer;
    /* 렌더링 최적화 및 잔상 방지 속성 */
    will-change: transform, opacity;
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    isolation: isolate;
}

.entry-card:hover {
    transform: translateY(-10px) rotateX(2deg) rotateY(2deg);
    box-shadow: 0 20px 40px rgba(216, 150, 155, 0.2);
}

/* 카드 상단 이미지 영역 */
.card-image {
    width: 100%;
    height: 200px;
    flex-shrink: 0; /* Flex 레이아웃에서 이미지가 압축되는 것을 방지 */
    overflow: hidden;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.entry-card:hover .card-image img {
    transform: scale(1.05);
}

/* 레거시 그라데이션 카드 배경 (사용 안 할 경우 대비) */
.card-bg {
    height: 120px;
    width: 100%;
}
.gradient-viveve {
    background: linear-gradient(135deg, #e3b0b5 0%, #d8969b 100%);
}

.card-content {
    padding: 2.5rem 1.6rem; /* 가로 패딩 미세 조정하여 텍스트 공간 확보 */
    position: relative;
    flex: 1; /* 남은 공간 모두 차지 */
    display: flex;
    flex-direction: column;
    justify-content: center; /* 콘텐츠를 상하 중앙에 모아 공백 제거 */
}

.badge {
    position: absolute;
    top: -20px; /* 위치를 조금 더 위로 보정하여 확실히 이미지 위에 겹치게 함 */
    right: 2rem;
    background: var(--primary);
    color: #fff;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(216, 150, 155, 0.35);
    z-index: 100; /* 배지가 다른 요소에 가려지지 않도록 높은 우선순위 부여 */
    white-space: nowrap;
    letter-spacing: 0.5px;
}

/* 골드 테마 뱃지 (안면거상 카드) */
.badge-gold {
    background: #d4af37;
    color: #1a1a1a;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.card-title-area {
    height: 90px;  /* 110px에서 90px로 축소하여 구분선을 더 위로 바짝 올림 */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    margin-bottom: 5px; /* 여백을 더 줄여 전체적으로 촘촘하게 배치 */
}

.entry-card h2 {
    font-size: 1.5rem; /* 제목이 한 줄에 쾌적하게 들어오도록 폰트 크기 조정 */
    margin-bottom: 12px;
    color: #2c2930;
    line-height: 1.3;
}

.slogan {
    font-size: 1.0rem;
    color: #444;
    font-weight: 500;
    line-height: 1.5;
    word-break: keep-all;
}

.hospital-info {
    border-top: 1px solid rgba(0,0,0,0.05);
    padding-top: 15px; /* 패딩을 약간 줄여 간격을 좁힘 */
    margin-top: 20px;  /* 고정 간격을 부여하여 공백 방지 */
    margin-bottom: 15px;
    height: 100px;    /* 하단 정보 영역의 높이를 고정하여 구분선(border-top) 위치를 완벽하게 통일 */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.hospital-info p {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 5px;
}
.hospital-info .h-name {
    font-weight: 700;
    color: #2c2930;
}
.hospital-info .director {
    color: var(--primary);
    font-weight: 500;
}

.card-footer {
    display: flex;
    justify-content: flex-end;
}

.card-btn {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    transition: transform 0.3s;
    display: inline-block;
}

.card-btn-gold {
    color: #d4af37;
}

.entry-card:hover .card-btn {
    transform: translateX(5px);
}

/* 웹사이트 링크 스타일 */
.website a {
    color: var(--primary);
    text-decoration: underline;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.website a:hover {
    opacity: 0.7;
}

/* 다크 카드 변형 (안면거상) */
.card-dark {
    background: rgba(26, 26, 26, 0.9);
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.card-dark:hover {
    box-shadow: 0 20px 40px rgba(212, 175, 55, 0.2);
}

.card-dark h2 {
    color: #d4af37;
}

.card-dark .slogan {
    color: #ccc;
}

.card-dark .h-name {
    color: #fff !important;
}

.card-dark .director {
    color: #bfa15f !important;
}

.card-dark .phone {
    color: #999 !important;
}

.card-dark .website a {
    color: #bfa15f;
}

.card-dark .hospital-info {
    border-top-color: rgba(255,255,255,0.1);
}

/* 빈(확장 대기용) 카드 디자인 */
.empty-card {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: transparent;
    border: 2px dashed rgba(216, 150, 155, 0.4);
    box-shadow: none;
    min-height: 450px;
    cursor: default;
}

.empty-card:hover {
    transform: none;
    box-shadow: none;
    background: rgba(255,255,255,0.4);
}

.empty-icon {
    font-size: 3rem;
    color: rgba(216, 150, 155, 0.5);
    margin-bottom: 10px;
}

.empty-card h3 {
    color: #8c7284;
    margin-bottom: 10px;
}

.empty-card p {
    color: #aaa;
    font-size: 0.9rem;
}

/* 애니메이션 설정 */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
    will-change: transform, opacity;
}

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

/* AI 테마 카드 변형 (안면거상 AI 최적화) */
.card-ai {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.95) 100%);
    border: 1px solid rgba(99, 152, 255, 0.2);
}

.card-ai:hover {
    box-shadow: 0 20px 40px rgba(99, 152, 255, 0.25);
}

.card-ai h2 {
    color: #93c5fd;
}

.card-ai .slogan {
    color: #cbd5e1;
}

.card-ai .h-name {
    color: #fff !important;
}

.card-ai .director {
    color: #93c5fd !important;
}

.card-ai .phone {
    color: #94a3b8 !important;
}

.card-ai .website a {
    color: #93c5fd;
}

.card-ai .hospital-info {
    border-top-color: rgba(255,255,255,0.1);
}

/* AI 뱃지 스타일 (블루 그라데이션) */
.badge-ai {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* AI 카드 버튼 색상 */
.card-btn-ai {
    color: #93c5fd;
}

/* 반응형 보정: 모바일에서도 디자인의 어긋남 없이 완벽하게 통일 */
@media (max-width: 480px) {
    .card-layout {
        grid-template-columns: 1fr;
        padding: 1rem;
        justify-items: center; /* 모바일에서도 카드가 중앙 정렬되도록 고정 */
    }
    .entry-card {
        width: 360px;  /* 모바일 유동 너비 대신 PC와 같은 360px 고정 (Overflow는 브라우저 기본 대응) */
        max-width: 100%;
        height: 550px; /* PC와 같은 550px 고정 */
    }
    /* 모바일 내부 여백 및 폰트 크기 강제 고정 (PC와 동일 유지) */
    .card-content {
        padding: 3.5rem 1.6rem;
    }
}
/* 플로팅 스크롤 버튼 스타일 */
.floating-scroll-buttons {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

.floating-scroll-buttons button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    color: #555;
}

.floating-scroll-buttons button:hover {
    transform: translateY(-5px) scale(1.1);
    background: #fff;
    color: #2c2930; /* 중립적인 다크 그레이로 변경 */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border-color: rgba(44, 41, 48, 0.2);
}

.floating-scroll-buttons button:active {
    transform: scale(0.95);
}

@media (max-width: 480px) {
    .floating-scroll-buttons {
        bottom: 1.5rem;
        right: 1.5rem;
    }
    .floating-scroll-buttons button {
        width: 45px;
        height: 45px;
    }
}
