/* General Body Styles */
body {
    background-color: #f3f4f6;
    font-family: 'Inter', sans-serif;
    color: #1f2937;
}

/* Enhanced Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
}

.modal-content {
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

/* Sidebar Styling */
.sidebar {
    background-color: #1f2937;
    transition: width 0.3s ease;
    width: 256px; /* Default width */
}

.sidebar.collapsed {
    width: 80px; /* Collapsed width */
}

.sidebar.collapsed .sidebar-text,
.sidebar.collapsed .user-info h4,
.sidebar.collapsed .user-info span {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .user-info {
    justify-content: center;
    padding: 1rem 0.5rem; /* Adjust padding for collapsed state */
}

.sidebar.collapsed .user-info img {
    margin: 0 auto; /* Center the avatar */
    display: block; /* Ensure it's a block element for margin auto to work */
    width: 40px; /* Adjust size for collapsed state */
    height: 40px; /* Adjust size for collapsed state */
    border-width: 1px; /* Keep a subtle border */
}

.sidebar.collapsed .user-info div {
    display: none; /* Hide text elements */
}

.sidebar.collapsed #logoutBtn span {
    display: none;
}

.sidebar.collapsed .logo-text {
    display: none; /* Hide logo text when collapsed */
}

.sidebar.collapsed .p-4.flex.flex-col.items-center {
    padding: 1rem 0.5rem; /* Adjust padding for logo area */
}

.sidebar.collapsed .p-4.flex.flex-col.items-center img {
    margin-bottom: 0; /* Remove bottom margin from logo image */
}

.sidebar .logo-text {
    font-weight: 700;
    color: #e5e7eb;
}

.sidebar .user-info {
    border-top: 1px solid #374151;
    border-bottom: 1px solid #374151;
}

.sidebar nav a {
    color: #d1d5db;
    transition: background-color 0.2s, color 0.2s;
    border-left: 3px solid transparent;
}

.sidebar nav a:hover {
    background-color: #374151;
    color: #ffffff;
}

.sidebar nav a.text-blue-400 {
    color: #60a5fa;
    border-left-color: #60a5fa;
    background-color: #2563eb1a;
}

/* Main Content Styling */
.main-content {
    transition: margin-left 0.3s ease;
    margin-left: 256px; /* Default margin */
}

.main-content.expanded {
    margin-left: 80px; /* Adjusted margin when sidebar is collapsed */
}

/* Card Styles */
.log-card, .settings-hover-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.log-card:hover, .settings-hover-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Log Specific Styles */
.log-card {
    border-left-width: 4px;
    display: flex; /* Use flexbox for the main card content */
    align-items: flex-start;
    gap: 1rem; /* Space between icon and content */
}

.log-card .log-icon {
    font-size: 1.75rem; /* Larger icon */
    color: #6b7280; /* Default icon color */
    flex-shrink: 0;
    padding-top: 0.25rem; /* Align icon with text baseline */
}

.log-card .log-content {
    flex-grow: 1;
    width: 100%; /* Ensure it takes full available width */
}

.log-card .log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    /* flex-wrap: wrap; removed */
    width: 100%; /* Ensure header spans full width of its parent */
}

.log-card .log-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937; /* Darker text for title */
    display: flex;
    align-items: center;
    flex-wrap: nowrap; /* Ensure title elements stay on one line */
    flex-shrink: 1; /* Allow title to shrink */
    min-width: 0; /* Required for flex-shrink to work with text overflow */
    overflow: hidden; /* Hide overflowing content */
    text-overflow: ellipsis; /* Add ellipsis for overflow */
    white-space: nowrap; /* Prevent text from wrapping within the title */
    flex-grow: 1; /* Allow title to grow and push timestamp */
}

.log-card .log-title .log-type-name {
    font-weight: 700;
    margin-right: 0.5rem;
    flex-shrink: 0; /* Prevent log type name from shrinking */
}

.log-card .log-title .server-tag {
    font-size: 0.75rem;
    background-color: #e5e7eb;
    color: #4b5563;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px; /* Full rounded */
    margin-left: 0.5rem;
    flex-shrink: 0; /* Prevent server tag from shrinking */
}

.log-card .log-timestamp {
    font-size: 0.75rem;
    color: #6b7280;
    white-space: nowrap;
    flex-shrink: 0; /* Prevent timestamp from shrinking */
    margin-left: auto; /* Push to the far right */
}

.log-card .log-body {
    font-size: 0.9rem;
    color: #374151;
}

.log-details-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 0.75rem;
    align-items: baseline;
    margin-top: 0.5rem;
}

.log-details-grid strong {
    color: #4b5563;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

.log-details-grid .detail-icon {
    font-size: 1rem; /* Slightly larger icon */
    margin-right: 0.5rem; /* More space between icon and text */
    color: #4b5563; /* Darker color for better contrast */
    display: inline-block; /* Ensure it takes up space */
}

.log-details-grid blockquote {
    font-style: italic;
    color: #4f46e5;
    border-left: 3px solid #6366f1;
    padding-left: 0.75rem;
    margin: 0;
}

.log-details-grid code {
    background-color: #e0e7ff;
    color: #4338ca;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-family: 'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
    font-size: 0.85rem;
}

.log-details-grid .enchant-tag {
    background-color: #e9d5ff;
    color: #7e22ce;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-right: 0.25rem;
    display: inline-block;
    margin-bottom: 0.25rem;
}

.log-details-grid .tps-good { color: #10B981; }
.log-details-grid .tps-warn { color: #F59E0B; }
.log-details-grid .tps-bad { color: #EF4444; }

.log-details-grid .ram-bar-container {
    width: 100%;
    background-color: #e0e7ff;
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
    position: relative;
}

.log-details-grid .ram-bar {
    height: 100%;
    background-color: #4f46e5;
    border-radius: 4px;
    transition: width 0.3s ease-in-out;
}

.log-details-grid .ram-bar-container span {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    text-align: center;
    font-size: 0.75rem;
    line-height: 8px;
    color: #374151; /* Text color for RAM usage */
}

/* Dark mode adjustments */
.dark .log-card {
    background-color: #1f2937;
    border-color: #374151 !important; /* Ensure border color is dark mode friendly */
}

.dark .log-card .log-title {
    color: #e5e7eb;
}

.dark .log-card .log-body {
    color: #d1d5db;
}

.dark .log-details-grid strong {
    color: #9ca3af;
}

.dark .log-details-grid .detail-icon {
    color: #6b7280;
}

.dark .log-details-grid blockquote {
    border-left-color: #8b5cf6;
    color: #a78bfa;
}

.dark .log-details-grid code {
    background-color: #374151;
    color: #a78bfa;
}

.dark .log-details-grid .enchant-tag {
    background-color: #4c1d95;
    color: #d8b4fe;
}

.dark .log-details-grid .ram-bar-container {
    background-color: #374151;
}

.dark .log-details-grid .ram-bar {
    background-color: #8b5cf6;
}

.dark .log-details-grid .ram-bar-container span {
    color: #d1d5db;
}

.dark .log-card .log-title .server-tag {
    background-color: #374151;
    color: #d1d5db;
}

/* Suggestions Page Enhancements */
.add-suggestion-btn {
    background: linear-gradient(45deg, #3b82f6, #8b5cf6);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: none;
}

.add-suggestion-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.add-suggestion-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#suggestionsList .suggestion-card {
    transition: transform 0.3s, box-shadow 0.3s;
    border-left-width: 4px;
}

#suggestionsList .suggestion-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.suggestion-actions button {
    transition: all 0.2s ease;
}

.suggestion-actions .approve-btn {
    background-color: #10B981;
    color: white;
}

.suggestion-actions .approve-btn:hover {
    background-color: #059669;
}

.suggestion-actions .decline-btn {
    background-color: #F59E0B;
    color: white;
}

.suggestion-actions .decline-btn:hover {
    background-color: #D97706;
}

.suggestion-actions .delete-btn {
    background-color: #EF4444;
    color: white;
}

.suggestion-actions .delete-btn:hover {
    background-color: #DC2626;
}

/* Reason Modal Animation */
@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#suggestionReasonModal .modal-content {
    animation: slideIn 0.3s ease-out forwards;
}

.upvote-btn.text-blue-600 {
    color: #2563eb !important;
}

/* Fade-in Animation */
.fade-in {
    animation: fadeInAnimation 0.5s ease-in-out;
}

@keyframes fadeInAnimation {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.log-card-modern {
  display: flex;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  margin-bottom: 1rem;
  overflow: hidden;
  border-left: 6px solid #60a5fa; /* default blue, will be overridden by borderColorClass */
}
.log-card-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem 1.25rem;
}
.log-card-header {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}
.log-icon {
  flex-shrink: 0;
  font-size: 1.6rem;
  color: #6366f1;
}
.log-title-row {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 0%;
  overflow: hidden;
  gap: 0.5rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.log-type-name {
  font-weight: bold;
  text-transform: uppercase;
  margin-right: 0.5rem;
  color: #1e293b;
}
.log-player {
  color: #2563eb;
  margin-right: 0.5rem;
  font-weight: 600;
}
.log-server {
  color: #64748b;
  font-size: 0.95em;
}
.log-timestamp {
  margin-left: auto;
  font-size: 0.8em;
  color: #9ca3af;
  white-space: nowrap;
  flex-shrink: 0;
}
.log-body {
  font-size: 0.97em;
  color: #374151;
  margin-left: 2.2rem;
  margin-top: 0.2rem;
}
/* Dark mode support */
.dark .log-card-modern {
  background: #1f2937;
  border-color: #374151 !important;
}
.dark .log-card-inner {
  background: #1f2937;
}
.dark .log-type-name {
  color: #e0e7ef;
}
.dark .log-player {
  color: #60a5fa;
}
.dark .log-server {
  color: #a1a1aa;
}
.dark .log-timestamp {
  color: #a1a1aa;
}
.dark .log-body {
  color: #e5e7eb;
}

.tps-bar-inline {
  display: inline-flex;
  align-items: center;
  margin-right: 0.5em;
}
.tps-label {
  font-weight: 700;
  color: #15803d;
  margin-right: 0.5em;
  font-size: 0.97em;
  letter-spacing: 0.01em;
}
.tps-bar-center {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.2em;
  margin-bottom: 0.2em;
}
.tps-bar-bold {
  font-size: 1.25em;
  font-weight: 900;
  line-height: 1.1;
}
.tps-bar-mc {
  font-family: 'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
  font-size: 1em;
  letter-spacing: 0.08em;
  margin-right: 0.3em;
  vertical-align: middle;
  display: inline-block;
}
.tps-bar-value {
  font-size: 1em;
  color: #374151;
  font-weight: 700;
  vertical-align: middle;
  margin-left: 0.7em;
}
.ram-bar-modern-bg {
  width: 100%;
  height: 26px;
  background: #e0e7ef;
  border-radius: 13px;
  position: relative;
  box-shadow: 0 2px 8px 0 rgba(99,102,241,0.06);
  overflow: hidden;
  display: flex;
  align-items: center;
  margin: 0.5em 0;
}
.ram-bar-modern-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1 0%, #60a5fa 100%);
  border-radius: 13px 0 0 13px;
  transition: width 0.3s;
  position: absolute;
  left: 0;
  top: 0;
}
.ram-bar-modern-value {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255,255,255,0.85);
  color: #3730a3;
  font-size: 0.95em;
  font-weight: 800;
  padding: 0.08em 0.7em;
  border-radius: 999px;
  box-shadow: 0 1px 4px 0 rgba(99,102,241,0.07);
  z-index: 2;
  pointer-events: none;
  white-space: nowrap;
}
.ram-bar-good {
  background: linear-gradient(90deg, #22c55e 0%, #4ade80 100%) !important;
}
.ram-bar-medium {
  background: linear-gradient(90deg, #facc15 0%, #f59e42 100%) !important;
}
.ram-bar-critical {
  background: linear-gradient(90deg, #ef4444 0%, #f87171 100%) !important;
}

.advanced-filters-animated {
  transition: opacity 0.5s cubic-bezier(0.4,0,0.2,1), transform 0.5s cubic-bezier(0.4,0,0.2,1), max-height 0.5s cubic-bezier(0.4,0,0.2,1);
  opacity: 0;
  transform: translateY(-80px) scale(0.95);
  max-height: 0;
  overflow: hidden;
  pointer-events: none;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px) saturate(1.2);
  border-radius: 18px;
  box-shadow: 0 8px 32px 0 rgba(31,41,55,0.18), 0 1.5px 6px 0 rgba(99,102,241,0.08);
}
.advanced-filters-animated.open {
  opacity: 1;
  transform: translateY(0) scale(1.03);
  max-height: 1200px;
  pointer-events: auto;
}
.advanced-filters-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1em 1.5em 0.5em 1.5em;
  font-size: 1.15em;
  font-weight: 700;
  color: #1e293b;
  border-bottom: 1px solid #e5e7eb;
}
.advanced-filters-close {
  background: none;
  border: none;
  font-size: 1.3em;
  color: #64748b;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
}
.advanced-filters-close:hover {
  color: #ef4444;
  transform: scale(1.2) rotate(90deg);
}
.advanced-filters-content {
  padding: 1.2em 1.5em 1.2em 1.5em;
}
.advanced-filters-content input,
.advanced-filters-content select {
  border-radius: 999px;
  border: 1.5px solid #e5e7eb;
  padding: 0.7em 1.1em;
  margin-bottom: 0.7em;
  width: 100%;
  font-size: 1em;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.advanced-filters-content input:focus,
.advanced-filters-content select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px #6366f1;
  outline: none;
}
.advanced-filters-content .flex.justify-between.mt-4 {
  gap: 0.5em;
  justify-content: center;
}
.advanced-filters-content button {
  border-radius: 999px;
  padding: 0.4em 1.1em;
  font-weight: 600;
  font-size: 0.97em;
  background: linear-gradient(90deg, #6366f1 0%, #60a5fa 100%);
  color: #fff;
  border: none;
  margin-right: 0;
  transition: background 0.2s, transform 0.2s;
  min-width: 110px;
}
.advanced-filters-content button.bg-gray-300 {
  background: #e5e7eb;
  color: #374151;
}
.advanced-filters-content button:hover {
  background: linear-gradient(90deg, #2563eb 0%, #6366f1 100%);
  transform: scale(1.04);
}
.advanced-filters-content button.bg-gray-300:hover {
  background: #d1d5db;
  color: #1e293b;
  transform: scale(1.04);
}
.sidebar.collapsed nav ul {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  display: block;
}
.sidebar.collapsed nav a {
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
}
.sidebar.collapsed nav a i {
  font-size: 1.25rem !important;
  width: 22px !important;
  height: 22px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.18s, transform 0.18s;
  margin-left: 24px !important;
}
.sidebar.collapsed nav a:hover i {
  color: #6366f1 !important;
  background: none;
  border-radius: 0;
  transform: scale(1.08);
}

.pulse-badge {
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  animation: pulse-badge 1.5s infinite cubic-bezier(0.66, 0, 0, 1);
}
@keyframes pulse-badge {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.animate-bounce-in {
  animation: bounce-in 0.7s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
@keyframes bounce-in {
  0% {
    opacity: 0;
    transform: scale(0.7) translateY(-40px);
  }
  60% {
    opacity: 1;
    transform: scale(1.1) translateY(10px);
  }
  80% {
    transform: scale(0.95) translateY(-4px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
#announcementSuccess {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

/* Official Version Badge Pulsating Beacon Effects */
.pulse-badge-green {
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  animation: pulse-badge-green-glow 2s infinite cubic-bezier(0.66, 0, 0, 1);
}
@keyframes pulse-badge-green-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.pulse-badge-red {
  box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  animation: pulse-badge-red-glow 2s infinite cubic-bezier(0.66, 0, 0, 1);
}
@keyframes pulse-badge-red-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* ========================================================================
   DARK MODE SUPPORT
   ======================================================================== */

/* Body & Global */
.dark body,
html.dark body {
    background-color: #111827;
    color: #e5e7eb;
}

/* Sidebar - already dark, no changes needed */

/* Main Content Area */
.dark .main-content {
    background-color: #111827;
}

/* Header */
.dark header {
    background-color: #1f2937;
    border-color: #374151;
}
.dark header h1 {
    color: #f9fafb;
}

/* Dashboard stat card text */
.dark .text-gray-500 {
    color: #9ca3af;
}
.dark .text-gray-800 {
    color: #f3f4f6;
}

/* Chart containers & white bg cards */
.dark .bg-white {
    background-color: #1f2937;
}
.dark .border-gray-100 {
    border-color: #374151;
}

/* Chart badge pills */
.dark .bg-blue-100 {
    background-color: rgba(59, 130, 246, 0.15);
}
.dark .text-blue-800 {
    color: #93c5fd;
}
.dark .bg-purple-100 {
    background-color: rgba(139, 92, 246, 0.15);
}
.dark .text-purple-800 {
    color: #c4b5fd;
}
.dark .text-xs.text-gray-500 {
    color: #9ca3af;
}

/* Settings cards */
.dark .bg-gray-50 {
    background-color: #1f2937;
}
.dark .settings-hover-card {
    background-color: #1f2937;
    border-color: #374151;
}
.dark .settings-hover-card h2 {
    color: #f9fafb;
}
.dark .settings-hover-card label {
    color: #d1d5db;
}
.dark .settings-hover-card input,
.dark .settings-hover-card select {
    background-color: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}
.dark .settings-hover-card input::placeholder {
    color: #6b7280;
}

/* Logs page */
.dark #logsContent {
    background-color: #1f2937;
}
.dark .log-card-modern {
    background-color: #1f2937;
    border-color: #374151 !important;
}
.dark .log-type-name {
    color: #e0e7ef;
}
.dark .log-player {
    color: #60a5fa;
}
.dark .log-body {
    color: #d1d5db;
}
.dark .log-timestamp {
    color: #9ca3af;
}

/* Filter buttons in dark mode */
.dark .bg-gray-200 {
    background-color: #374151;
}
.dark .text-gray-700 {
    color: #d1d5db;
}
.dark .hover\:bg-gray-300:hover {
    background-color: #4b5563;
}

/* Advanced filters panel */
.dark .advanced-filters-animated {
    background: rgba(31, 41, 55, 0.95);
    border: 1px solid #374151;
}
.dark .advanced-filters-header {
    color: #f3f4f6;
    border-bottom-color: #374151;
}
.dark .advanced-filters-content input,
.dark .advanced-filters-content select {
    background-color: #374151;
    border-color: #4b5563;
    color: #e5e7eb;
}
.dark .advanced-filters-content label {
    color: #9ca3af;
}

/* Notifications panel */
.dark #notificationsPanel {
    background-color: #1f2937;
    border-color: #374151;
}

/* User dropdown */
.dark #userDropdown a {
    color: #d1d5db;
}
.dark #userDropdown a:hover {
    background-color: #374151;
}

/* Tooltips */
.dark .bg-gray-900 {
    background-color: #0f172a;
}

/* Tables */
.dark table {
    color: #e5e7eb;
}
.dark table th {
    background-color: #1f2937;
    color: #9ca3af;
    border-color: #374151;
}
.dark table td {
    border-color: #374151;
}
.dark table tr:hover {
    background-color: rgba(55, 65, 81, 0.4);
}

/* Forms in dark mode */
.dark input, .dark select, .dark textarea {
    color-scheme: dark;
}

/* Scrollbar in dark mode */
.dark ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.dark ::-webkit-scrollbar-track {
    background: #1f2937;
}
.dark ::-webkit-scrollbar-thumb {
    background: #4b5563;
    border-radius: 4px;
}
.dark ::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Dark mode toggle switch */
#darkModeToggle {
    cursor: pointer;
}
html.dark #darkModeThumb {
    transform: translateX(1.5rem);
}
html.dark #darkModeThumb .fa-sun {
    display: none;
}
html.dark #darkModeThumb .fa-moon {
    display: inline !important;
}

/* RAM and TPS bars in dark mode */
.dark .ram-bar-modern-bg {
    background: #374151;
}
.dark .ram-bar-modern-value {
    background: rgba(31, 41, 55, 0.9);
    color: #93c5fd;
}
.dark .tps-bar-value {
    color: #e5e7eb;
}

/* Export dropdown */
.dark #exportDropdownMenu {
    background-color: #1f2937;
    border-color: #374151;
}
.dark #exportDropdownMenu button {
    color: #d1d5db;
}
.dark #exportDropdownMenu button:hover {
    background-color: #374151;
}

/* ========================================================================
   MOBILE RESPONSIVE LAYOUT
   ======================================================================== */

/* Mobile sidebar behavior */
@media (max-width: 1023px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 40;
    }
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0 !important;
    }
    .main-content.expanded {
        margin-left: 0 !important;
    }
}

/* Small screens: stack stat cards */
@media (max-width: 768px) {
    /* Header adjustments */
    header .flex.justify-between {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Reduce padding */
    .p-6 {
        padding: 1rem;
    }
    
    /* Full width modals */
    .modal-content {
        margin: 1rem;
        max-width: calc(100% - 2rem) !important;
    }
    
    /* Logs toolbar stack */
    #logsContent .flex.flex-wrap {
        flex-direction: column;
        align-items: stretch;
    }
    
    /* Filter buttons wrap */
    #logFilterButtonsContainer {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    #logFilterButtonsContainer button {
        flex: 1 1 auto;
        min-width: 100px;
    }

    /* Advanced filters panel */
    .advanced-filters-animated {
        width: calc(100vw - 2rem) !important;
        left: 50% !important;
    }
    
    /* Log category cards: 2 columns on small screens */
    #logCategoriesContainer {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Chart containers stack */
    .grid.grid-cols-1.md\:grid-cols-2 {
        grid-template-columns: 1fr !important;
    }
    
    /* Settings grid stack */
    .grid.grid-cols-1.md\:grid-cols-2.gap-6 {
        grid-template-columns: 1fr !important;
    }

    /* Export dropdown responsive */
    #exportDropdownMenu {
        right: auto;
        left: 0;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    /* Single column for log categories */
    #logCategoriesContainer {
        grid-template-columns: 1fr !important;
    }
    
    /* Smaller text */
    h1 {
        font-size: 1.25rem !important;
    }
    
    /* Stat cards smaller */
    .text-2xl {
        font-size: 1.25rem;
    }
    
    /* Header tighter */
    header {
        padding: 0.75rem !important;
    }
    
    /* Chart height adjustment */
    .h-64 {
        height: 12rem;
    }

    /* Admin license table horizontal scroll */
    #adminSection table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Ensure touch targets are large enough on mobile */
@media (pointer: coarse) {
    button, a, select, input {
        min-height: 44px;
    }
    .sidebar nav a {
        min-height: 48px;
    }
}

/* Safe area for iOS devices */
@supports (padding-top: env(safe-area-inset-top)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Catch-all dark mode text overrides for remaining elements */
.dark h1, .dark h2, .dark h3, .dark h4 {
    color: #f3f4f6;
}
.dark label {
    color: #d1d5db;
}
.dark p {
    color: #d1d5db;
}
.dark .text-gray-700 {
    color: #d1d5db;
}
.dark .text-gray-600 {
    color: #9ca3af;
}
.dark .border-gray-200 {
    border-color: #374151;
}
.dark .border-gray-300 {
    border-color: #4b5563;
}
.dark .divide-gray-200 > :not([hidden]) ~ :not([hidden]) {
    border-color: #374151;
}

/* Suggestion cards dark mode */
.dark #suggestionsList .suggestion-card {
    background-color: #1f2937;
    border-color: #374151;
}
.dark #suggestionsList .suggestion-card h3 {
    color: #f9fafb;
}
.dark #suggestionsList .suggestion-card p {
    color: #d1d5db;
}

/* Pagination and load more */
.dark #loadMoreLogsBtn {
    background-color: #374151;
    color: #d1d5db;
}
.dark #loadMoreLogsBtn:hover {
    background-color: #4b5563;
}

/* Admin section text in dark mode */
.dark #adminSection h2 {
    color: #f9fafb;
}
.dark #adminSection th {
    color: #9ca3af;
    background-color: #1f2937;
}
.dark #adminSection td {
    color: #d1d5db;
}
.dark #adminSection .text-gray-500 {
    color: #9ca3af;
}

/* Page content section dark bg */
.dark .p-6.flex-grow {
    background-color: #111827;
}

/* Log category buttons dark */
.dark .log-category-button {
    background-color: #1f2937 !important;
    border-color: #374151;
    color: #d1d5db !important;
}
.dark .log-category-button:hover {
    background-color: #374151 !important;
}

/* Ensure modals with white bg get dark bg */
.dark .modal-content.bg-white {
    background-color: #1f2937;
}

/* Fix Plugin Version Badge when sidebar is collapsed */
.sidebar.collapsed #sidebarPluginVersionBadge {
    padding-left: 0.35rem;
    padding-right: 0.35rem;
    max-width: 24px;
    justify-content: center;
}
.sidebar.collapsed #sidebarVersionText {
    display: none;
}
.sidebar.collapsed #sidebarPluginVersionBadge .gap-1\.5 {
    gap: 0;
}
