/* 기본 설정 */
html, body {
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans', sans-serif;
    background-color: #f0f4f8;
    color: #333;
    overflow-x: hidden;
}

/* 링크 색상 설정 */
a {
    color: #5c6bc0;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #3949ab;
}

/* Header 스타일 */
.header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 10px;
    background-color: transparent;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.auth-link {
    font-size: 14px;
    text-decoration: none;
    color: #2a5b67;
    font-weight: bold;
    transition: color 0.3s ease;
}

.auth-link:hover {
    color: #3949ab;
}

.lang-select select {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 5px;
    border: 1px solid #ddd;
    background-color: #ffffff;
    color: #333;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.lang-select select:hover {
    background-color: #e6e6e6;
    border-color: #bbb;
}

/* 메인 컨텐츠 */
.main-content {
    text-align: center;
    padding-top: 0px;
    padding-bottom: 40px;
}

.main-image {
    max-width: 100%;
    margin: 20px auto;
    display: flex;
    justify-content: center;
    padding: 0 15px;
}

.main-image img {
    width: 100%;
    max-width: 800px;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.main-image img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* 배너 스타일 */
.banner-swiper {
    width: 100%;
    max-width: 1200px;
    height: 35vh;
    margin: 0 auto 30px auto;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.swiper-button-next,
.swiper-button-prev {
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.5);
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.swiper-pagination {
    bottom: 10px;
    text-align: center;
}

.swiper-pagination-bullet {
    background: #fff;
    opacity: 0.9;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 5px;
}

.swiper-pagination-bullet-active {
    background: #5c6bc0;
    opacity: 1;
}

/* 검색창 스타일 */
.search-container {
    position: relative;
    margin-bottom: 40px;
}

.search-input-wrapper {
    position: relative;
    width: 96%;
    max-width: 600px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    top: 50%;
    left: 15px;
    transform: translateY(-50%);
    font-size: 16px;
    color: #aaa;
}

.main-search {
    width: 100%;
    padding: 15px 20px 15px 40px;
    border-radius: 50px;
    border: 1px solid #ddd;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
    transition: box-shadow 0.3s ease;
}

.main-search:focus {
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}

/* 자동완성 리스트 스타일 */
.suggestions-list {
    list-style: none;
    margin: 5px 0 0 0;
    padding: 0;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 12px 12px;
    background-color: #fff;
    position: absolute;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 1000;
    transition: all 0.3s ease;
}

.suggestions-list li {
    padding: 10px 20px;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.suggestions-list li:last-child {
    border-bottom: none;
}

.suggestions-list li:hover {
    background-color: #f0f4f8;
}

.parent-container {
    text-align: center; /* 부모 요소의 내용을 중앙 정렬 */
}

/* 아이콘 메뉴 */
.icon-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); /* PC에서도 자동 배열 */
    gap: 10px; /* 아이콘 간격 조정 */
    justify-content: center;
    margin: 20px auto; /* 수직 여백 + 가로로 중앙 정렬 */
    width: 50%; /* 전체 폭의 50% */
}

@media (max-width: 768px) {
    .icon-menu {
        display: grid;
        grid-template-columns: repeat(5, 1fr); /* 모바일에서 한 행에 5개 */
        gap: 8px; /* 모바일에서 아이콘 간격 더 좁게 */
        width: 95%; /* 컨테이너 너비 */
        max-width: 400px; /* 최대 너비 설정 */
        margin: 0 auto; /* 좌우 중앙 정렬 */
        justify-content: center; /* 그리드 아이템 중앙 정렬 */
    }

    .icon-item {
        padding: 10px; /* 모바일 아이콘 여백 */
    }

    .icon-item i {
        font-size: 20px; /* 모바일 아이콘 크기 */
    }

    .icon-item span {
        font-size: 12px !important /* 모바일 텍스트 크기 */    
    }

    .icon-label {
        white-space: nowrap; /* 강제 줄바꿈 방지 */
        overflow: hidden;    /* 넘치는 텍스트 숨김 */
        text-overflow: ellipsis; /* 넘칠 경우 말줄임 표시 (...) */
        display: block;      /* 줄바꿈 및 정렬을 위해 블록 설정 */
    }
}

.icon-link {
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    color: inherit;
    text-align: center;
    transition: transform 0.3s ease, color 0.3s ease;
}

.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px;
}

.icon-item i {
    font-size: 24px;
    color: #2a5b67;
    margin-bottom: 10px;
}

.icon-item span {
    font-size: 14px;
    color: #333;
}

.icon-link:hover {
    transform: translateY(-5px);
    color: #2a5b67;
}

/* 검색 결과 섹션 */
.search-result-container {
    display: none;
    margin-top: 40px;
    padding: 10px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.search-info {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 30px;
    text-align: center;
    padding: 15px 0;
    background-color: #ecf0f1;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.search-info strong {
    color: #3498db;
    font-weight: bold;
}

.result-section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 18px;
    color: #2a5b67;
    margin-bottom: 20px;
    border-bottom: 2px solid #2a5b67;
    padding-bottom: 10px;
    text-align: left;
    font-weight: bold;
}

.result-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

@media (max-width: 768px) {
    .result-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .result-list {
        grid-template-columns: repeat(4, 1fr);
    }
}

.result-list li {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    max-width: 100%;
}

.result-list li:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.result-list img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-bottom: 1px solid #ddd;
}

.result-list .card-content {
    padding: 20px;
    text-align: left;
}

.result-list .card-content h4 {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #2c3e50;
}

.result-list .card-content p {
    margin: 0;
    font-size: 1em;
    color: #7f8c8d;
}

.result-list .card-content .address {
    margin-top: 15px;
    font-size: 0.9em;
    color: #95a5a6;
    display: flex;
    align-items: center;
}

.result-list .card-content .address i {
    margin-right: 8px;
    color: #3498db;
}

.clear-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #aaa;
    cursor: pointer;
}

.clear-icon:hover {
    color: #2a5b67;
}

.floating-menu {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    background-color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    border-radius: 30px;
    z-index: 9999;
    padding: 10px 20px;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.floating-menu a {
    text-decoration: none;
    color: #2a5b67;
    text-align: center;
    flex-grow: 1;
    margin: 0 10px;
    transition: transform 0.3s ease, color 0.3s ease;
}

.floating-menu a i {
    display: block;
    font-size: 24px;
    color: #2a5b67;
    margin-bottom: 5px;
    transition: color 0.3s ease;
}

.floating-menu a span {
    font-size: 14px;
    font-weight: bold;
    color: #2a5b67;
    transition: color 0.3s ease;
}

.floating-menu a:hover i {
    color: #2a5b67;
    transform: scale(1.2);
}

.floating-menu a:hover span {
    color: #2a5b67;
}

.floating-menu .reservation-button {
    background-color: #ff5722;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.3s ease;
    flex-grow: 0;
}

.floating-menu .reservation-button:hover {
    background-color: #e64a19;
    transform: scale(1.1);
}

@media screen and (min-width: 1024px) {
    .floating-menu {
        display: flex;
    }
}

@media screen and (max-width: 1023px) {
    .floating-menu {
        display: none;
    }
}

@media (prefers-color-scheme: dark) {
    html, body {
        background-color: #1e1e1e;
        color: #f0f0f0;
    }

    a {
        color: #82aaff;
    }

    a:hover {
        color: #6f87ff;
    }

    .auth-link, .icon-item span, .floating-menu a span {
        color: #82aaff;
    }

    .lang-select select {
        background-color: #333;
        border: 1px solid #444;
        color: #f0f0f0;
    }

    .search-input-wrapper {
        border: 1px solid #444;
    }

    .main-search {
        border: 1px solid #444;
        color: #f0f0f0;
        background-color: #2b2b2b;
    }

    .suggestions-list, .search-result-container, .floating-menu {
        background-color: #2b2b2b;
        color: #f0f0f0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    }

    .search-info {
        background-color: #3a3a3a;
        color: #e0e0e0;
    }

    .section-title, .search-info, .result-list li, .clear-icon, .icon-item i, .icon-item span {
        color: #f0f0f0;
    }

    .floating-menu a i {
        color: #82aaff;
    }

    .floating-menu .reservation-button {
        background-color: #ff865e;
        color: white;
    }

    .floating-menu .reservation-button:hover {
        background-color: #ff5733;
    }
}

/* 기본 병원 리스트 스타일 */
.default-hospital-container {
    margin-top: 40px;
    padding: 10px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.default-section-title {
    font-size: 18px;
    color: #2a5b67    ;
    margin-bottom: 20px;
    border-bottom: 2px solid #2a5b67;
    padding-bottom: 10px;
    text-align: left;
    font-weight: bold;
}

.default-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.default-list li {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
    max-width: 100%;
}

.default-list li:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.default-list img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-bottom: 1px solid #ddd;
}

.default-card-content {
    padding: 20px;
    text-align: left;
}

.default-card-content h4 {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #2c3e50;
}

.default-card-content .default-address {
    margin-top: 15px;
    font-size: 0.9em;
    color: #95a5a6;
    display: flex;
    align-items: center;
}

.default-card-content .default-address i {
    margin-right: 8px;
    color: #3498db;
}

/* 모바일 화면에서 한 행에 두 개씩 표시 */
@media (max-width: 768px) {
    .default-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 메뉴관련 */
.submenu-container {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.submenu {
    display: none; /* 기본적으로 숨김 */
    width: 100%;
    max-width: 1200px;
    text-align: center;
}

.submenu.active {
    display: flex; /* 활성화된 메뉴만 보임 */
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.submenu.nested {
    margin-top: 15px;
    display: none; /* 기본적으로 숨김 */
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    border-top: 1px solid #ddd;
    padding-top: 10px;
}

.submenu.nested.active {
    display: flex; /* 활성화된 메뉴만 보임 */
    max-height: 500px; /* 적절히 큰 값으로 설정 */
}

/* 공통 아이콘 및 텍스트 스타일 */
.submenu a {
    display: flex;
    flex-direction: column; /* 아이콘 위, 텍스트 아래 */
    align-items: center;
    text-decoration: none;
    gap: 5px; /* 아이콘과 텍스트 간격 */
    padding: 15px;
    width: 90px; /* 아이템 크기 균일화 */
    text-align: center;
    border-radius: 10px;
    background-color: #ffffff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
    color: #2a5b67;
}

.submenu a i {
    font-size: 24px; /* 아이콘 크기 */
    color: #2a5b67;
    transition: color 0.3s ease;
}

.submenu a span {
    font-size: 14px; /* 텍스트 크기 */
    color: #2a5b67;
}

.submenu a:hover {
    background-color: #e6f7f9;
    color: #013f4f;
    transform: translateY(-5px); /* 호버 시 살짝 올라감 */
}

.submenu a:hover i {
    color: #013f4f; /* 호버 시 아이콘 색상 */
}

.submenu a:hover span {
    color: #013f4f; /* 호버 시 텍스트 색상 */
}

/* 3차 메뉴 스타일 */
.submenu.nested a {
    font-size: 14px; /* 동일 크기 설정 */
    padding: 10px 15px;
    width: auto; /* 3차 메뉴는 너비 제한 없음 */
    background-color: transparent;
    box-shadow: none;
    border-radius: 0;
}

.submenu.nested a:hover {
    background-color: #f0f4f8; /* 3차 메뉴 호버 시 약간의 배경색 */
    transform: none;
}

/* 모바일 화면 조정 */
@media (max-width: 768px) {
    .submenu a {
        width: 70px; /* 모바일에서 더 작은 너비 */
    }

    .submenu a i {
        font-size: 20px; /* 모바일에서 아이콘 크기 축소 */
    }

    .submenu a span {
        font-size: 12px; /* 모바일에서 텍스트 크기 축소 */
    }
}

.hospital-thumbnail {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 4 / 3;
}