/* 地點模態框樣式 - 修正版 */

.place-modal {
    position: fixed;
    top: 0;
    left: 0;
    /* width: 100%;
    height: 100%; */
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.place-modal .uk-modal-dialog {
    width: 700px;
    height: auto;
    border-radius: 12px;
    overflow: hidden;
}

.place-modal.show {
    opacity: 1;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

.modal-dialog {
    position: relative;
    margin: 20px auto;
    max-width: 600px;
    max-height: calc(100vh - 40px);
    z-index: 1001;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: calc(100vh - 40px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-height: 100%;
    overflow-y: auto;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.place-modal.show .modal-content {
    transform: translateY(0);
}

/* 地點標題區域 */
.place-header {
    position: relative;
    background: #f8f9fa;
}

.place-images-container {
    position: relative;
    overflow: hidden;
}

/* 圖片輪播樣式 */
.place-images-container .uk-slider-items {
    height: 100%;
}

.place-images-container .uk-slider-items > li,
.place-images-container .uk-slider-items > div {
    height: 100%;
}

.place-images-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 無圖片佔位符 */
.no-photo-placeholder {
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    flex-direction: column;
    color: #999;
}

.no-photo-placeholder .material-symbols-outlined {
    font-size: 48px;
    margin-bottom: 12px;
}

/* 圖片計數器 */
.image-counter {
    display: none;
    /* position: absolute;
    bottom: 100px;
    right: 16px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500; */
}

/* 覆蓋層資訊 */
.place-header-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 24px 20px 20px;
    pointer-events: none;
}

/* 評分顯示 */
.rating-display {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 0;
}

.rating-number {
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.rating-stars {
    display: flex;
    align-items: center;
    gap: 2px;
}

.rating-stars .star {
    font-size: 16px;
    color: #ffc107;
}

.rating-stars .star.empty {
    color: rgba(255, 255, 255, 0.3);
}

.rating-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

/* 類別標籤 */
.category-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.category-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
}

.animal-type-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background-color: #28a745;
    color: white;
}

/* 類別顏色 */
.category-restaurant { background-color: rgba(255, 107, 107, 0.9); }
.category-cafe { background-color: rgba(78, 205, 196, 0.9); }
.category-veterinary { background-color: rgba(69, 183, 209, 0.9); }
.category-pet_shop { background-color: rgba(150, 206, 180, 0.9); }
.category-grooming { background-color: rgba(255, 234, 167, 0.9); color: #333; }
.category-hotel { background-color: rgba(221, 160, 221, 0.9); }
.category-park { background-color: rgba(152, 216, 200, 0.9); }
.category-other { background-color: rgba(108, 117, 125, 0.9); }

/* 關閉按鈕 */
.modal-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 8px;
    border-radius: 50%;
    transition: background-color 0.2s;
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
}

.modal-close-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* 地點資訊區域 */
.place-info-body {
    padding: 15px;
}
.place-info-section {
    margin-bottom: 24px;
}

.place-info-row {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.place-info-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.place-info-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.place-info-icon .material-symbols-outlined {
    font-size: 20px;
    color: #007bff;
}

.place-info-content {
    flex: 1;
    min-width: 0;
}

.place-info-label {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.place-info-value {
    font-size: 14px;
    color: #333;
    line-height: 1.5;
    word-break: break-word;
}

.place-name-value {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

/* 操作按鈕網格 */
.action-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin: 24px 0;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    background: white;
    color: #333;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
    text-decoration: none;
}

.action-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e2e6ea;
    transition: background 0.2s ease;
}

.action-btn:hover .action-btn-icon {
    background: #e7f3ff;
}

.action-btn-icon .material-symbols-outlined {
    font-size: 18px;
}

.action-btn-text {
    font-size: 12px;
    font-weight: 500;
}

/* 區段標題 */
.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    padding-bottom: 8px;
    border-bottom: 2px solid #007bff;
}

.section-title .material-symbols-outlined {
    font-size: 20px;
    color: #007bff;
}

/* 營業時間 */
.business-hours-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
}

.hour-item {
    padding: 4px 0;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

/* 評論區域 */
.rating-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.rating-summary .rating-display {
    align-items: center;
    gap: 12px;
}

.rating-summary .rating-number {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.rating-summary .rating-text {
    font-size: 14px;
    color: #666;
}

.reviews-container {
    margin-top: 16px;
}

.review-item {
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
}

.review-item:last-child {
    border-bottom: none;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.reviewer-avatar {
    width: 50px;
    margin-right: 15px;
}

.reviewer-info {
    flex: 1;
}

.reviewer-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-bottom: 4px;
}

.review-rating {
    display: flex;
    gap: 2px;
    margin-bottom: 0;
}

.review-date {
    font-size: 12px;
    color: #999;
    flex-shrink: 0;
    margin-left: 8px;
}

.review-text {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin-top: 8px;
}

.more-reviews {
    margin-top: 16px;
    text-align: center;
}

.more-reviews button {
    font-size: 14px;
    color: #007bff;
    border-color: #007bff;
}

.more-reviews button:hover {
    background: #007bff;
    color: white;
}

/* 相關地點 */
.related-places {
    padding-bottom: 0;
}

.nearby-places {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
}

.nearby-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    color: inherit;
}

.nearby-item:last-child {
    border-bottom: none;
}

.nearby-item:hover {
    background-color: #f8f9fa;
    text-decoration: none;
    color: inherit;
}

.nearby-info {
    flex: 1;
    min-width: 0;
}

.nearby-name {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
    color: #333;
}

.nearby-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 12px;
    color: #666;
}

.nearby-rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nearby-rating .material-symbols-outlined {
    font-size: 14px;
    color: #ffc107;
}

.nearby-distance {
    color: #999;
}

.nearby-item .material-symbols-outlined:last-child {
    color: #ccc;
    font-size: 20px;
}

/* 星星樣式統一 */
.star, .star-small {
    color: #ffc107;
    font-size: 16px;
}

.star.empty, .star-small.empty {
    color: #ddd;
}

.star.half, .star-small.half {
    color: #ffc107;
}

.star-small {
    font-size: 14px;
}

/* 載入中狀態 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 錯誤狀態 */
.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.error-container .material-symbols-outlined {
    font-size: 48px;
    color: #dc3545;
    margin-bottom: 16px;
}

.error-container h3 {
    margin: 0 0 12px 0;
    color: #333;
}

.error-container p {
    margin: 0 0 24px 0;
    color: #666;
    line-height: 1.6;
}

/* UIKit Modal 整合 */
.uk-modal-dialog {
    background: white;
    overflow: hidden;
    border-radius: 12px;
    font-size: .85rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);

}

.uk-modal-close-default {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: #666;
}

.uk-modal-close-default:hover {
    background: rgba(255, 255, 255, 1);
    color: #333;
}

/* UIKit 滑塊組件整合 */
.uk-slider-items {
    height: 100%;
}

.uk-slider-items > li {
    height: 100%;
}

.uk-slider-nav {
    margin-top: 16px !important;
}

/* 相關地點 */
.related-places {
    padding-bottom: 0;
}

.nearby-places {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
}

.nearby-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    color: inherit;
}

.nearby-item:last-child {
    border-bottom: none;
}

.nearby-item:hover {
    background-color: #f8f9fa;
    text-decoration: none;
    color: inherit;
}

/* 附近地點圖片 */
.nearby-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

.nearby-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.nearby-item:hover .nearby-img {
    transform: scale(1.05);
}

.nearby-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #999;
}

.nearby-img-placeholder .material-symbols-outlined {
    font-size: 24px;
}

.nearby-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nearby-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.nearby-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #666;
}

.nearby-rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nearby-rating .material-symbols-outlined {
    font-size: 14px;
    color: #ffc107;
}

.nearby-category {
    color: #999;
    font-size: 11px;
}

.nearby-arrow {
    color: #ccc;
    font-size: 20px;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.nearby-item:hover .nearby-arrow {
    color: #007bff;
}

.nearby-distance {
    color: #999;
}


.modal-bottom-btn-close {
    margin-top: 20px;
    font-size: .8rem;
    padding: 10px 20px;
    background-color: #e2e6ea;
    color: #333333;
    border-radius: 15px;
    transition: all 0.3s ease; /* 平滑過渡 */
}
.modal-bottom-btn-close:hover {
    background-color: #c7d6e5;
    transform: translateY(-2px); /* 微微上浮 */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* 陰影 */
}

/* 響應式設計 */
@media (max-width: 768px) {
    
    .modal-dialog,
    .uk-modal-dialog {
        margin: 10px;
        max-width: calc(100vw - 20px);
    }
    
    .place-info-body {
        padding: 10px;
    }
    .place-images-container {
        height: 340px;
    }
    
    .place-header-overlay {
        padding: 16px;
    }
    
    .rating-number {
        font-size: 20px;
    }
    
    .action-buttons-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .action-btn {
        padding: 12px 8px;
    }
    
    .action-btn-text {
        font-size: 11px;
    }
    
    .place-info-row {
        gap: 12px;
        margin-bottom: 12px;
        padding: 8px 0;
    }
    
    .place-info-icon {
        width: 20px;
        height: 20px;
    }
    
    .place-info-icon .material-symbols-outlined {
        font-size: 18px;
    }
    
    .place-name-value {
        font-size: 16px;
    }
    
    .nearby-item {
        padding: 12px;
    }
    
    .nearby-name {
        font-size: 13px;
    }
    
    .nearby-meta {
        font-size: 11px;
    }
    .reviewer-avatar {
        width: 40px;
    }

    .place-modal .uk-padding {
        padding: 15px!important;
    }
}

@media (max-width: 480px) {
    .modal-dialog,
    .uk-modal-dialog {
        margin: 0;
        max-width: 100vw;
        min-height: auto;
        border-radius: 0;
    }
    
    .modal-content,
    .uk-modal-dialog {
        border-radius: 0;
        height: auto;
        max-height: none;
    }
    
    .place-images-container {
        height: 300px;
    }
    
    .action-buttons-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .category-badge,
    .animal-type-badge {
        font-size: 10px;
        padding: 4px 8px;
    }
}

/* 確保模態框在最上層 */
.place-modal,
.uk-modal {
    z-index: 9999 !important;
}

/* 避免滾動問題 */
body.modal-open {
    overflow: hidden !important;
}