/* 近D玩 - 頁尾、底部導航、Toast、Modal 樣式（原本 inline 喺 includes/footer.php） */
/* 浮標註冊按鈕 */
.float-register-btn {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 70px);
    /* 移到左下角，避開右下角嘅 AI 助手 / 返頂掣 stack（解決有時撳唔到嘅疊位問題） */
    left: 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #63b949;
    color: #fff;
    padding: 10px 16px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(99,185,73,0.4);
    z-index: 998;
    transition: transform 0.2s, box-shadow 0.2s;
}
.float-register-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99,185,73,0.5);
    color: #fff;
}
@media (min-width: 769px) {
    .float-register-btn {
        display: none;
    }
}
/* ============================================
   底部導航列
   ============================================ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-height);
    background: var(--white);
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: var(--text-light);
    text-decoration: none;
    position: relative;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item .material-icons-round {
    font-size: 24px;
    transition: transform 0.2s;
}

.bottom-nav-item .nav-label {
    font-size: 11px;
    margin-top: 2px;
    font-weight: 500;
}

.bottom-nav-item:hover {
    color: var(--green);
}

.bottom-nav-item.active {
    color: var(--green);
}

.bottom-nav-item.active .material-icons-round {
    transform: scale(1.1);
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: var(--green);
    border-radius: 0 0 3px 3px;
}

/* ============================================
   返回頂部
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: calc(var(--bottom-nav-height) + 16px);
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--white);
    color: var(--green);
    border: 1.5px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s;
    z-index: 999;
    box-shadow: var(--shadow);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--green);
    color: var(--white);
    border-color: var(--green);
}

/* ============================================
   載入中遮罩
   ============================================ */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ============================================
   Toast 提示
   ============================================ */
.toast-container {
    position: fixed;
    top: calc(var(--header-height) + 16px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    color: var(--white);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    pointer-events: auto;
    white-space: nowrap;
}

.toast-success { background: var(--green); }
.toast-error   { background: var(--red); }
.toast-warning { background: var(--orange); }
.toast-info    { background: var(--dark-green); }

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
    from { opacity: 1; }
    to   { opacity: 0; transform: translateY(-12px); }
}

/* ============================================
   確認對話框
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 16px;
}

.modal-overlay.show {
    display: flex;
}

.modal-box {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 360px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9); }
    to   { opacity: 1; transform: scale(1); }
}

.modal-box h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.modal-box p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-actions .btn {
    flex: 1;
}

/* ============================================
   社交媒體圖標
   ============================================ */
.footer-social {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: inherit;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}

.social-icon:hover {
    background: var(--green);
    color: var(--white);
    transform: scale(1.1);
}

.social-icon svg {
    width: 20px;
    height: 20px;
}

/* 手機版社交列 */
.mobile-social-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: calc(var(--bottom-nav-height));
}

.mobile-social-bar .social-icon {
    width: 36px;
    height: 36px;
    background: var(--white);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .site-footer {
        display: block;
        margin-top: 18px;
    }
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 18px;
    }
    .footer-brand {
        grid-column: 1 / -1;
    }
    .footer-col h4 {
        font-size: 13px;
        margin-bottom: 10px;
    }
    .footer-col a {
        font-size: 13px;
        padding: 3px 0;
    }
    .mobile-social-bar {
        display: none;
    }
}

/* ============================================
   Desktop - 隱藏底部導航列
   ============================================ */
@media (min-width: 769px) {
    .bottom-nav {
        display: none;
    }
    .back-to-top {
        bottom: 24px;
    }
    .site-footer {
        display: block !important;
        border-top: 1px solid var(--border);
        margin-top: 24px;
    }
    .mobile-social-bar {
        display: none;
    }
}
