/* Custom Dark Theme CSS */

/* Main backgrounds */
body {
    background-color: #222736 !important;
    color: #e9ecef;
}

/* Navbar styling */
.main-header.navbar.navbar-expand.navbar-dark {
    background-color: #262b3c !important;
}

/* Sidebar styling */
.main-sidebar.sidebar-dark-primary {
    background-color: #2a3042 !important;
}

/* Brand/Logo area */
.brand-link {
    background-color: #2a3042 !important; /* Sử dụng cùng màu với sidebar */
    border-bottom: 1px solid #3a4055 !important; /* Thêm viền phân cách */
}

.sidebar-dark-primary .nav-sidebar>.nav-item>.nav-link.active {
    background-color: #556ee6 !important;
}

.sidebar-dark-primary .nav-sidebar>.nav-item:hover>.nav-link {
    background-color: rgba(85, 110, 230, 0.2);
}

/* Cards and content backgrounds */
.card, .info-box {
    background-color: #2a3042 !important;
    color: #ffffff; /* Màu trắng thay vì e9ecef */
    border: none;
    box-shadow: 0 0 1px rgba(0,0,0,.125), 0 1px 3px rgba(0,0,0,.2);
}

.card-header {
    border-bottom: 1px solid #3a4055;
    background-color: #2f3548 !important;
}

.card-title {
    color: #ffffff; /* Màu trắng cho tiêu đề */
    font-weight: 600; /* Đậm hơn */
}

.card-body {
    color: #ffffff;
}

/* Text trong card */
.card p, .card span, .card div {
    color: #e9ecef;
}

.card strong, .card h1, .card h2, .card h3, .card h4, .card h5, .card h6 {
    color: #ffffff;
}

.content-wrapper {
    background-color: #222736 !important;
}

/* Button colors */
.btn-primary {
    background-color: #556ee6 !important;
    border-color: #556ee6 !important;
}

.btn-primary:hover {
    background-color: #4458c9 !important;
    border-color: #4458c9 !important;
}

.btn-success {
    background-color: #34c38f !important;
    border-color: #34c38f !important;
}

.btn-success:hover {
    background-color: #2aa579 !important;
    border-color: #2aa579 !important;
}

.btn-info {
    background-color: #34c38f !important;
    border-color: #34c38f !important;
}

.btn-info:hover {
    background-color: #2aa579 !important;
    border-color: #2aa579 !important;
}

.btn-warning {
    background-color: #f1b44c !important;
    border-color: #f1b44c !important;
}

.btn-warning:hover {
    background-color: #eea62b !important;
    border-color: #eea62b !important;
}

.btn-danger {
    background-color: #f46a6a !important;
    border-color: #f46a6a !important;
}

.btn-danger:hover {
    background-color: #f24848 !important;
    border-color: #f24848 !important;
}

/* Alert backgrounds */
.alert-item {
    background-color: #2a3042 !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.alert-info {
    background-color: #2a3042 !important;
    color: #ffffff;
}

.alert-actions {
    background-color: #2a3042 !important;
    border-top: 1px solid #3a4055;
}

/* Alert item meta text */
.alert-meta {
    color: #ffffff !important;
}

.alert-meta i {
    color: #a8b3cf !important;
}

/* Bootstrap alerts - khác với alert-item */
.alert-primary {
    background-color: rgba(85, 110, 230, 0.2) !important;
    color: #ffffff;
    border-color: rgba(85, 110, 230, 0.4);
}

.alert-success {
    background-color: rgba(52, 195, 143, 0.2) !important;
    color: #ffffff;
    border-color: rgba(52, 195, 143, 0.4);
}

.alert-warning {
    background-color: rgba(241, 180, 76, 0.2) !important;
    color: #ffffff;
    border-color: rgba(241, 180, 76, 0.4);
}

.alert-danger {
    background-color: rgba(244, 106, 106, 0.2) !important;
    color: #ffffff;
    border-color: rgba(244, 106, 106, 0.4);
}

.alert-info {
    background-color: rgba(52, 195, 143, 0.2) !important;
    color: #ffffff;
    border-color: rgba(52, 195, 143, 0.4);
}

/* Form controls */
.form-control {
    background-color: #262b3c; /* Hơi tối hơn nền chính */
    border: 1px solid #3a4055;
    color: #ffffff;
}

.form-control:focus {
    background-color: #2f3548;
    color: #ffffff;
    border-color: #556ee6;
    box-shadow: 0 0 0 0.2rem rgba(85, 110, 230, 0.25);
}

.input-group-text {
    background-color: #2f3548;
    border: 1px solid #3a4055;
    color: #e9ecef;
}

/* Labels */
label {
    color: #a8b3cf;
    font-weight: 500;
}

/* Select and options */
select.form-control {
    background-color: #262b3c;
    color: #ffffff;
}

select.form-control option {
    background-color: #262b3c;
    color: #ffffff;
}

/* Placeholder text */
::placeholder {
    color: #8a94a7 !important;
    opacity: 0.7;
}

/* Table styling */
.table {
    color: #e9ecef;
}

.table thead th {
    background-color: #262b3c; /* Hơi đậm hơn màu thẻ */
    color: #ffffff;
    border-color: #3a4055;
}

.table tbody td {
    background-color: #262b3c; /* Nhạt hơn màu nền chính và đậm hơn màu thẻ */
    border-color: #3a4055;
}

.table-hover tbody tr:hover {
    background-color: #303650;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: #242c3d; /* Màu xen kẽ */
}

.table-striped tbody tr:nth-of-type(even) {
    background-color: #262b3c;
}

/* Modal styling */
.modal-content {
    background-color: #2a3042; /* Trùng với màu thẻ */
    color: #ffffff; /* Màu trắng cho font chữ trong modal */
}

.modal-header {
    background-color: #2f3548; /* Hơi đậm hơn màu thẻ, giống header card */
    border-bottom: 1px solid #3a4055;
    color: #ffffff;
}

.modal-body {
    color: #ffffff;
}

.modal-footer {
    border-top: 1px solid #3a4055;
    background-color: #2a3042;
}

.close {
    color: #ffffff;
}

.close:hover {
    color: #ff6b6b; /* Highlight khi hover */
    opacity: 1;
}

/* Nâng cao độ tương phản cho text trong modal */
.modal-title {
    font-weight: 600;
    color: #ffffff;
}

.modal label {
    color: #e9ecef;
}

.modal strong {
    color: #ffffff;
}

/* Cải thiện các phần tử trong modal */
.modal .info-item strong {
    color: #a8b3cf; /* Màu sáng hơn cho tiêu đề */
}

.modal .info-item div {
    color: #ffffff; /* Màu trắng cho nội dung */
}

/* Badge colors */
.badge.bg-primary {
    background-color: #556ee6 !important;
    color: #ffffff !important;
}

.badge.bg-success {
    background-color: #34c38f !important;
    color: #ffffff !important;
}

.badge.bg-warning {
    background-color: #f1b44c !important;
    color: #212529 !important;
}

.badge.bg-danger {
    background-color: #f46a6a !important;
    color: #ffffff !important;
}

.badge.bg-info {
    background-color: #34c38f !important;
    color: #ffffff !important;
}

.badge.bg-secondary {
    background-color: #6c757d !important;
    color: #ffffff !important;
}

/* Làm badges nổi bật hơn */
.badge {
    padding: 0.4em 0.6em;
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Info box colors */
.info-box-icon.bg-info {
    background-color: #34c38f !important;
}

.info-box-icon.bg-warning {
    background-color: #f1b44c !important;
}

.info-box-icon.bg-danger {
    background-color: #f46a6a !important;
}

.info-box-icon.bg-success {
    background-color: #34c38f !important;
}

/* Pagination */
.pagination .page-link {
    background-color: #2a3042;
    border-color: #3a4055;
    color: #e9ecef;
}

.pagination .page-item.active .page-link {
    background-color: #556ee6;
    border-color: #556ee6;
}

.pagination .page-item.disabled .page-link {
    background-color: #2a3042;
    border-color: #3a4055;
    color: #6c757d;
}

/* Login page specific styling */
body.login-page {
    background: #222736 !important;
    background: linear-gradient(135deg, #222736 0%, #2a3042 100%) !important;
}

.login-box .card {
    background: #2a3042 !important;
}

.login-box .card-body {
    background: #2a3042 !important;
}

.login-logo h2 {
    color: #556ee6 !important;
}

.login-logo p {
    color: #b9c0cf !important;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #222736;
}

::-webkit-scrollbar-thumb {
    background: #3a4055;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #556ee6;
}

/* Fix for alert items */
.alert-item {
    background-color: #2a3042 !important;
}

.alert-thumb {
    background-color: #222736 !important;
}

.alert-info, .alert-actions {
    background-color: #2a3042 !important;
}

/* Nâng cao độ tương phản cho thông tin alert */
.alert-camera, .alert-event, .alert-time, .alert-level, .alert-status {
    color: #ffffff !important;
}

.alert-camera i, .alert-event i, .alert-time i, .alert-level i, .alert-status i {
    color: #a8b3cf !important;
}

/* Alert details trong modal */
.alert-detail-info {
    background-color: #2f3548 !important;
    border-radius: 5px;
    padding: 15px;
}

.alert-sidebar-info {
    background-color: #2f3548 !important;
}

/* Fix for video containers */
.video-container {
    background-color: #1a1f2e !important; /* Tối hơn so với màu nền chính */
    border: 1px solid #262b3c;
    border-radius: 5px;
    overflow: hidden;
}

/* Fix for sidebar menu */
.nav-sidebar .nav-item .nav-link {
    color: #b9c0cf !important;
}

.nav-sidebar .nav-item .nav-link:hover {
    color: #ffffff !important;
}

/* Footer styling */
.main-footer {
    background-color: #262b3c !important;
    color: #b9c0cf !important;
    border-top: 1px solid #3a4055 !important;
}

/* System status box styling */
.info-box {
    display: flex;
    min-height: 80px;
    background: #fff;
    width: 100%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    border-radius: 0.25rem;
    margin-bottom: 1rem;
    flex-direction: row; /* Ensure horizontal layout */
}

.info-box-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    color: #fff;
    font-size: 1.875rem;
    border-radius: 0.25rem 0 0 0.25rem;
    flex-shrink: 0; /* Prevent the icon from shrinking */
}

.info-box-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 10px;
    flex-grow: 1; /* Allow content to take available space */
    text-align: left; /* Left align text */
}

/* Center the row of info boxes while maintaining their internal layout */
.dashboard-container .card-body .row:first-child {
    display: flex;
    justify-content: center;
}
