body {
    overflow-x: hidden;  /* 防止水平滾動 */
    visibility: hidden;
}

main {
    overflow-x: hidden;  /* 防止水平滾動 */
    width: 100%;
}

.main-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50vh;
    padding: 2rem 1rem;
    margin-bottom: 5vh;
    gap: 20px;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3.5rem 0;
}

.login-card {
    width: 100%;
    max-width: 450px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    transform: translateY(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.login-header {
    background: linear-gradient(135deg, #1a2a6c, #2c3e50);
    padding: 1.5rem;
    text-align: center;
    position: relative;
}

.login-header h2 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);
}

.login-decoration {
    display: none;
}

#inputIdNumberForm {
    padding: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    display: block;
}

/* 統一輸入框和查詢按鈕樣式 */
.input-group {
    display: flex;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 2px solid #e9ecef;
    margin-bottom: 1.5rem !important;
}

.form-control {
    flex: 1;
    border: none !important;
    border-radius: 0 !important;
    padding: 0.8rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    box-shadow: none !important;
    border-color: transparent !important;
}

.btn-query {
    background: #f8f9fa;
    color: #2c3e50;
    border: none;
    border-radius: 0 !important;
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-query:hover {
    background: #e9ecef;
    color: #1a2a6c;
}

.btn-query i {
    font-size: 1.2rem;
}

.input-group:focus-within {
    border-color: #1a2a6c;
    box-shadow: 0 0 0 0.25rem rgba(26, 42, 108, 0.25);
}

.remember-me {
    margin-bottom: 1.5rem;
}

.btn-login {
    width: 100%;
    padding: 0.75rem 0;
    font-size: 1.1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #2c3e50, #1a2a6c);
    border: none;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.btn-login:hover {
    background: linear-gradient(135deg, #1a2a6c, #2c3e50);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 42, 108, 0.3);
}

.login-container h2 {
    color: #ffffff;
    font-size: 2rem;
    font-weight: 500;
    text-align: center;
}

.form-label {
    color: #2c3e50;
    font-weight: 500;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.input-group .btn-outline-secondary {
    display: none;
}

/* Bootstrap tooltip 客製化 */
.tooltip {
    font-size: 0.9rem;
}

.tooltip-inner {
    background-color: #2c3e50;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: #2c3e50;
}

.form-check {
    margin: 1rem 0 2rem 0;
}

.form-check-input {
    width: 1.2rem;
    height: 1.2rem;
    margin-top: 0.2rem;
    border: 2px solid #e9ecef;
}

.form-check-input:checked {
    background-color: #4b6cb7;
    border-color: #4b6cb7;
}

.form-check-label {
    color: #2c3e50;
    font-size: 1rem;
    margin-left: 0.5rem;
}

#loginBtn {
    background: linear-gradient(135deg, #4b6cb7, #182848);
    border: none;
    padding: 1rem;
    font-size: 1.1rem;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

#loginBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(75, 108, 183, 0.4);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .login-container {
        padding: 2rem;
    }
    
    #inputIdNumberForm {
        padding: 1.5rem !important;
    }
}

#piggy-bank-img {
    width: 100%;
    max-width: 400px;
    height: auto;
    margin: 2rem auto;
    display: block;
}

.progress-section {
    width: 100%;
    max-width: 500px;
    margin: 1rem auto;
    padding: 0 1rem;
}

.progress-title {
    text-align: center;
    color: #495057;
    margin-bottom: 1rem;
    font-weight: bold;
}

.progress-text {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    z-index: 2;
}

#piggy-bank-progress {
    width: 100% !important;
    max-width: 400px;
    height: auto !important;
    transform: scaleX(1.3);
    margin: -60px auto -30px;
    display: block;
}

.progress-text .current-value {
    color: #198754;
}

.progress-text .total-value {
    color: #343a40;
}

.progress-text .separator {
    margin: 0 0.3rem;
    color: #6c757d;
}

#piggy-bank-progress .ldBar {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

#piggy-bank-progress .ldBar-label {
    display: none;
}

.piggy-bank-info {
    width: 100%;
    max-width: 1200px;
    margin: 3rem auto;
    padding: 2rem 1rem;
    font-size: 1.1rem;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.info-title {
    color: #495057;
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f8f9fa;
}

.info-title .bi-piggy-bank-fill {
    color: #e67700;
    margin-right: 0.8rem;
}

.info-block {
    margin-bottom: 4rem;
}

.info-block h3 {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.info-block h3 i {
    font-size: 1.6rem;
}

.info-block h3 .bi-question-circle-fill {
    color: #20c997;
}

.info-block h3 .bi-trophy-fill {
    color: #ffcf21;
}

.info-block h3 .bi-calendar-check-fill {
    color: #748ffc;
}

.info-block h3 .bi-exclamation-circle-fill {
    color: #ff6b6b;
}

.member-tiers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.tier-card {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

/* 懸停效果 */
.tier-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* 點擊效果 */
.tier-card:active {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* 添加發光邊框效果 */
.tier-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 16px;
    padding: 2px;
    background: linear-gradient(45deg, #198754, #20c997);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tier-card:hover::before {
    opacity: 1;
}

/* 會員等級樣式 */
.tier-name {
    color: #198754;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
    position: relative;
}

.tier-reward {
    color: #fd7e14;
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.tier-chances {
    color: #6c757d;
    font-size: 1.1rem;
}

.notice-list {
    font-size: 1.1rem;
    line-height: 1.8;
}

.notice-list li {
    margin-bottom: 0.8rem;
}

/* 調整巢狀列表的間距 */
.notice-list ul {
    margin: 0.3rem 0;
    padding-left: 1.5rem;
}

.notice-list ul li {
    margin-bottom: 0.3rem;
}

.info-button-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
    margin: 1rem auto;
    padding: 0 1rem;
    flex-wrap: wrap;
}

.draw-info-btn,
.learn-more-btn {
    width: 100%;
    max-width: 200px;
    white-space: nowrap;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 500;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.draw-info-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(45deg, #20aa6b, #1e7e9e);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(25, 135, 84, 0.2);
}

.draw-info-btn:hover {
    background: linear-gradient(45deg, #157347, #176d8a);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(25, 135, 84, 0.3);
}

.modal-content {
    border-radius: 10px;
}

.table {
    margin-bottom: 0;
}

.winner-badge {
    display: inline-block;
    width: 40px;
    height: 40px;
    margin-right: 10px;
}

.learn-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 500;
    color: #fff;
    background: linear-gradient(45deg, #198754, #20aa6b);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(25, 135, 84, 0.2);
}

.learn-more-btn:hover {
    background: linear-gradient(45deg, #157347, #198754);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(25, 135, 84, 0.3);
}

.learn-more-btn .btn-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.5px;
}

.learn-more-btn .bi-info-circle-fill {
    font-size: 1.2rem;
}

.learn-more-btn .bi-chevron-down {
    font-size: 1.2rem;
    margin-top: 2px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(4px);
    }
    60% {
        transform: translateY(2px);
    }
}

/* 自定義 Modal 背景遮罩 */
.modal {
    background-color: rgba(0, 0, 0, 0.5);
}

/* 調整 Modal 內容的樣式 */
.modal-dialog {
    margin: 1.75rem auto;  /* 確保水平置中 */
    max-width: 800px;
    width: calc(100% - 2rem);  /* 左右留適當間距 */
}

/* Modal 內容區塊 */
.modal-content {
    max-height: calc(100vh - 3.5rem);  /* 設定最大高度 */
    overflow: hidden;  /* 防止內容溢出 */
    border-radius: 10px;
}

/* Modal body 可滾動 */
.modal-body {
    max-height: calc(100vh - 1rem);  /* 減去 header 和 footer 的高度 */
    overflow-y: auto;  /* 允許垂直滾動 */
    overflow-x: hidden;  /* 防止水平滾動 */
    padding: 1.3rem;
}

/* 自定義滾動條樣式 */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 確保 Modal 背景遮罩正確顯示 */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

/* 在小螢幕上調整 Modal 大小和間距 */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 1rem auto;
        width: calc(100% - 1rem);
    }

    .modal-body {
        padding: 1rem;
    }
}

/* 抽獎資訊 Modal 的標題樣式 */
.current-week-draw h6,
.last-week-result h6 {
    text-align: center;
    font-size: 1.4rem;
    font-weight: bold;
}

/* 日期範圍的樣式 */
#currentWeekDate,
#lastWeekDate {
    font-size: 1.3rem;
    color: #0056b3;
}

/* 總獎金樣式 */
.total-prize-container {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.6rem;
    font-weight: 600;
}

.total-prize-value {
    color: #198754;
}

/* 中獎者列的樣式 */
.winner-row {
    animation: winnerHighlight 2s infinite;
    position: relative;
}

/* 中獎者圖標樣式 */
.winner-icon {
    color: #ff9900;
    margin-left: 0.5rem;
    font-size: 1.2rem;
    animation: trophyBounce 1s infinite;
}

/* 中獎者背景動畫 */
@keyframes winnerHighlight {
    0% {
        background-color: rgba(40, 167, 69, 0.2);
    }
    50% {
        background-color: rgba(40, 167, 69, 0.4);
    }
    100% {
        background-color: rgba(40, 167, 69, 0.2);
    }
}

/* 獎盃圖標動畫 */
@keyframes trophyBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

/* 中獎者名字加粗 */
.winner-row td:first-child {
    font-weight: bold;
}

/* Loading 動畫容器 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

/* Loading 文字 */
.loading-text {
    margin-top: 1rem;
    color: #666;
    font-size: 1.1rem;
}

/* Loading 動畫 */
.lds-ripple {
    display: inline-block;
    position: relative;
    width: 80px;
    height: 80px;
}

.lds-ripple div {
    position: absolute;
    border: 4px solid #198754;
    opacity: 1;
    border-radius: 50%;
    animation: lds-ripple 1s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

.lds-ripple div:nth-child(2) {
    animation-delay: -0.5s;
}

@keyframes lds-ripple {
    0% {
        top: 36px;
        left: 36px;
        width: 0;
        height: 0;
        opacity: 0;
    }
    4.9% {
        top: 36px;
        left: 36px;
        width: 0;
        height: 0;
        opacity: 0;
    }
    5% {
        top: 36px;
        left: 36px;
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        top: 0px;
        left: 0px;
        width: 72px;
        height: 72px;
        opacity: 0;
    }
}

/* 表格響應式 */
.table-responsive {
    max-height: 300px;  /* 設定最大高度，大約可以顯示8筆資料 */
    overflow-y: auto;   /* 允許垂直滾動 */
    margin: 1rem 0;
    border-radius: 4px;
}

/* 固定表頭 */
.table thead th {
    position: sticky;
    top: 0;
    background-color: #343a40;
    color: #fff;
    z-index: 1;
    border-top: none;
}

/* 美化滾動條 */
.table-responsive::-webkit-scrollbar {
    width: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 確保表格內容不會有水平滾動 */
.table {
    margin-bottom: 0;
    width: 100%;
}

/* 在小螢幕上調整表格文字大小 */
@media (max-width: 576px) {
    .table {
        font-size: 0.9rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem;
    }

    .progress-text {
        font-size: 1.2rem;
    }

    .info-title {
        font-size: 2rem;
    }

    .info-block h3 {
        font-size: 1.5rem;
    }

    .progress-section {
        margin: 1.5rem auto;
    }

    .info-button-container {
        margin: 1.5rem auto;
    }
}

/* 在中等螢幕上調整佈局 */
@media (max-width: 768px) {
    .member-tiers {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .tier-card {
        padding: 1.5rem;
    }

    .info-button-container {
        flex-direction: column;
        align-items: center;
    }

    .draw-info-btn,
    .learn-more-btn {
        max-width: 100%;
    }
}

/* 在大螢幕上最大化內容寬度 */
@media (min-width: 1200px) {
    .piggy-bank-info {
        padding: 3rem;
    }

    .member-tiers {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 列印樣式 */
@media print {
    .info-button-container,
    .modal {
        display: none !important;
    }

    .piggy-bank-info {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* 動畫效能優化 */
@media (prefers-reduced-motion: reduce) {
    .winner-row,
    .winner-icon,
    .tier-card {
        animation: none;
        transform: none;
        transition: none;
    }
}

/* 當內容準備好時添加這個class */
body.content-loaded {
    visibility: visible;
}
