/* 蝯曹???閮剛?蝟餌絞 - ?璅?? */
/* CSS 霈摰儔撌脩宏??global-variables.css */

/* Base button system
 * 標準 class: .btn .btn-primary .btn-secondary .btn-danger .btn-small .btn-icon
 * 舊 class (向下相容): .create-post-btn .buttons-button .write-review-btn .claim-button
 */
.btn,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-small,
.btn-icon,
.create-post-btn,
.buttons-button,
.write-review-btn,
.claim-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 var(--btn-padding-x);
    height: var(--btn-height);
    border-radius: var(--radius-pill);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: var(--text-sm);
    line-height: var(--line-height-base);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    white-space: nowrap;
    border: 1px solid transparent;
    background: var(--surface);
    color: var(--text-light);
}

.btn-primary,
.create-post-btn,
.buttons-button,
.write-review-btn {
    background: var(--primary-color);
    color: var(--primary-contrast);
    border-color: transparent;
}

.btn-primary img,
.create-post-btn img {
    filter: brightness(0) invert(1);
}

.btn-primary:hover,
.create-post-btn:hover,
.buttons-button:hover,
.write-review-btn:hover {
    background: var(--primary-dark);
    color: var(--primary-contrast);
    text-decoration: none;
}

.btn-secondary,
.claim-button {
    background: var(--surface);
    color: var(--text-light);
    border-color: var(--border-color);
}

.btn-secondary:hover,
.claim-button:hover {
    background: var(--background-light);
    color: var(--text-light);
    text-decoration: none;
    border-color: var(--text-subtle);
}

.btn-danger {
    background: var(--color-danger);
    color: var(--primary-contrast);
    border-color: transparent;
}

.btn-danger:hover {
    background: #B91C1C;
    color: var(--primary-contrast);
}

.btn-small {
    height: var(--btn-height-sm);
    padding: 0 var(--btn-padding-x-sm);
    font-weight: 500;
    font-size: 13px;
    border-radius: var(--radius-md);
}

.btn-icon {
    width: var(--btn-height);
    height: var(--btn-height);
    padding: 0;
    border-radius: var(--radius-round);
}

.claim-button {
    height: var(--btn-height-lg);
    padding: 0 var(--btn-padding-x-lg);
    font-size: var(--text-base);
}

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.btn-danger:focus-visible,
.btn-small:focus-visible,
.btn-icon:focus-visible,
.create-post-btn:focus-visible,
.buttons-button:focus-visible,
.write-review-btn:focus-visible,
.claim-button:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* Text-style action */
.more-reviews-btn {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    font-family: var(--font-sans);
}

.more-reviews-btn:hover {
    background-color: rgba(184, 155, 94, 0.12);
}

/* Icon sizing */
.create-post-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* 蝳???- ?拍?潭?????*/
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-small:disabled,
.btn-icon:disabled,
.btn-danger:disabled,
.create-post-btn:disabled,
.buttons-button:disabled,
.write-review-btn:disabled,
.claim-button:disabled {
    background: var(--background-light) !important;
    color: var(--text-subtle) !important;
    border-color: var(--border-light) !important;
    cursor: not-allowed !important;
    opacity: 0.6;
    transform: none !important;
    box-shadow: none !important;
}

/* 頛銝剔???*/
.btn-primary.loading,
.btn-danger.loading,
.create-post-btn.loading,
.buttons-button.loading {
    position: relative;
    color: transparent;
}

.btn-primary.loading::after,
.btn-danger.loading::after,
.create-post-btn.loading::after,
.buttons-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid var(--primary-contrast);
    border-top: 2px solid transparent;
    border-radius: var(--radius-round);
    animation: button-spin 1s linear infinite;
}

@keyframes button-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 瘣餉????*/
/* ── 統一載入 spinner（全站共用） ────────────────── */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-subtle);
    font-size: 14px;
    padding: 16px 0;
}

.spinner-circle {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-top-color: var(--primary-color);
    border-radius: var(--radius-round);
    animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
    to { transform: rotate(360deg); }
}

.btn-secondary.active {
    background: rgba(184, 155, 94, 0.12);
    color: var(--primary-dark);
    border-color: var(--primary-color);
}

/* SVG ???璅?? */
.btn-primary svg,
.btn-secondary svg,
.btn-small svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

/* ?踵?撘身閮?*/
@media (max-width: 576px ) {
    .btn-primary,
    .btn-secondary,
    .buttons-button,
    .write-review-btn,
    .create-post-btn {
        height: var(--btn-height-sm);
        padding: 0 var(--btn-padding-x-sm);
        font-size: var(--text-sm);
    }
    
    .btn-small {
        font-size: 12px;
        padding: 0 10px;
        height: 28px;
    }
    
    .claim-button {
        font-size: var(--text-sm);
        height: 44px;
        padding: 0 16px;
    }
} 


/* Star Rating Component CSS */


.star-rating {
    display: inline-flex;
    align-items: center;
    font-family: inherit;
}

.stars-display {
    display: flex;
    align-items: center;
}

.star-icon {
    display: inline-block;
    line-height: 1;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ?踵?撘?擃之撠?*/
.star-rating.text-xs .star-icon {
    font-size: 0.75rem;
}

.star-rating.text-sm .star-icon {
    font-size: 0.875rem;
}

.star-rating.text-base .star-icon {
    font-size: 1rem;
}

.star-rating.text-lg .star-icon {
    font-size: 1.125rem;
}

.star-rating.text-2xl .star-icon {
    font-size: 1.5rem;
}

/* ???航赤??*/
.star-rating:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: var(--radius-xs);
}

/* ???詨???嚗?潔???閰?蝯辣嚗?*/
.star-rating.interactive .star-icon:hover {
    transform: scale(1.1);
    cursor: pointer;
}

.star-rating.interactive .star-icon:hover i {
    color: #fbbf24 !important;
}

/* ── 統一 modal header（圖標左 + 標題副標題右 + 關閉按鈕） ── */
.modal-header-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.modal-header-icon {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 18px;
    color: var(--text-light);
    box-shadow: 0 1px 2px rgba(10, 13, 18, 0.05);
}

.modal-header-text {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.modal-header-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
    line-height: 1.4;
}

.modal-header-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin: 2px 0 0;
}

.modal-header-icon img {
    width: 24px;
    height: 24px;
}

/* ══════════════════════════════════════════════════════
 * 共用互動樣式 — 全站統一的 hover/focus 行為
 * 用法：class="card-hover"、class="input-focus"、class="icon-muted"
 * ═══════════════════════════════════���══════════════════ */

/* 卡片 hover：邊框變金色（用於 post-card, clinic-card, review-card, doctor-card） */
.card-hover {
    border: 1px solid var(--border-light);
    transition: border-color 0.2s ease;
}
.card-hover:hover {
    border-color: var(--primary-color);
}

/* 輸入框 focus：邊框變金色 + 微光暈（用於搜尋框、表單 input） */
.input-focus {
    border: 1px solid var(--border-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.input-focus:hover {
    border-color: var(--primary-color);
}
.input-focus:focus,
.input-focus:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(184, 155, 94, 0.1);
    outline: none;
}

/* 淡色 icon（用於 ... menu trigger、action icons） */
.icon-muted {
    color: var(--border-color);
    transition: color 0.15s ease;
}
.icon-muted:hover {
    color: var(--text-subtle);
}

/* 列表 hover：滿寬淡灰背景（用於 comment-item, review-item） */
.list-hover {
    transition: background-color 0.15s ease;
}
.list-hover:hover {
    background-color: var(--background-light);
}
