/* === FONT & SCROLLBAR === */
body { 
    font-family: 'Inter', sans-serif; 
}
::-webkit-scrollbar { 
    width: 6px; 
}
::-webkit-scrollbar-track { 
    background: #e2e8f0; /* light:bg-slate-200 */
} 
::-webkit-scrollbar-thumb { 
    background: #94a3b8; /* light:bg-slate-400 */
    border-radius: 3px; 
} 
.dark ::-webkit-scrollbar-track { 
    background: #2d3748; /* dark:bg-slate-800 */
} 
.dark ::-webkit-scrollbar-thumb { 
    background: #4a5568; /* dark:bg-slate-600 */
} 

/* === SPINNER === */
@keyframes spin { 
    to { transform: rotate(360deg); } 
}
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #3b82f6; 
    border-radius: 50%; width: 40px; height: 40px;
    animation: spin 1s linear infinite;
}
.dark .spinner {
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-left-color: #3b82f6;
}

/* === TOMSELECT SÁNG/TỐI === */
/* Light Mode Default */
.ts-control {
    background-color: #ffffff !important; 
    border: 1px solid #cbd5e1 !important; /* border-slate-300 */
    border-radius: 0.5rem !important; 
    padding: 0.75rem !important;
    color: #111827 !important; /* text-gray-900 */
    font-size: 1.125rem !important;
}
.ts-control.focus {
    box-shadow: none !important; 
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 2px #3b82f6 !important;
}
.ts-dropdown {
    background: #ffffff !important; /* bg-white */
    border: 1px solid #cbd5e1 !important; /* border-slate-300 */
    color: #111827 !important; /* text-gray-900 */
    z-index: 1000; /* Đã tăng z-index */
    position: relative; /* Đã thêm position */
}
.ts-dropdown .ts-option.active { 
    background: #3b82f6 !important; 
    color: white !important; 
}
.ts-dropdown .ts-option { 
    padding: 0.75rem 0.5rem !important; 
}
.ts-dropdown .ts-input {
    background: #f1f5f9 !important; /* bg-slate-100 */
    color: #111827 !important; /* text-gray-900 */
    border: 1px solid #cbd5e1 !important; /* border-slate-300 */
}
.ts-wrapper .fi {
    width: 1.5em; height: 1.5em; margin-right: 0.5rem;
    border-radius: 50%; object-fit: cover; vertical-align: middle;
}
/* Dark Mode Overrides */
.dark .ts-control {
    background-color: #374151 !important; /* dark:bg-slate-700 */
    border: 1px solid #4b5563 !important; /* dark:border-slate-600 */
    color: white !important;
}
.dark .ts-dropdown {
    background: #1f2937 !important; /* dark:bg-slate-800 */
    border: 1px solid #4b5563 !important; /* dark:border-slate-600 */
    color: white !important;
}
.dark .ts-dropdown .ts-input {
    background: #374151 !important; /* dark:bg-slate-700 */
    color: white !important;
    border: 1px solid #4b5563 !important; /* dark:border-slate-600 */
}

/* === NÚT CHUYỂN NHANH === */
.quick-amount-btn {
    /* Dùng @apply yêu cầu Tailwind xử lý, nhưng vì đây là file CSS thuần, 
       chúng ta cần viết lại các class */
    padding-left: 0.75rem; /* px-3 */
    padding-right: 0.75rem;
    padding-top: 0.25rem; /* py-1 */
    padding-bottom: 0.25rem;
    background-color: #e2e8f0; /* bg-slate-200 */
    color: #334155; /* text-slate-700 */
    border-radius: 9999px; /* rounded-full */
    font-size: 0.875rem; /* text-sm */
    font-weight: 500; /* font-medium */
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; /* transition-colors */
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms; /* duration-150 (mặc định) */
}
.dark .quick-amount-btn {
    background-color: #334155; /* dark:bg-slate-700 */
    color: #cbd5e1; /* dark:text-slate-300 */
}
.quick-amount-btn:hover {
    background-color: #3b82f6; /* hover:bg-blue-500 */
    color: #ffffff; /* hover:text-white */
}
.dark .quick-amount-btn:hover {
    background-color: #2563eb; /* dark:hover:bg-blue-600 */
}
/* Nút Xóa đặc biệt */
.quick-amount-btn.bg-red-500 {
    background-color: #ef4444;
}
.quick-amount-btn.bg-red-500:hover {
    background-color: #dc2626;
}
.dark .quick-amount-btn.dark\:bg-red-600 {
     background-color: #dc2626;
}
.dark .quick-amount-btn.dark\:hover\:bg-red-700:hover {
     background-color: #b91c1c;
}

/* === (CSS PANEL INFO) === */

/* Lớp để khóa cuộn trang nền khi panel mở */
.overflow-hidden-body {
    overflow: hidden;
}

/* Kiểu hiển thị panel (khi có class 'open') */
#info-panel-overlay.open {
    opacity: 1;
}
#info-panel.open {
    transform: translateY(0);
}

/* Định dạng danh sách thông tin tiền tệ (ví dụ) */
#info-panel-content dl {
    @apply space-y-4; /* Tailwind class */
}
#info-panel-content dt {
     @apply font-semibold text-gray-900 dark:text-white flex items-center; /* Tailwind class */
}
#info-panel-content dt .fi { /* Căn chỉnh cờ trong dt */
     @apply mr-2 flex-shrink-0; /* Tailwind class */
}
#info-panel-content dd {
     @apply pl-8 text-sm text-slate-600 dark:text-slate-400; /* Tailwind class */
}
#info-panel-content dd strong {
     @apply font-medium text-slate-700 dark:text-slate-300; /* Tailwind class */
}

/* === CSS POPUP === */

/* Kiểu hiển thị popup (khi có class 'open') */
#custom-popup-overlay.open {
    opacity: 1;
}
#custom-popup.open {
    opacity: 1;
    transform: scale(1);
}

/* === CSS MARQUEE (NHIỀU DÒNG) === */

/* Định nghĩa animation chạy từ phải sang trái */
@keyframes marquee-multi {
    0%   { transform: translateX(0); } /* Bắt đầu từ vị trí bình thường */
    100% { transform: translateX(-50%); } /* Di chuyển sang trái đúng bằng 1 nửa chiều rộng (chiều dài của 1 dãy) */
}

/* Áp dụng animation vào div bọc ngoài */
.marquee-content {
    /* Đảm bảo nội dung không bị xuống dòng và nằm trên 1 hàng */
    display: inline-block; 
    white-space: nowrap; /* Cần thiết */
    /* Áp dụng animation */
    /* Thời gian animation (ví dụ: 40s) nên đủ dài để đọc hết dãy thông báo */
    animation: marquee-multi 40s linear infinite; 
}

/* CSS cho từng item (Nếu cần tùy chỉnh thêm) */
.marquee-item {
    display: inline-block; /* Quan trọng */
}

/* Tùy chọn: Dừng animation khi di chuột vào */
#marquee-container:hover .marquee-content {
    animation-play-state: paused;
}
