/* Tùy chỉnh thanh cuộn (Scrollbar) ẩn đi cho mượt mà nhưng vẫn cuộn được */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.3);
}

/* Hiệu ứng Kính mờ (Glassmorphism) chuẩn Apple cho Navbar */
.glass-nav {
    background-color: rgba(255, 255, 255, 0.75);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

/* Animation mượt mà cho nội dung xuất hiện (Fade In Up) */
.fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tùy chỉnh bóng (Shadow) của thẻ Card theo hướng mềm mại của iOS */
.apple-card {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
}
.apple-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
}

/* Màn hình Loading toàn trang khi đợi Firebase Auth */
.global-loader {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.4s ease;
}
.global-loader.hidden {
    opacity: 0;
    pointer-events: none;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: #0066cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Tối ưu hóa CSS cho việc In / Xuất PDF (Cực kỳ quan trọng) */
@media print {
    body {
        background: #fff;
        font-size: 12pt;
    }
    nav, button, .no-print {
        display: none !important;
    }
    .print-container {
        width: 100%;
        margin: 0;
        padding: 0;
    }
    /* Chống cắt đôi dòng chữ hoặc ảnh khi qua trang PDF mới */
    p, h2, h3, img {
        page-break-inside: avoid;
    }
}
