﻿/**
 * 醫師卡片標籤樣式
 */

/* 標籤容器 */
.doctor-tabs {
    margin-top: 15px;
}

/* 標籤導航樣式 */
.doctor-tabs .nav-pills {
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.doctor-tabs .nav-pills .nav-item {
    margin: 0 2px;
}

.doctor-tabs .nav-pills .nav-link {
    border-radius: 15px;
    font-size: 1rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid #ddd;
    color: #666;
    background-color: transparent;
    transition: all 0.3s ease;
    font-weight: 500;
    text-decoration: none;
    white-space: normal;
    text-align: center;
}

.doctor-tabs .nav-pills .nav-link.active {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,123,255,0.2);
}

.doctor-tabs .nav-pills .nav-link:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
    color: #007bff;
    text-decoration: none;
    transform: translateY(-1px);
}

.doctor-tabs .nav-pills .nav-link:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

/* 內容區域樣式 */
.tab-content-area {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.tab-content-area.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* 確保內容區域有最小高度，避免切換時卡片高度變化 */
.doctor-tabs .doctertext {
    min-height: 120px;
    padding-top: 5px;
    text-align: center;
}

/* 醫師卡片內容區域置中 */
.doc-cardbody {
    text-align: center;
    padding: 1.5rem;
}

/* 醫師卡片圖片樣式 */
.doc-cardbody img {
    display: block;
    margin: 0 auto 1rem auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 醫師名稱標題置中 */
.doc-cardbody .card-title {
    text-align: center;
    margin-bottom: 1rem;
    color: #333;
}

/* 處理列表項目的樣式 */
.doctertext li {
    list-style: disc;
    margin: 0.5rem 0;
    padding: 0.25rem 0;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
    margin-left: 1rem;
}

.doctertext li:last-child {
    border-bottom: none;
}

/* 確保專長和學經歷列表正確顯示 */
.doctertext {
    padding: 0 1rem;
}

/* 學經歷區塊整體樣式 */
.education-section {
    margin-bottom: 1.5rem;
}

/* 學經歷子標題樣式 */
.education-title {
    display: block;
    margin: 1rem 0 0.5rem 1rem;
    color: #333;
    font-weight: bold;
    font-size: 1.1em;
    text-align: left;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.25rem;
    width: fit-content;
}

/* 學經歷列表容器 */
.education-list {
    margin: 0.5rem 0 1rem 0;
    padding: 0;
}

/* 學經歷列表項目 */
.education-list li {
    list-style: disc;
    margin: 0.4rem 0;
    padding: 0.2rem 0;
    text-align: left;
    margin-left: 1.5rem;
    color: #555;
    line-height: 1.4;
}

/* 兼容舊版樣式 */
.doctertext br + strong,
.doctertext strong {
    display: block;
    margin: 1rem 0 0.5rem 1rem;
    color: #333;
    font-weight: bold;
    font-size: 1.1em;
    text-align: left;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .doctor-tabs .nav-pills .nav-link {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }

    .doctor-tabs .doctertext {
        min-height: 100px;
    }

    .doc-cardbody {
        padding: 1rem;
    }

    .doc-cardbody img {
        width: 60% !important;
    }
}

/* 為小螢幕優化標籤佈局 */
@media (max-width: 576px) {
    .doctor-tabs .nav-pills {
        flex-wrap: wrap;
    }

    .doctor-tabs .nav-pills .nav-item {
        flex: 1;
        text-align: center;
        min-width: 30%;
    }

    .doctor-tabs .nav-pills .nav-link {
        width: 100%;
        font-size: 0.7rem;
        padding: 0.2rem 0.4rem;
    }
}

/* 更多專長與研究按鈕樣式 */
.research-link-container {
    text-align: center;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
}

.research-link {
    display: inline-block;
    background-color: #28a745;
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 15px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid #28a745;
}

.research-link:hover {
    background-color: #218838;
    border-color: #1e7e34;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(40,167,69,0.2);
    text-decoration: none;
}
/* 動畫效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content-area.active .doctertext {
    animation: fadeInUp 0.5s ease-out;
}

/* 載入狀態樣式 */
.doctor-tabs.loading .nav-link {
    pointer-events: none;
    opacity: 0.6;
}

.doctor-tabs.loading .tab-content-area {
    position: relative;
}

.doctor-tabs.loading .tab-content-area::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1;
}

/* ===== 診所標籤樣式 ===== */

/* 診所標籤容器 */
.opd-tab {
    margin: 1.5rem 0;
}

/* 診所標籤導航樣式 - 置中顯示 */
.opd-tab .nav-tabs {
    justify-content: center;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 1.5rem;
}

/* 團隊介紹頁面的診所標籤專用樣式 - 完美置中 */
/* 非門診時間表頁面的 .opd-tab 樣式 */
:not([data-page="schedule"]) .opd-tab .nav-tabs {
    display: flex !important;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: none;
    grid-template-columns: unset !important;
    grid-template-rows: unset !important;
    gap: 0.5rem;
}

/* 針對團隊介紹頁面標籤項目 */
:not([data-page="schedule"]) .opd-tab .nav-items {
    flex: 0 0 auto;
    margin: 0 0.25rem 0.5rem 0.25rem;
}

/* 針對團隊介紹頁面標籤連結 */
:not([data-page="schedule"]) .opd-tab .nav-tabs .nav-link {
    width: auto !important;
    height: auto !important;
    min-width: 150px;
    padding: 0.75rem 1.5rem;
}

/* 診所標籤項目 */
.opd-tab .nav-items {
    margin: 0 0.25rem;
}

/* 診所標籤連結樣式 - 只應用於 nav-tabs 內的 nav-link */
.opd-tab .nav-tabs .nav-link {
    border-radius: 20px 20px 0 0;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: 2px solid transparent;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #495057;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

/* 診所標籤連結 hover 效果 */
.opd-tab .nav-tabs .nav-link:hover {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    color: #1976d2;
    border-color: #1976d2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.15);
    text-decoration: none;
}

/* 診所標籤 active 狀態 */
.opd-tab .nav-tabs .nav-link.active {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: white;
    border-color: #1976d2;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(25, 118, 210, 0.3);
}

/* 診所標籤 active 狀態 hover 效果 */
.opd-tab .nav-tabs .nav-link.active:hover {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
    border-color: #0d47a1;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(25, 118, 210, 0.4);
}

/* 診所標籤 focus 狀態 */
.opd-tab .nav-tabs .nav-link:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.25);
}

/* 診所標籤動畫效果 */
.opd-tab .nav-tabs .nav-link::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.opd-tab .nav-tabs .nav-link:hover::before {
    left: 100%;
}

/* 響應式設計 - 診所標籤 */
@media (max-width: 768px) {
    .opd-tab .nav-tabs .nav-link {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
        margin-bottom: 0.25rem;
    }

    .opd-tab .nav-tabs {
        flex-wrap: wrap;
    }

    .opd-tab .nav-items {
        flex: 1;
        min-width: 45%;
        margin: 0.125rem;
    }

    .opd-tab .nav-tabs .nav-link {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .opd-tab .nav-items {
        min-width: 100%;
        margin: 0.125rem 0;
    }

    .opd-tab .nav-tabs .nav-link {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
}

/* ===== 門診時間表標籤兩排佈局樣式 ===== */

/* 門診時間表標籤容器 - 兩排佈局 */
.opd-tab .nav-tabs {
    display: grid;
    grid-template-columns: repeat(5, 190px);
    grid-template-rows: auto auto;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

/* 標籤項目 - 前5個為第一排 */
.opd-tab .nav-items:nth-child(-n+5) {
    grid-row: 1;
}

/* 標籤項目 - 第6個到第9個為第二排，居中對齊 */
.opd-tab .nav-items:nth-child(6) {
    grid-row: 2;
    grid-column: 1;
}

.opd-tab .nav-items:nth-child(7) {
    grid-row: 2;
    grid-column: 2;
}

.opd-tab .nav-items:nth-child(8) {
    grid-row: 2;
    grid-column: 3;
}

.opd-tab .nav-items:nth-child(9) {
    grid-row: 2;
    grid-column: 4;
}

/* 門診時間表標籤樣式 - 固定尺寸 */
.opd-tab .nav-tabs .nav-link {
    width: 190px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

/* 響應式設計 - 門診時間表兩排佈局 */
@media (max-width: 1200px) {
    .opd-tab .nav-tabs {
        grid-template-columns: repeat(5, 170px);
    }

    .opd-tab .nav-tabs .nav-link {
        width: 170px;
    }
}

@media (max-width: 992px) {
    /* 中等螢幕 - 改為3排佈局 */
    .opd-tab .nav-tabs {
        grid-template-columns: repeat(3, 160px);
        grid-template-rows: auto auto auto;
    }

    .opd-tab .nav-items:nth-child(1),
    .opd-tab .nav-items:nth-child(2),
    .opd-tab .nav-items:nth-child(3) {
        grid-row: 1;
    }

    .opd-tab .nav-items:nth-child(4),
    .opd-tab .nav-items:nth-child(5),
    .opd-tab .nav-items:nth-child(6) {
        grid-row: 2;
    }

    .opd-tab .nav-items:nth-child(7),
    .opd-tab .nav-items:nth-child(8),
    .opd-tab .nav-items:nth-child(9) {
        grid-row: 3;
    }

    .opd-tab .nav-items:nth-child(6) {
        grid-column: auto;
    }

    .opd-tab .nav-items:nth-child(7) {
        grid-column: auto;
    }

    .opd-tab .nav-items:nth-child(8) {
        grid-column: auto;
    }

    .opd-tab .nav-items:nth-child(9) {
        grid-column: auto;
    }

    .opd-tab .nav-tabs .nav-link {
        width: 160px;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    /* 小螢幕 - 改為2欄佈局，5行 */
    .opd-tab .nav-tabs {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(5, auto);
        gap: 0.5rem;
        justify-content: center;
        max-width: 320px;
        margin: 0 auto 1.5rem auto;
    }

    /* 重置所有之前的 grid-row 和 grid-column 設定 */
    .opd-tab .nav-items:nth-child(-n+5) {
        grid-row: unset;
    }

    .opd-tab .nav-items:nth-child(6) {
        grid-row: unset;
        grid-column: unset;
    }

    .opd-tab .nav-items:nth-child(7) {
        grid-row: unset;
        grid-column: unset;
    }

    .opd-tab .nav-items:nth-child(8) {
        grid-row: unset;
        grid-column: unset;
    }

    .opd-tab .nav-items:nth-child(9) {
        grid-row: unset;
        grid-column: unset;
        grid-column: 1 / -1; /* 最後一個元素橫跨兩欄，居中顯示 */
        justify-self: center;
    }

    .opd-tab .nav-tabs .nav-link {
        width: 150px;
        font-size: 0.8rem;
        height: 40px;
    }

    /* 最後一個標籤保持原始寬度 */
    .opd-tab .nav-items:nth-child(9) .nav-tabs .nav-link {
        width: 150px;
    }
}

@media (max-width: 576px) {
    /* 超小螢幕 - 單欄顯示 */
    .opd-tab .nav-tabs {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(9, auto);
        gap: 0.4rem;
        max-width: 250px;
        margin: 0 auto 1.5rem auto;
    }

    /* 重置所有 grid 設定 */
    .opd-tab .nav-items {
        grid-row: unset;
        grid-column: unset;
        justify-self: center;
    }

    .opd-tab .nav-items:nth-child(9) {
        grid-column: unset;
        justify-self: center;
    }

    .opd-tab .nav-tabs .nav-link {
        width: 220px;
        font-size: 0.85rem;
        height: 42px;
        padding: 0.5rem 0.75rem;
    }

    .opd-tab .nav-items:nth-child(9) .nav-tabs .nav-link {
        width: 220px;
        font-size: 0.85rem;
        height: 42px;
        padding: 0.5rem 0.75rem;
    }
}

/* ===== 查看門診表按鈕樣式 ===== */

/* 按鈕容器 - 整個區域可點擊 */
.card-footer.heapad22 {
    padding: 0 !important;
    background-color: transparent !important;
    border-top: 1px solid #e9ecef;
    position: relative;
}

/* 查看門診表按鈕樣式 - 占滿整個底部區域 */
.cardfooter {
    display: block;
    width: 100%;
    background: linear-gradient(135deg, #007bff 0%, #007bff 100%);
    color: white !important;
    padding: 1rem;
    text-decoration: none !important;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-align: center;
    cursor: pointer;
    border-radius: 0 0 0.375rem 0.375rem; /* 配合卡片的圓角 */
}

/* 按鈕 hover 效果 */
.cardfooter:hover {
    background: linear-gradient(135deg, #218838 0%, #1abc9c 100%);
    color: white !important;
    text-decoration: none !important;
    transform: none; /* 移除向上移動效果 */
}

/* 按鈕 active 效果 */
.cardfooter:active {
    background: linear-gradient(135deg, #1e7e34 0%, #17a2b8 100%);
    transform: scale(0.98);
}

/* 按鈕光澤動畫效果 */
.cardfooter::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.cardfooter:hover::before {
    left: 100%;
}

/* 響應式設計 - 按鈕 */
@media (max-width: 768px) {
    .cardfooter {
        padding: 0.9rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .cardfooter {
        padding: 0.8rem;
        font-size: 0.85rem;
    }
}

/* ===== 門診表彈窗樣式 ===== */

/* 模態框背景 - 半透明黑色 */
.modal.fade .modal-backdrop,
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.7) !important;
}

/* 模態框對話框置中 */
.modal-dialog {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    max-width: none;
    width: 100%;
    padding: 1rem;
}

/* 模態框內容 - 移除背景 */
.modal-content {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    max-width: fit-content;
    margin: 0 auto;
}

/* 模態框標題區域 */
.modal-header {
    border: none !important;
    padding: 0;
    background: transparent !important;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1051;
    margin: 0;
}

/* 關閉按鈕樣式 */
.closebtn {
    background-color: rgba(255, 255, 255, 0.9) !important;
    color: #333 !important;
    border: 1px solid #ddd !important;
    padding: 0.5rem 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.closebtn:hover {
    background-color: white !important;
    color: #000 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 模態框內容區域 */
.modal-body.opdimgpho {
    padding: 0 !important;
    background: transparent !important;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 門診表圖片樣式 */
.opdimg {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    background: white;
    padding: 10px;
}

/* 響應式設計 - 彈窗 */
@media (max-width: 768px) {
    .modal-dialog {
        padding: 0.5rem;
    }

    .opdimg {
        max-width: 95vw;
        max-height: 85vh;
        padding: 5px;
    }

    .modal-header {
        top: 10px;
        right: 10px;
    }

    .closebtn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}
