@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700&display=swap');

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --purple-color: #6f42c1;
    --teal-color: #20c997;
    /* 淺色背景 */
    --primary-light: rgba(13, 110, 253, 0.15);
    --secondary-light: rgba(108, 117, 125, 0.15);
    --success-light: rgba(25, 135, 84, 0.15);
    --danger-light: rgba(220, 53, 69, 0.15);
    --info-light: rgba(13, 202, 240, 0.15);
    --warning-light: rgba(255, 193, 7, 0.15);
    --light-light: rgba(248, 249, 250, 0.15);
    --dark-light: rgba(33, 37, 41, 0.15);
    --purple-light: rgba(111, 66, 193, 0.15);
    --teal-light: rgba(32, 201, 151, 0.15);
    --indigo-color: #6610f2;
    --indigo-light: rgba(102, 16, 242, 0.15);
}

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    /* 移除 margin-bottom，避免和固定底欄重複疊加空白 */
    /* margin-bottom: 70px; */
    font-family: 'Noto Sans TC', sans-serif;
    background-color: #f5f5f5;
    padding-bottom: 70px; /* 為固定底部導航騰出空間 */
}

/* 全局卡片樣式 */
.card {
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

    .card:hover {
        transform: translateY(-3px); /* 降低位移，避免明顯抖動 */
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    }

.card-header {
    font-weight: bold;
}

/* 按鈕樣式 */
.btn {
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.3s ease;
}

    .btn:hover {
        transform: translateY(-1px); /* 降低位移 */
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    }

.btn-lg {
    padding: 12px 20px;
    font-size: 1.1rem;
}

/* 表單樣式 */
.form-control {
    border-radius: 5px;
    border: 1px solid #ced4da;
    padding: 10px 15px;
    transition: all 0.3s ease;
}

    .form-control:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    }

.form-control-lg {
    height: calc(1.5em + 1rem + 2px);
    padding: 0.5rem 1rem;
    font-size: 1.1rem;
}

/* 底部導航 */
.navbar.fixed-bottom {
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
}

.custom-button {
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0);
    color: var(--dark-color);
    text-align: center;
}

    .custom-button:hover {
        background-color: #f0f0f0;
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
        transform: translateY(-2px); /* 與底欄 hover 效果一致 */
        color: var(--primary-color);
    }

    .custom-button .icon {
        font-size: 24px;
        margin-bottom: 4px;
        display: block;
    }

/* 輪播圖樣式 */
.carousel-control-prev-icon, .carousel-control-next-icon {
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

    .carousel-control-prev-icon:hover, .carousel-control-next-icon:hover {
        background-color: rgba(255, 255, 255, 0.8);
    }

.carousel-indicators [data-bs-target] {
    width: 15px;
    height: 15px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 2px solid white;
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicators .active {
    background-color: rgba(255, 255, 255, 0.9);
    border-color: gold;
    transform: scale(1.3);
}

/* 最新消息 */
.list-group-item {
    margin-bottom: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

    .list-group-item:hover {
        background-color: #f8f9fa;
        transform: translateX(5px);
    }

.btn-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    border: none;
    background: none;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

    .btn-link:hover {
        color: #0a58ca;
    }

.btn-news {
    text-align: left;
}

.fa-bell {
    color: #ff006e;
}

/* 視頻播放器 */
#videoPlayer {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 功能卡片樣式 */
.feature-card {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.3s ease;
}

    .feature-card:hover {
        transform: translateY(-2px);
    }
    /* 降低位移 */
    .feature-card .card {
        transition: all 0.3s ease;
    }

    .feature-card:hover .card {
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    }

.feature-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: all 0.3s ease;
}

    .feature-icon i {
        font-size: 24px;
        transition: all 0.3s ease;
    }

.feature-card:hover .feature-icon i {
    transform: scale(1.2);
}

/* 功能圖標背景色 */
.bg-primary-light {
    background-color: var(--primary-light);
}

.bg-secondary-light {
    background-color: var(--secondary-light);
}

.bg-success-light {
    background-color: var(--success-light);
}

.bg-danger-light {
    background-color: var(--danger-light);
}

.bg-warning-light {
    background-color: var(--warning-light);
}

.bg-info-light {
    background-color: var(--info-light);
}

.bg-light-light {
    background-color: var(--light-light);
}

.bg-dark-light {
    background-color: var(--dark-light);
}

.bg-purple-light {
    background-color: var(--purple-light);
}

.bg-teal-light {
    background-color: var(--teal-light);
}
.bg-indigo-light {
    background-color: var(--indigo-light);
}

/* 功能圖標文字顏色 */
.text-primary {
    color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--secondary-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.text-danger {
    color: var(--danger-color) !important;
}

.text-warning {
    color: var(--warning-color) !important;
}

.text-info {
    color: var(--info-color) !important;
}

.text-light {
    color: var(--light-color) !important;
}

.text-dark {
    color: var(--dark-color) !important;
}

.text-purple {
    color: var(--purple-color) !important;
}

.text-teal {
    color: var(--teal-color) !important;
}
.text-indigo {
    color: var(--indigo-color) !important;
}

/* 新聞列表樣式 */
.news-icon-wrapper {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(220, 53, 69, 0.1);
}

/* 當月DM模態框樣式 */
#dmModal .modal-content {
    border-radius: 15px;
    overflow: hidden;
}

#dmModal .modal-header {
    border-bottom: none;
}

#dmModal .modal-footer {
    border-top: none;
}

#dmModal .carousel-inner {
    border-radius: 10px;
    overflow: hidden;
}

#dmModal .carousel-item img {
    object-fit: contain;
    max-height: 70vh;
}

.bg-gradient-light {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* 廣告區塊樣式 */
.ad-container {
    position: relative;
    min-height: 200px;
    overflow: hidden;
    border-radius: 0 0 10px 10px;
}

#videoPlayer.w-100 {
    max-height: 400px;
    object-fit: contain;
    background-color: #000;
}

#imageContainer {
    max-height: 400px;
    overflow: hidden;
}

    #imageContainer img {
        max-width: 100%;
        max-height: 380px;
        object-fit: contain;
    }

#defaultAdContent {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* 響應式調整 */
@media (max-width: 576px) {
    .feature-icon {
        width: 50px;
        height: 50px;
    }

        .feature-icon i {
            font-size: 20px;
        }

    .card-body {
        padding: 1rem;
    }

    #dmModal .carousel-item img {
        max-height: 50vh;
    }

    .ad-container {
        min-height: 150px;
    }
}

/* Header 美化 */
.header-brand {
    font-size: 2.2rem;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.header-bar {
    background: linear-gradient(90deg, #4e54c8 0%, #8f94fb 100%);
    box-shadow: 0 4px 16px rgba(78,84,200,0.10);
    border-bottom-left-radius: 1.5rem;
    border-bottom-right-radius: 1.5rem;
    padding: 1.5rem 0 1rem 0;
    margin-bottom: 1rem;
    position: relative;
}

    .header-bar .fa-clinic-medical {
        font-size: 2.2rem;
        color: #fff;
        filter: drop-shadow(0 2px 4px rgba(0,0,0,0.10));
    }

/* Footer 美化 */
.navbar.fixed-bottom {
    background: linear-gradient(90deg, #8f94fb 0%, #4e54c8 100%);
    border-top-left-radius: 1.5rem;
    border-top-right-radius: 1.5rem;
    box-shadow: 0 -4px 24px rgba(78,84,200,0.10);
    padding: 0.5rem 0;
    border: none;
}

    .navbar.fixed-bottom .navbar-brand.custom-button {
        color: #fff;
        font-weight: 500;
        font-size: 1.08rem;
        transition: all 0.2s;
        border-radius: 1rem;
        padding: 0.5rem 0.75rem;
        margin: 0 0.2rem;
        background: transparent;
    }

        .navbar.fixed-bottom .navbar-brand.custom-button .icon {
            font-size: 1.6rem;
            margin-bottom: 2px;
            color: #fff;
            filter: drop-shadow(0 2px 4px rgba(0,0,0,0.10));
        }

        .navbar.fixed-bottom .navbar-brand.custom-button:hover,
        .navbar.fixed-bottom .navbar-brand.custom-button:focus {
            background: rgba(255,255,255,0.12);
            color: #ffe066;
            transform: translateY(-2px) scale(1.08);
            box-shadow: 0 2px 8px rgba(78,84,200,0.10);
        }

        .navbar.fixed-bottom .navbar-brand.custom-button.active {
            background: #fff;
            color: #4e54c8;
            box-shadow: 0 2px 8px rgba(78,84,200,0.10);
        }

@media (max-width: 576px) {
    .header-bar {
        border-bottom-left-radius: 1rem;
        border-bottom-right-radius: 1rem;
        padding: 1.2rem 0 0.7rem 0;
    }

    .navbar.fixed-bottom {
        border-top-left-radius: 1rem;
        border-top-right-radius: 1rem;
        padding: 0.3rem 0;
    }
}

/* 藥局主題色（覆蓋 Bootstrap） */
.btn-primary {
    background-color: var(--pharmacy-theme-color) !important;
    border-color: var(--pharmacy-theme-color) !important;
    color: #fff !important;
}

    .btn-primary:hover, .btn-primary:focus, .btn-primary:active {
        background-color: var(--pharmacy-header-color) !important;
        border-color: var(--pharmacy-header-color) !important;
        color: #fff !important;
    }

.list-group-item.active, .list-group-item.active:focus, .list-group-item.active:hover {
    background-color: var(--pharmacy-theme-color) !important;
    border-color: var(--pharmacy-theme-color) !important;
    color: #fff !important;
    font-weight: bold;
}

.card-header.theme-bg {
    background: var(--pharmacy-theme-color) !important;
    color: #fff !important;
}

.modal-header.theme-header-bg, .card-header.theme-header-bg {
    background: var(--pharmacy-header-color) !important;
    color: #fff !important;
}

.header-bar {
    background: linear-gradient(90deg, var(--pharmacy-theme-color) 0%, var(--pharmacy-header-color) 100%) !important;
}

.navbar.fixed-bottom {
    background: linear-gradient(90deg, var(--pharmacy-header-color) 0%, var(--pharmacy-theme-color) 100%) !important;
}

/* 動效無障礙：使用者偏好減少動畫時，關閉轉場與動畫 */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation: none !important;
    }
}
