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

html {
    height: 100%;
    height: 100dvh;
    width: 100%;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}
body {
    height: 100%;
    min-height: 100dvh;
    min-height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans HK', sans-serif;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: none;
}

/* Glass card effect */
.glass-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}
.dark .glass-card {
    background: #1e293b;
    border: 1px solid rgba(51, 65, 85, 0.8);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 5px; }
.dark ::-webkit-scrollbar-thumb { background: #475569; }
.custom-scrollbar::-webkit-scrollbar { width: 4px; height: 4px; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Toast animation */
@keyframes slideInUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.toast-animate { animation: slideInUp 0.3s ease-out forwards; }

/* Mobile tab switching */
@media (max-width: 767px) {
    .mobile-tab-content { display: none !important; }
    .mobile-tab-content.mobile-active { display: flex !important; flex-direction: column; min-height: 0; }
}

/* Safe area spacing (iOS notch / home indicator) */
.safe-pb-nav {
    padding-bottom: max(env(safe-area-inset-bottom), 12px);
}
.pt-safe { padding-top: env(safe-area-inset-top); }

/* Mobile: fix bottom nav to true screen bottom on iPhone (safe area) */
@media (max-width: 767px) {
    #mobile-bottom-nav {
        padding-bottom: max(env(safe-area-inset-bottom), 12px);
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    .main-content-area {
        padding-bottom: calc(100px + env(safe-area-inset-bottom));
    }
    /* 待辦區塊：手機上固定可視高度並區塊內捲動 */
    #todo-list-wrap {
        min-height: 180px;
        min-height: 25dvh;
        max-height: 45vh;
        max-height: 45dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Database image preview */
.db-img-preview {
    max-height: 120px;
    border-radius: 8px;
    object-fit: cover;
    background: #f1f5f9;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}
.dark .db-img-preview { background: #0f172a; }

/* Search highlight */
.highlight-text {
    background-color: rgba(250, 204, 21, 0.4);
    border-radius: 2px;
    padding: 0 2px;
}

/* Contenteditable placeholder */
[contenteditable]:empty:before {
    content: attr(placeholder);
    color: #94a3b8;
    pointer-events: none;
    display: block;
}
.dark [contenteditable]:empty:before { color: #64748b; }

/* Tooltip */
.tooltip-custom { position: relative; }
.tooltip-custom:hover::after {
    content: attr(data-tooltip);
    white-space: pre-wrap;
    position: absolute;
    z-index: 1000;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1e293b;
    color: #f8fafc;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 10px;
    line-height: 1.4;
    width: max-content;
    max-width: 200px;
    text-align: left;
    margin-bottom: 6px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    pointer-events: none;
}
