/* LogIt Custom Dark Theme - Applied Globally */
/* Based on project-logs.php design */

:root {
    /* Override Bootstrap defaults with project-logs.php colors */
    --logit-bg-primary: #0a0e1a;
    --logit-bg-secondary: #141824;
    --logit-bg-tertiary: #1f2937;
    --logit-border: #1f2937;
    --logit-border-light: #374151;
    --logit-border-lighter: #4b5563;
    --logit-text-primary: #f9fafb;
    --logit-text-secondary: #e4e4e7;
    --logit-text-muted: #9ca3af;
    --logit-text-dimmed: #6b7280;
    --logit-accent: #6366f1;
    --logit-accent-hover: #4f46e5;
}

/* Global Body Styles */
body {
    background: #0a0e1a !important;
    color: #e4e4e7 !important;
}

/* Content Area */
.wrapper,
.content-page {
    background: #0a0e1a !important;
}

/* Cards */
.card {
    background: #141824 !important;
    border: 1px solid #1f2937 !important;
    color: #e4e4e7 !important;
}

.card-header {
    background: #141824 !important;
    border-bottom: 1px solid #1f2937 !important;
    color: #f9fafb !important;
}

.card-body {
    background: #141824 !important;
    color: #e4e4e7 !important;
}

.card-footer {
    background: #141824 !important;
    border-top: 1px solid #1f2937 !important;
}

/* Tables */
.table {
    color: #e4e4e7 !important;
}

.table thead th {
    background: #141824 !important;
    border-color: #1f2937 !important;
    color: #f9fafb !important;
}

.table tbody td {
    border-color: #1f2937 !important;
    color: #e4e4e7 !important;
}

.table-striped tbody tr:nth-of-type(odd) {
    background: #0f1419 !important;
}

.table-hover tbody tr:hover {
    background: #1a1f2e !important;
}

/* Forms */
.form-control,
.form-select {
    background: #1f2937 !important;
    border: 1px solid #374151 !important;
    color: #f9fafb !important;
}

.form-control:focus,
.form-select:focus {
    background: #1f2937 !important;
    border-color: #6366f1 !important;
    color: #f9fafb !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

.form-control::placeholder {
    color: #6b7280 !important;
}

.form-label {
    color: #9ca3af !important;
}

/* Buttons */
.btn-primary {
    background: #6366f1 !important;
    border-color: #6366f1 !important;
    color: white !important;
}

.btn-primary:hover {
    background: #4f46e5 !important;
    border-color: #4f46e5 !important;
}

.btn-secondary {
    background: #374151 !important;
    border-color: #4b5563 !important;
    color: #f9fafb !important;
}

.btn-secondary:hover {
    background: #4b5563 !important;
    border-color: #6b7280 !important;
}

/* Modals */
.modal-content {
    background: #141824 !important;
    border: 1px solid #1f2937 !important;
}

.modal-header {
    background: #141824 !important;
    border-bottom: 1px solid #1f2937 !important;
    color: #f9fafb !important;
}

.modal-body {
    background: #141824 !important;
    color: #e4e4e7 !important;
}

.modal-footer {
    background: #141824 !important;
    border-top: 1px solid #1f2937 !important;
}

/* Dropdowns */
.dropdown-menu {
    background: #141824 !important;
    border: 1px solid #1f2937 !important;
}

.dropdown-item {
    color: #e4e4e7 !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: #1f2937 !important;
    color: #f9fafb !important;
}

.dropdown-divider {
    border-color: #1f2937 !important;
}

/* Navs & Tabs */
.nav-tabs {
    border-bottom: 1px solid #1f2937 !important;
}

.nav-tabs .nav-link {
    color: #9ca3af !important;
    border: 1px solid transparent !important;
}

.nav-tabs .nav-link:hover {
    color: #f9fafb !important;
    border-color: #1f2937 #1f2937 transparent !important;
}

.nav-tabs .nav-link.active {
    background: #141824 !important;
    border-color: #1f2937 #1f2937 #141824 !important;
    color: #f9fafb !important;
}

.nav-pills .nav-link {
    color: #9ca3af !important;
}

.nav-pills .nav-link:hover {
    background: #1f2937 !important;
    color: #f9fafb !important;
}

.nav-pills .nav-link.active {
    background: #6366f1 !important;
    color: white !important;
}

/* Alerts */
.alert {
    border: 1px solid #1f2937 !important;
}

.alert-primary {
    background: rgba(99, 102, 241, 0.1) !important;
    border-color: #6366f1 !important;
    color: #a5b4fc !important;
}

.alert-success {
    background: rgba(52, 211, 153, 0.1) !important;
    border-color: #34d399 !important;
    color: #6ee7b7 !important;
}

.alert-danger {
    background: rgba(248, 113, 113, 0.1) !important;
    border-color: #f87171 !important;
    color: #fca5a5 !important;
}

.alert-warning {
    background: rgba(251, 191, 36, 0.1) !important;
    border-color: #fbbf24 !important;
    color: #fcd34d !important;
}

.alert-info {
    background: rgba(96, 165, 250, 0.1) !important;
    border-color: #60a5fa !important;
    color: #93c5fd !important;
}

/* Badges */
.badge {
    font-weight: 500 !important;
}

.badge.bg-primary {
    background: #6366f1 !important;
}

.badge.bg-secondary {
    background: #374151 !important;
}

.badge.bg-success {
    background: #34d399 !important;
}

.badge.bg-danger {
    background: #f87171 !important;
}

.badge.bg-warning {
    background: #fbbf24 !important;
    color: #000 !important;
}

.badge.bg-info {
    background: #60a5fa !important;
}

/* Pagination */
.pagination .page-link {
    background: #1f2937 !important;
    border: 1px solid #374151 !important;
    color: #9ca3af !important;
}

.pagination .page-link:hover {
    background: #374151 !important;
    border-color: #4b5563 !important;
    color: #f9fafb !important;
}

.pagination .page-item.active .page-link {
    background: #6366f1 !important;
    border-color: #6366f1 !important;
    color: white !important;
}

.pagination .page-item.disabled .page-link {
    background: #1f2937 !important;
    border-color: #374151 !important;
    color: #6b7280 !important;
}

/* List Groups */
.list-group-item {
    background: #141824 !important;
    border: 1px solid #1f2937 !important;
    color: #e4e4e7 !important;
}

.list-group-item:hover {
    background: #1a1f2e !important;
}

.list-group-item.active {
    background: #6366f1 !important;
    border-color: #6366f1 !important;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent !important;
}

.breadcrumb-item,
.breadcrumb-item a {
    color: #9ca3af !important;
}

.breadcrumb-item.active {
    color: #f9fafb !important;
}

/* Progress */
.progress {
    background: #1f2937 !important;
}

.progress-bar {
    background: #6366f1 !important;
}

/* Text Colors */
.text-muted {
    color: #9ca3af !important;
}

.text-primary {
    color: #6366f1 !important;
}

.text-success {
    color: #34d399 !important;
}

.text-danger {
    color: #f87171 !important;
}

.text-warning {
    color: #fbbf24 !important;
}

.text-info {
    color: #60a5fa !important;
}

/* Borders */
.border,
.border-top,
.border-bottom,
.border-start,
.border-end {
    border-color: #1f2937 !important;
}

/* Background Utilities */
.bg-light {
    background: #1f2937 !important;
}

.bg-dark {
    background: #0a0e1a !important;
}

/* Topbar Override */
.app-topbar {
    background: #0a0e1a !important;
    border-bottom: 1px solid #1f2937 !important;
}

/* Sidebar Override */
.app-menu {
    background: #0a0e1a !important;
    border-right: 1px solid #1f2937 !important;
}

.menu-item a {
    color: #9ca3af !important;
}

.menu-item a:hover {
    background: #141824 !important;
    color: #f9fafb !important;
}

.menu-item.active a {
    background: #141824 !important;
    color: #6366f1 !important;
}

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

::-webkit-scrollbar-track {
    background: #0a0e1a;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* Page Title */
.page-title-box {
    background: transparent !important;
}

.page-title {
    color: #f9fafb !important;
}

/* Tooltips */
.tooltip-inner {
    background: #1f2937 !important;
    color: #f9fafb !important;
}

.tooltip .arrow::before {
    border-top-color: #1f2937 !important;
}

/* Popovers */
.popover {
    background: #141824 !important;
    border: 1px solid #1f2937 !important;
}

.popover-header {
    background: #1f2937 !important;
    border-bottom: 1px solid #374151 !important;
    color: #f9fafb !important;
}

.popover-body {
    color: #e4e4e7 !important;
}

/* Additional Component Overrides */

/* Input Groups */
.input-group-text {
    background: #1f2937 !important;
    border: 1px solid #374151 !important;
    color: #9ca3af !important;
}

/* Accordion */
.accordion-item {
    background: #141824 !important;
    border: 1px solid #1f2937 !important;
}

.accordion-button {
    background: #141824 !important;
    color: #f9fafb !important;
}

.accordion-button:not(.collapsed) {
    background: #1f2937 !important;
    color: #f9fafb !important;
}

.accordion-button:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1) !important;
}

.accordion-body {
    background: #141824 !important;
    color: #e4e4e7 !important;
}

/* Offcanvas */
.offcanvas {
    background: #0a0e1a !important;
    color: #e4e4e7 !important;
}

.offcanvas-header {
    border-bottom: 1px solid #1f2937 !important;
}

.offcanvas-title {
    color: #f9fafb !important;
}

/* Toast */
.toast {
    background: #141824 !important;
    border: 1px solid #1f2937 !important;
    color: #e4e4e7 !important;
}

.toast-header {
    background: #1f2937 !important;
    border-bottom: 1px solid #374151 !important;
    color: #f9fafb !important;
}

/* Spinner & Loading */
.spinner-border,
.spinner-grow {
    color: #6366f1 !important;
}

/* Code Blocks */
code {
    background: #1f2937 !important;
    color: #fca5a5 !important;
    padding: 2px 6px;
    border-radius: 4px;
}

pre {
    background: #0a0e1a !important;
    border: 1px solid #1f2937 !important;
    color: #e4e4e7 !important;
}

pre code {
    background: transparent !important;
}

/* Horizontal Rule */
hr {
    border-color: #1f2937 !important;
    opacity: 1 !important;
}

/* Links */
a {
    color: #6366f1 !important;
}

a:hover {
    color: #4f46e5 !important;
}

/* Selection */
::selection {
    background: #6366f1 !important;
    color: white !important;
}

::-moz-selection {
    background: #6366f1 !important;
    color: white !important;
}

/* Placeholder */
::placeholder {
    color: #6b7280 !important;
    opacity: 1 !important;
}

/* Focus Visible */
*:focus-visible {
    outline: 2px solid #6366f1 !important;
    outline-offset: 2px !important;
}

/* Sidebar Specific */
.leftside-menu {
    background: #0a0e1a !important;
    border-right: 1px solid #1f2937 !important;
}

.app-menu {
    background: #0a0e1a !important;
}

.side-nav {
    background: #0a0e1a !important;
}

.side-nav-item {
    color: #9ca3af !important;
}

.side-nav-link {
    color: #9ca3af !important;
    background: transparent !important;
}

.side-nav-link:hover {
    background: #141824 !important;
    color: #f9fafb !important;
}

.side-nav-link.active {
    background: #141824 !important;
    color: #6366f1 !important;
}

.menuitem-active > a {
    background: #141824 !important;
    color: #6366f1 !important;
}

.menu-title {
    color: #6b7280 !important;
    background: transparent !important;
}

/* Header / Topbar */
.navbar-custom {
    background: #0a0e1a !important;
    border-bottom: 1px solid #1f2937 !important;
}

.topbar-link {
    color: #9ca3af !important;
}

.topbar-link:hover {
    color: #f9fafb !important;
}

/* Search Bar in Topbar */
.app-search .form-control {
    background: #141824 !important;
    border: 1px solid #1f2937 !important;
    color: #f9fafb !important;
}

/* User Dropdown */
.topbar-dropdown .dropdown-menu {
    background: #141824 !important;
    border: 1px solid #1f2937 !important;
}

/* Notification Badge */
.noti-icon-badge {
    background: #f87171 !important;
}

/* Override any white backgrounds */
.bg-white {
    background: #141824 !important;
}

/* Override light text */
.text-dark {
    color: #e4e4e7 !important;
}

.text-body {
    color: #e4e4e7 !important;
}

/* Shadow overrides for dark theme */
.shadow,
.shadow-sm,
.shadow-lg {
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3) !important;
}

/* Subtle Background Colors */
.bg-primary-subtle {
    background: rgba(99, 102, 241, 0.15) !important;
}

.bg-secondary-subtle {
    background: rgba(55, 65, 81, 0.15) !important;
}

.bg-success-subtle {
    background: rgba(52, 211, 153, 0.15) !important;
}

.bg-danger-subtle {
    background: rgba(248, 113, 113, 0.15) !important;
}

.bg-warning-subtle {
    background: rgba(251, 191, 36, 0.15) !important;
}

.bg-info-subtle {
    background: rgba(96, 165, 250, 0.15) !important;
}

/* Avatar Styles */
.avatar-sm,
.avatar-md,
.avatar-lg {
    background: #1f2937 !important;
}

/* Stats/Metrics Cards */
.metric-card {
    background: #141824 !important;
    border: 1px solid #1f2937 !important;
}

/* Close Button */
.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%) !important;
}

/* Custom Scrollbar for specific containers */
.simplebar-content-wrapper,
.simplebar-track {
    scrollbar-width: thin;
    scrollbar-color: #374151 #0a0e1a;
}

/* Footer Styling */
.footer {
    background: #0a0e1a !important;
    border-top: 1px solid #1f2937 !important;
    color: #9ca3af !important;
}

/* Logo Styling */
.logo,
.logo-box,
.logo-topbar {
    background: #0a0e1a !important;
    padding: 0 !important;
}

.logo-dark {
    display: inline !important;
}

.logo-light {
    display: none !important;
}

.logo-lg img,
.logo-sm img {
    max-height: 24px !important;
    width: auto !important;
}

.logo-topbar {
    height: auto !important;
    line-height: normal !important;
    padding: 8px 0 !important;
}

/* Side Navigation - Consolidated */
.side-nav {
    background: #0a0e1a !important;
}

.side-nav-item {
    background: transparent !important;
}

.side-nav-link {
    color: #9ca3af !important;
    background: transparent !important;
    border-radius: 6px;
    margin: 2px 8px;
}

.side-nav-link:hover {
    background: #141824 !important;
    color: #f9fafb !important;
}

.side-nav-link.active,
.menuitem-active .side-nav-link {
    background: #141824 !important;
    color: #6366f1 !important;
}

.side-nav-link i {
    color: inherit !important;
}

.side-nav-second-level,
.side-nav-third-level {
    background: transparent !important;
}

/* Log Level Filter Pills - Readable Colors */
.filter-pill {
    background: #1f2937 !important;
    border: 1px solid #374151 !important;
    color: #9ca3af !important;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.filter-pill:hover {
    background: #374151 !important;
    color: #f9fafb !important;
    border-color: #4b5563 !important;
}

/* Critical Button - Red */
.filter-pill[data-level="CRITICAL"].active,
.filter-pill.active[onclick*="CRITICAL"] {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
    border-color: #f87171 !important;
}

/* Error Button - Orange */
.filter-pill[data-level="ERROR"].active,
.filter-pill.active[onclick*="ERROR"] {
    background: rgba(251, 146, 60, 0.2) !important;
    color: #fb923c !important;
    border-color: #fb923c !important;
}

/* Warn Button - Yellow */
.filter-pill[data-level="WARN"].active,
.filter-pill.active[onclick*="WARN"] {
    background: rgba(250, 204, 21, 0.2) !important;
    color: #facc15 !important;
    border-color: #facc15 !important;
}

/* Info Button - Blue */
.filter-pill[data-level="INFO"].active,
.filter-pill.active[onclick*="INFO"] {
    background: rgba(96, 165, 250, 0.2) !important;
    color: #60a5fa !important;
    border-color: #60a5fa !important;
}

/* Debug Button - Gray */
.filter-pill[data-level="DEBUG"].active,
.filter-pill.active[onclick*="DEBUG"] {
    background: rgba(148, 163, 184, 0.2) !important;
    color: #94a3b8 !important;
    border-color: #94a3b8 !important;
}

/* Level Badges - Same as filter pills for consistency */
.level-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.level-CRITICAL,
.badge-critical {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

.level-ERROR,
.badge-error {
    background: rgba(251, 146, 60, 0.15) !important;
    color: #fb923c !important;
    border: 1px solid rgba(251, 146, 60, 0.3) !important;
}

.level-WARN,
.badge-warn,
.badge-warning {
    background: rgba(250, 204, 21, 0.15) !important;
    color: #facc15 !important;
    border: 1px solid rgba(250, 204, 21, 0.3) !important;
}

.level-INFO,
.badge-info {
    background: rgba(96, 165, 250, 0.15) !important;
    color: #60a5fa !important;
    border: 1px solid rgba(96, 165, 250, 0.3) !important;
}

.level-DEBUG,
.badge-debug {
    background: rgba(148, 163, 184, 0.15) !important;
    color: #94a3b8 !important;
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
}
