/* =================================== */
/* General & Body Styles             */
/* =================================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
    margin: 0;
    color: #333;
    line-height: 1.6;
    font-size: 16px;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: #007bff;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
    height: auto;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

/* =================================== */
/* Header & Navigation               */
/* =================================== */
header {
    background: #fff;
    border-bottom: 1px solid #eaeaea;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
header .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: none;
}
header .logo:hover {
    text-decoration: none;
    opacity: 0.8;
}

/* [추가] 이미지 로고의 높이를 지정하여 크기를 제어합니다. */
header .logo img {
    height: 50px;
    width: auto;
}

header .logo .fa-ship {
    color: #007bff;
    font-size: 1.8rem;
}
header ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 20px;
}
header ul a {
    color: #555;
    font-weight: 500;
/*    font-size: 1rem; */
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
}
.lang-switcher a {
    margin-left: 0;
    padding: 6px 12px;
    border-radius: 0;
    font-size: 0.9rem;
    color: #495057;
    text-decoration: none;
    background-color: #fff;
    border-left: 1px solid #dee2e6;
    transition: background-color 0.2s;
}
.lang-switcher a:first-child {
    border-left: none;
}
.lang-switcher a:hover {
    background-color: #f8f9fa;
    text-decoration: none;
}
.lang-switcher a.active {
    font-weight: bold;
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}


/* =================================== */
/* Hero Section & Search Form        */
/* =================================== */
.hero {
    background: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url(/images/hero-bg.jpg) no-repeat center center/cover;
    color: #fff;
    padding: 80px 0;
    text-align: center;
}
.hero h1, .hero p {
    text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.5);
}
.hero h1 {
    font-size: 3rem;
    margin-bottom: 10px;
}
.search-form {
    margin-top: 40px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 8px;
    display: flex;
    gap: 15px;
    align-items: flex-end;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.search-form .form-group {
    text-align: left;
}
.search-form label {
    color: #fff;
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
}

.search-form input[type="text"],
.search-form .btn-search {
    padding: 12px;
    font-size: 16px;
    line-height: 1;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
    margin: 0;
    vertical-align: bottom;
}

.search-form .btn-search {
    background: #1abc9c;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    border-color: #1abc9c;
    margin-bottom: 20px;
}
.search-form .btn-search:hover {
    background: #16a085;
    border-color: #16a085;
}


/* =================================== */
/* Card Grids (Routes & Articles)    */
/* =================================== */
.featured-routes {
    padding: 60px 0;
    text-align: center;
}
.featured-routes h2 {
    margin-bottom: 40px;
}
.route-grid,
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}
.route-card,
.article-card {
    border: 1px solid #eaeaea;
    border-radius: 8px;
    overflow: hidden;
    text-align: left;
    color: #333;
    transition: transform 0.3s, box-shadow 0.3s;
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-decoration: none;
}
.route-card:hover,
.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    text-decoration: none;
}
.route-card img,
.article-card-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.route-card-title,
.article-card-content {
    padding: 20px;
}
.article-card-content h3 {
    margin-top: 0;
}
.author-date {
    font-size: 14px;
    color: #666;
}


/* =================================== */
/* General Page & Table Styles       */
/* =================================== */
.page-container {
    padding-top: 40px;
    padding-bottom: 40px;
}
.page-container h1 {
    margin-bottom: 30px;
}
.route-list table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
.route-list th, .route-list td {
    padding: 12px 15px;
    border-bottom: 1px solid #eaeaea;
}
.route-list th {
    background-color: #f8f9fa;
}


/* =================================== */
/* Detail Pages (Route & Article)    */
/* =================================== */
.route-detail-container,
.article-detail-container {
    max-width: 800px;
    margin: 0 auto;
}
.route-detail-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}
.route-detail-info .description {
    margin: 20px 0;
    line-height: 1.8;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.route-detail-info .info-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 1.1rem;
}
.route-detail-info .info-item .fa-solid {
    width: 20px;
    color: #007bff;
    text-align: center;
}
.article-main-image {
    margin: 30px 0;
}
.article-main-image img {
    width: 100%;
    border-radius: 8px;
}
.btn-primary {
    display: inline-block;
    background: #007bff;
    color: #fff;
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
}
.btn-primary:hover {
    background: #0056b3;
    color: #fff;
    text-decoration: none;
}

.article-content {
    line-height: 1.8;
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-size: 16px;
    font-family: inherit;
}
.article-content h1 {
    font-size: 28px;
    text-align: center;
    border-bottom: none;
    margin: 40px 0 20px;
}
.article-content h3 {
    font-size: 22px;
    color: #00a667;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e5e5;
    margin: 50px 0 20px;
    border-left: none;
}
.article-content h3 i {
    margin-right: 10px;
}
.article-content p {
    margin-bottom: 20px;
}
.article-content ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 1.5rem;
}
.article-content ol {
    padding-left: 30px;
    margin-bottom: 1.5rem;
}
.article-content li {
    padding-left: 1.5em;
    margin-bottom: 15px;
    position: relative;
}
.article-content li i.list-icon {
    position: absolute;
    left: 0;
    top: 6px;
    color: #00a667;
}
.article-content b, .article-content strong {
    color: #e85a23;
    font-weight: bold;
}
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 25px 0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.article-content .intro, .article-content .outro, .article-content .final-greeting {
    text-align: center;
    font-size: 18px;
    color: #555;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 30px 0;
    font-style: italic;
    border: 1px solid #eee;
}
.article-content .final-greeting {
    border-top: 1px solid #eee;
    margin-top: 50px;
}


/* =================================== */
/* Reviews Section                   */
/* =================================== */
.reviews-section {
    margin-top: 50px;
}
.reviews-section hr {
    margin-bottom: 40px;
    border: 0;
    border-top: 1px solid #eaeaea;
}
.success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}
.review-card {
    border: 1px solid #eaeaea;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}
.review-rating span {
    font-size: 20px;
    color: #ccc;
}
.review-rating span.filled {
    color: #f5c518;
}
.review-title {
    margin: 10px 0;
}
.review-meta {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}
.review-form-container {
    background-color: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin-top: 40px;
    border: 1px solid #eee;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}
.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
}
.star-rating input[type="radio"] {
    display: none;
}
.star-rating label {
    font-size: 30px;
    color: #ccc;
    cursor: pointer;
}
.star-rating input[type="radio"]:checked ~ label,
.star-rating label:hover,
.star-rating label:hover ~ label {
    color: #f5c518;
}

/* =================================== */
/* Pagination                        */
/* =================================== */
.pagination {
    margin-top: 40px;
    text-align: center;
}
.pagination a {
    color: #007bff;
    padding: 8px 16px;
    text-decoration: none;
    border: 1px solid #ddd;
    margin: 0 4px;
    border-radius: 4px;
    transition: background-color .3s;
}
.pagination a.active {
    background-color: #007bff;
    color: white;
    border: 1px solid #007bff;
}
.pagination a:hover:not(.active) {
    background-color: #f0f0f0;
}

/* =================================== */
/* Footer (개선)                     */
/* =================================== */
footer {
    background-color: #343a40;
    color: #adb5bd;
    padding: 50px 0 0;
    margin-top: 60px;
    font-size: 0.9rem;
}

.footer-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
}

.footer-column h3 {
    color: #ffffff;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.footer-column p {
    line-height: 1.7;
}

.footer-column ul {
    list-style: none;
    padding: 0;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column a {
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-column a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.footer-bottom {
    background-color: #212529;
    padding: 20px 0;
    text-align: center;
    font-size: 0.85rem;
}

.footer-bottom p {
    margin: 0;
}


/* =================================== */
/* Affiliate Items Box Styles        */
/* =================================== */
.affiliate-items-section {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #eaeaea;
}
.affiliate-items-section h3 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 40px;
}
.affiliate-item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
.affiliate-item-card {
    border: 1px solid #eaeaea;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s, transform 0.3s;
}
.affiliate-item-card:hover {
    text-decoration: none;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}
.affiliate-item-card .item-image {
    padding: 10px;
}
.affiliate-item-card .item-image img {
    width: 100%;
    height: 180px;
    object-fit: contain; /* 로고나 상품 이미지가 잘리지 않도록 */
}
.affiliate-item-card .item-info {
    padding: 20px;
    border-top: 1px solid #eaeaea;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.item-category {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 5px;
}
.item-name {
    font-size: 1rem;
    font-weight: bold;
    margin: 0 0 10px 0;
}
.item-description {
    font-size: 0.9rem;
    color: #555;
    flex-grow: 1; /* 설명이 길든 짧든 버튼을 맨 아래에 위치시킴 */
}
.item-button {
    display: inline-block;
    margin-top: 15px;
    color: #007bff;
    font-weight: bold;
}
.affiliate-disclosure {
    text-align: center;
    font-size: 0.8rem;
    color: #888;
    margin-top: 40px;
}


/* =================================== */
/* [추가] 새로운 언어 드롭다운 스타일     */
/* =================================== */
.language-dropdown {
    position: relative; /* 드롭다운 메뉴의 기준점이 됨 */
}

.language-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

.language-dropdown-toggle:hover {
    background-color: #e9ecef;
}

.language-dropdown-toggle .fa-chevron-down {
    font-size: 0.7rem;
    opacity: 0.7;
}

.language-dropdown-menu {
    display: none; /* 기본적으로 숨김 */
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 150px;
    z-index: 110; /* 헤더보다 위에 표시 */
}

.language-dropdown-menu a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
}

.language-dropdown-menu a:hover {
    background-color: #f8f9fa;
}

.language-dropdown-menu a.active {
    font-weight: bold;
    color: #007bff;
    background-color: #eef7ff;
}

/* =================================== */
/* [추가] 콘텐츠 섹션 디자인 개선        */
/* =================================== */
.content-section {
    padding-top: 40px;
    margin-top: 40px;
    border-top: 1px solid #eaeaea; /* 기존 hr 태그를 대체하는 상단 구분선 */
}

/* 추천 상품 박스 제목과 겹치지 않도록 스타일 조정 */
.affiliate-items-section h3 {
    text-align: left;
    font-size: 1.8rem;
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 리뷰 헤더의 제목과 버튼 정렬 */
.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.reviews-header .section-title {
    margin-bottom: 0; /* 헤더 안에서는 제목의 하단 마진 제거 */
}

/* Summernote CSS 충돌로 인한 불필요한 바 제거 */
.note-editor.note-frame, .note-popover .popover-content {
    border-color: #dee2e6; /* 바 색상을 더 연하게 조정 */
}
body > .note-popover {
    display: none !important; /* 화면 상단에 고정되는 툴바 강제 숨김 */
}


/* =================================== */
/* [추가] 콘텐츠 섹션 디자인 개선        */
/* =================================== */
.content-section {
    padding-top: 40px;
    margin-top: 40px;
    border-top: 1px solid #eaeaea;
}
.affiliate-items-section h3 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.section-title {
    font-size: 1.8rem;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.reviews-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.reviews-header .section-title {
    margin-bottom: 0;
}

/* ============================================= */
/* [추가] Summernote CSS 충돌 최종 해결            */
/* ============================================= */
.modal-backdrop {
    display: none !important;
}
.note-editor .note-modal {
     z-index: 1050;
}
.note-editor .note-dialog {
    z-index: 1060;
}
/* 헤더와 Summernote 충돌 방지 */
header {
    z-index: 1040 !important; /* Summernote 팝업보다 낮게 설정 */
}
/* =================================== */
/* Responsive Design (Mobile)        */
/* =================================== */
@media (max-width: 768px) {

    .container {
        padding: 0 15px;
    }

    h1 {
        font-size: 2rem;
    }

    header nav {
        flex-direction: column;
        gap: 15px;
    }

    .search-form {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form input[type="text"] {
        width: 100%;
    }

    .route-grid,
    .article-grid {
        grid-template-columns: 1fr;
    }

    .route-list table,
    .route-list thead,
    .route-list tbody,
    .route-list th,
    .route-list td,
    .route-list tr {
        display: block;
    }

    .route-list thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .route-list tr {
        border: 1px solid #ddd;
        margin-bottom: 15px;
        border-radius: 5px;
        overflow: hidden;
    }

    .route-list td {
        border: none;
        border-bottom: 1px solid #eee;
        position: relative;
        padding: 10px 10px 10px 50%;
        text-align: right;
    }

    .route-list td:last-child {
        border-bottom: 0;
    }

    .route-list td:before {
        content: attr(data-label);
        position: absolute;
        top: 10px;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        font-weight: bold;
        text-align: left;
    }

    .route-detail-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .review-form-container {
        padding: 20px;
    }

    .pagination a {
        padding: 6px 12px;
        margin: 0 2px;
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
}
