/* Import Inter font for better design consistency */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

/* 引入通用樣式 */
@import url('common-buttons.css');
@import url('common-rating.css');

/* Styles for avatar initials */
.avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 1.25rem;
    font-weight: bold;
    color: white;
    /* Or dynamically set based on avatar_color */
}

/* 診所評論功能專用樣式 */

/* ========== 評價統計樣式已移至 common-rating.css ========== */

/* ========== 評價列表樣式 ========== */
.reviews-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.clinic-review-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid #F3F4F6;
    transition: background-color 0.2s;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.clinic-review-item:hover {
    background-color: #f9fafb;
    margin: 0 -24px;
    padding: 16px 24px;
    border-radius: 8px;
    border-bottom: 1px solid #F3F4F6;
}

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

/* ========== 頭像樣式 ========== */
.clinic-review-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.clinic-review-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.clinic-review-avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 16px;
    font-weight: bold;
    color: white;
}

/* ========== 頭部區域布局 ========== */
.clinic-review-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 6px;
}

.clinic-review-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.clinic-review-user-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.clinic-review-user-name {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #414651;
    margin: 0;
    line-height: 1.43;
}

.clinic-review-user-time {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 400;
    color: #535862;
    line-height: 1.5;
}

.clinic-review-content {
    flex: 1;
    min-width: 0;
}

/* ========== 評分區域 ========== */
.clinic-review-rating-and-date {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.clinic-review-rating-stars {
    display: flex;
    gap: 4px;
}

.clinic-review-rating-stars .star-icon {
    width: 20px;
    height: 20px;
    font-size: 20px;
    color: #F5F5F5;
}

.clinic-review-rating-stars .star-icon.filled {
    color: #FDB022;
}

/* ========== 評論內容樣式 ========== */
.clinic-review-text {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #181D27;
    line-height: 1.5;
    margin: 0 0 12px 0;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* ========== 投票按鈕樣式 ========== */
.clinic-review-vote-buttons {
    display: flex;
    align-items: center;
    gap: 16px;
}

.clinic-review-vote-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: none;
    border-radius: 0;
    background-color: transparent;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
}

.clinic-review-vote-btn:hover {
    background-color: transparent;
}

.clinic-review-like-button {
    color: #B89B5E;
}

.clinic-review-like-button i {
    width: 20px;
    height: 20px;
    font-size: 20px;
    color: #CEB341;
    transition: color 0.3s ease;
}

.clinic-review-like-button i.fas {
    color: #CEB341;
}

.clinic-review-like-button:hover i {
    color: #B89B5E;
}

.clinic-review-dislike-button {
    color: #535862;
}

.clinic-review-dislike-button i {
    width: 20px;
    height: 20px;
    font-size: 20px;
    color: #A4A7AE;
    transition: color 0.3s ease;
}

.clinic-review-dislike-button i.fas {
    color: #A4A7AE;
}

.clinic-review-dislike-button:hover i {
    color: #535862;
}

.clinic-review-vote-btn .count {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    margin-left: 0;
}

.clinic-review-like-button .count {
    color: #B89B5E;
}

.clinic-review-dislike-button .count {
    color: #535862;
}

/* ========== 互動按鈕區域樣式 ========== */
.clinic-review-action-buttons {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 12px;
}

.clinic-review-share-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.edit-review-button {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    transition: all 0.2s;
}

.edit-review-button:hover {
    background-color: #f3f4f6;
}

/* ========== 評論項目層級 ========== */
.clinic-review-item.dropdown-menu-active {
    z-index: 998;
}

.reviews-container .clinic-review-item.dropdown-menu-active {
    z-index: 998;
}

/* ========== 通知弹窗样式 ========== */
.vote-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: opacity 0.3s ease;
    max-width: 300px;
}

/* ========== 評價圖片相關樣式 ========== */
.review-images-container {
    margin-top: 10px;
    width: 100%;
}

.comment-images-grid {
    margin-top: 10px;
    width: 100%;
}

.comment-images-grid .image-grid {
    display: grid;
    gap: 8px;
    max-width: 100%;
}

/* ========== 圖片布局樣式 ========== */
.comment-images-grid .single-image {
    grid-template-columns: 1fr;
    max-width: 350px;
}

.comment-images-grid .single-image img {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: 8px;
}

.comment-images-grid .two-images {
    grid-template-columns: 1fr 1fr;
    max-width: 400px;
}

.comment-images-grid .two-images img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
}

.comment-images-grid .three-images {
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    grid-template-areas:
        "main top-right"
        "main bottom-right";
    max-width: 400px;
}

.comment-images-grid .three-images .image-container:first-child {
    grid-area: main;
}

.comment-images-grid .three-images .image-container:nth-child(2) {
    grid-area: top-right;
}

.comment-images-grid .three-images .image-container:nth-child(3) {
    grid-area: bottom-right;
}

.comment-images-grid .three-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.comment-images-grid .four-images {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    max-width: 400px;
}

.comment-images-grid .four-images img {
    height: 120px;
    width: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.comment-images-grid .image-container {
    position: relative;
    overflow: hidden;
}

.comment-images-grid .more-images-overlay {
    position: relative;
}

.comment-images-grid .more-images-overlay::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
}

.comment-images-grid .more-count {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 20px;
    font-weight: bold;
    z-index: 2;
}

/* ========== 滑動樣式 ========== */
.scrollable-image-row {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: #ddd #f5f5f5;
}

.scrollable-image-row::-webkit-scrollbar {
    height: 6px;
}

.scrollable-image-row::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 10px;
}

.scrollable-image-row::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}

.scrollable-image-row .image-container {
    flex: 0 0 auto;
    width: 120px;
    height: 120px;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #eee;
}

.scrollable-image-row .review-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.scrollable-image-row .image-container:hover .review-image {
    transform: scale(1.05);
}

.scrollable-image-row.active {
    cursor: grabbing;
}

/* ========== 圖片查看器樣式 ========== */
.image-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-viewer-overlay.hidden {
    display: none;
}

.image-viewer-container {
    position: relative;
    width: 90%;
    max-width: 1000px;
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-viewer-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-viewer-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.close-viewer {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    z-index: 10;
}

.image-viewer-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
}

.nav-button {
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin: 0 20px;
    transition: background-color 0.2s;
}

.nav-button:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.image-counter {
    position: absolute;
    bottom: -30px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    font-size: 14px;
}

/* ========== 基本 Alert 樣式 ========== */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* ========== Modal 相關樣式 ========== */
.modal-common {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.hidden {
    display: none;
}

/* ========== 響應式設計 ========== */
@media (max-width: 800px) {
    .reviews-container {
        padding: 16px;
    }
    
    .rating-summary {
        padding: 20px;
        background: white;
        border: 1px solid #E9EAEB;
        border-radius: 12px;
        box-shadow: 0px 1px 2px 0px rgba(10, 13, 18, 0.05);
    }
    
    .rating-overview {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }
    
    .rating-breakdown {
        width: 100%;
        min-width: auto;
    }
    
    .overall-rating-display {
        align-self: center;
    }
    
    .clinic-review-item:hover {
        margin: 0 -16px;
        padding: 16px 16px;
    }
    
    .clinic-review-user-avatar {
        width: 40px;
        height: 40px;
    }
    
    .clinic-review-avatar-initials {
        font-size: 16px;
    }
}

@media (min-width: 801px) {
    .reviews-container {
        padding: 32px;
    }
    
    .rating-overview {
        flex-direction: row;
        align-items: stretch;
    }
    
    .rating-breakdown {
        flex: 1;
    }
    
    .overall-rating-display {
        min-width: fit-content;
    }
}

/* 按鈕樣式已移至 common-buttons.css */ 