/* ========================================
   全站基本樣式 + 深色模式 CSS 變數
   ======================================== */

/* === 基本設定 === */
html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

/* === 全站 CSS 變數（淺色模式預設） === */
:root {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: rgba(59, 130, 246, 0.1);
    
    --text-primary: #1f2937;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    
    --bg-page: #f3f4f6;
    --bg-card: #ffffff;
    --bg-input: #f9fafb;
    --bg-hover: #f3f4f6;
    --bg-footer: #fafafa;
    
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

/* === 深色模式 CSS 變數 === */
:root[data-theme="dark"] {
    --primary: #60a5fa;
    --primary-hover: #3b82f6;
    --primary-light: rgba(96, 165, 250, 0.15);
    
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    --bg-page: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.8);
    --bg-input: rgba(51, 65, 85, 0.6);
    --bg-hover: rgba(51, 65, 85, 0.5);
    --bg-footer: rgba(15, 23, 42, 0.7);
    
    --border-color: rgba(71, 85, 105, 0.5);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.25);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.35);
}

/* === 基本 body 樣式 === */
body {
    margin-bottom: 60px;
    color: var(--text-primary);
    background-color: var(--bg-page);
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
    position: relative;
    min-height: 100%;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* === 通用元件深色模式 === */
:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select {
    background-color: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-primary);
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder {
    color: var(--text-muted);
}

:root[data-theme="dark"] .form-control {
    background-color: var(--bg-input);
    border-color: var(--border-color);
    color: var(--text-primary);
}

:root[data-theme="dark"] .form-control:focus {
    background-color: var(--bg-input);
    border-color: var(--primary);
    color: var(--text-primary);
}

/* === 通用卡片深色模式 === */
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .box {
    background: var(--bg-card);
    border-color: var(--border-color);
}

/* === Navbar 動畫設定 === */

.nav-lottie {
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: transform .2s ease;
}

.nav-lottie:hover {
    transform: scale(1.15);
}

/* === 貓狗散步動畫：固定在前景滑過 === */
.main-nav {
    background: #ffffff;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 9000;
    overflow: visible;
}

:root[data-theme="dark"] .main-nav {
    background: rgba(15, 23, 42, 0.85);

}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    position: relative;
    z-index: 2;
    background: #ffffff;
}

:root[data-theme="dark"] .nav-inner {
    background: rgba(15, 23, 42, 0.95); /* 改這裡：用深色背景而不是 transparent */
}

.nav-animations {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3; /* 從 1 降到 0 */
    overflow: visible; /* 只裁貓狗動畫 */
}


.nav-lottie {
    width: 64px;
    height: 64px;
    position: absolute;
    pointer-events: auto;
    cursor: pointer;
}

.nav-lottie-active {
    filter: drop-shadow(0 0 6px rgb(117, 251, 144));
}

.nav-lottie-cat {
    animation: cat-walk-full 20s linear infinite;
}

.nav-lottie-dog {
    animation: dog-walk-full 24s linear infinite;
}

@keyframes cat-walk-full {
    0% {
        right: -80px;
        top: 17px;
    }
    100% {
        right: 100%;
        top: 17px;
    }
}

@keyframes dog-walk-full {
    0% {
        left: -120px;
        top: 35px;
    }
    100% {
        left: 100%;
        top: 35px;
    }
}

/* === 通用連結顏色 === */
a {
    color: var(--primary);
}

a:hover {
    color: var(--primary-hover);
}

:root[data-theme="dark"] a {
    color: var(--primary);
}

/* === 通用按鈕樣式 === */
.btn-primary-custom {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary-custom:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-outline-custom {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline-custom:hover {
    background: var(--primary);
    color: #fff;
}
/* 保證通知 dropdown 不被任何模式裁掉 */
.main-nav,
.nav-inner,
header {
    overflow: visible !important;
}
/* 確保通知鈴鐺與 dropdown 永遠在最上層 */
.notification-bell-wrapper {
    position: relative;
    z-index: 9500;
}
:root {
    --bg-header: #f9fafb;
}

    :root[data-theme="dark"] {
        --bg-header: rgba(15,23,42,.85);
    }

/* === 通知 dropdown 強制置頂（修正 dark mode 被遮擋） === */
#notificationDropdown {
    position: absolute;
    z-index: 99999; /* 比 pc-page / pc-shell 都高 */
}