/* ===================================
KvTourInfo Widget Styles
根據 UI 設計稿調整
=================================== */

/* 外部樣式 */
body.phpBlogInfo #td_ContentTop {
    position: static !important;
}

/* 共用樣式 */
.kv-tour-list,
.kv-tour-info {
    font-family: "Microsoft JhengHei", "微軟正黑體", Arial, sans-serif;
    display: none; /* 預設隱藏，由 JS 根據頁面類型顯示 */
}

/* ===================================
BlogList 文章列表樣式
=================================== */

.kv-tour-list {
    padding: 20px 0;
}

.tour-list-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.tour-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* 文章卡片 */
.tour-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.tour-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* 卡片頭部 */
.tour-card-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.location-icon {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, #7CB342 0%, #558B2F 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.location-icon svg {
    width: 16px;
    height: 16px;
    fill: white;
}

.tour-card-title {
    flex: 1;
    min-width: 0;
}

.tour-card-title h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 3px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tour-card-title h3 a {
    color: #333;
    text-decoration: none;
}

.tour-card-title h3 a:hover {
    color: #7CB342;
}

.tour-card-location {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: #666;
}

.tour-card-location svg {
    width: 12px;
    height: 12px;
    fill: #666;
    margin-right: 4px;
}

.days-badge {
    background: white;
    border: 2px solid #7CB342;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: #7CB342;
    flex-shrink: 0;
}

.days-badge small {
    font-size: 11px;
    font-weight: normal;
    color: #666;
}

/* 卡片圖片 */
.tour-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.tour-card-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.tour-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.tour-card:hover .tour-card-image img {
    transform: scale(1.05);
}

/* 卡片內容 */
.tour-card-content {
    padding: 15px 20px 20px;
}

.tour-tag-section {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.tour-tag-label {
    background: #fff3e0;
    color: #f57c00;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.tour-tag-type {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.tour-card-description {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 分頁 */
.pagination-wrapper {
    margin-top: 40px;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 10px 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: all 0.3s;
}

.page-btn:hover:not(:disabled) {
    background: #7CB342;
    color: white;
    border-color: #7CB342;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 5px;
}

.page-number {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: all 0.3s;
}

.page-number:hover {
    background: #f5f5f5;
}

.page-number.active {
    background: #7CB342;
    color: white;
    border-color: #7CB342;
}

/* ===================================
BlogInfo 文章詳情樣式
=================================== */

.kv-tour-info {
    background: #f5f5f5;
    min-height: 100vh;
}

.tour-info-container {
    margin: 0 auto;
    background: white;
}

/* 標題區 */
.title-section {
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.title-section::before {
    content: '';
    width: 4px;
    height: 28px;
    background: #7CB342;
    border-radius: 2px;
    flex-shrink: 0;
}

.tour-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
    color: #333;
    flex: 1;
}

/* 圖片輪播 */
.carousel-section {
    position: relative;
}

.carousel-container {
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.carousel-slides {
    display: flex;
    transition: transform 0.5s ease;
    height: 100%;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 輪播下方按鈕區 */
.carousel-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    background: white;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.action-btn.map-btn {
    background: #C5E1A5;
    color: #558B2F;
    border: none;
}

.action-btn.add-btn {
    background: #A5D6A7;
    color: #2E7D32;
    border: none;
}

.action-btn:hover {
    opacity: 0.85;
}

/* 簡介區 */
.intro-section {
    padding: 20px;
    background: white;
}

.intro-text {
    line-height: 1.8;
    color: #555;
    font-size: 15px;
    margin: 0;
}

.intro-text p {
    margin: 0;
}

/* 行程摘要區 */
.itinerary-summary {
    padding: 20px;
    background: #ECEFF1;
    margin: 0 20px;
    border-radius: 12px;
}

.day-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
}

.day-label::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #7CB342;
    border-radius: 50%;
}

.itinerary-brief {
    font-size: 14px;
    color: #666;
    line-height: 1.8;
}

/* 行程詳情區 */
.itinerary-section {
    padding: 20px;
}

.day-section {
    margin-bottom: 30px;
}

/* 行程天數標籤容器 */
.day-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
}

.day-header {
    display: inline-block;
    background: #505D63;
    color: #FBFAF8;
    padding: 12px 28px;
    border-radius: 25px 25px 0 0;
    font-size: 15px;
    font-weight: 600;
    margin-left: 20px;
    margin-bottom: -30px;
    position: relative;
    z-index: 1;
    cursor: pointer;
    transition: all 0.3s;
}

.day-header:last-child {
    margin-right: 0;
}

.day-header.active {
    background: #6ABA01;
    color: #FBFAF8;
    z-index: 1;
}

/* 景點項目 */
.attraction-item {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #FAFAFA;
    border-radius: 20px;
    position: relative;
}

.attraction-image {
    width: 140px;
    height: 140px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.attraction-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attraction-content {
    flex: 1;
    min-width: 0;
    padding-right: 20px;
    text-align: justify;
}

.attraction-header {
    margin-bottom: 8px;
}

.attraction-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.attraction-stay {
    font-size: 13px;
    color: #888;
}

.attraction-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 13px;
    color: #666;
    flex-wrap: wrap;
}

.attraction-description {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    display: -webkit-box;
    line-clamp: 4;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 了解更多連結 */
.attraction-more {
    margin-top: 10px;
}

.more-link {
    color: #6ABA01;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s;
}

.more-link:hover {
    color: #558B2F;
    text-decoration: underline;
}

/* 右側箭頭連結 */
.attraction-arrow-link {
    position: static;
    float: right;
    transition: transform 0.3s;
}

.attraction-arrow-link svg {
    width: 45px;
    height: 42px;
}

/* 相關推薦 */
.related-section {
    padding: 25px 20px;
    background: white;
}

.related-section h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.related-grid {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.related-card {
    flex-shrink: 0;
    width: 160px;
    text-align: center;
}

.related-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.related-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.related-card:hover .related-image img {
    transform: scale(1.05);
}

.related-content {
    padding: 0 5px;
}

.related-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.related-location {
    font-size: 12px;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.related-location::before {
    content: '📍';
    font-size: 10px;
}

.related-days {
    display: none;
}

/* 載入動畫 */
.loading {
    text-align: center;
    padding: 40px;
    font-size: 16px;
    color: #666;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60%,
    100% {
        content: '...';
    }
}

/* 響應式設計 */
@media (max-width: 768px) {
    .tour-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .carousel-container {
        height: 220px;
    }

    .tour-title {
        font-size: 18px;
    }

    .attraction-item {
        flex-direction: column;
    }

    .attraction-image {
        width: 100%;
        height: 180px;
    }

    .attraction-content {
        padding-right: 0;
    }

    .attraction-arrow-link {
        top: auto;
        bottom: 15px;
        right: 15px;
    }

    .related-image {
        width: 100px;
        height: 100px;
    }

    .related-card {
        width: 130px;
    }
}

@media (max-width: 480px) {
    .tour-card-title h3 {
        font-size: 16px;
    }

    .days-badge {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .title-section {
        padding: 15px;
    }

    .tour-title {
        font-size: 16px;
    }
}