:root {
  /* Defines the main color used throughout the app */
  --bs-primary: #CC0000;
}

body {
  /* Uses a clean font and light background for readability */
  font-family: 'Segoe UI', sans-serif;
  background-color: #F8F9Fa;
}

.navbar,
.btn-primary {
  /* Sets the base color for the navigation bar and primary buttons */
  background-color: var(--bs-primary) !important;
  border-color: var(--bs-primary) !important;
}

.btn-primary:hover {
  /* Slightly darkens button on hover */
  background-color: #B00000 !important;
}

.card {
  /* Adds rounded corners and subtle shadows for a softer layout */
  border-radius: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

img.rounded-circle {
  /* Ensures profile images are circles */
  object-fit: cover;
}

.follow-list .user-entry {
  /* Aligns avatars and names for each follow entry */
  display: flex;
  align-items: center;
  margin-bottom: 0.75rem;
}

.follow-list .user-entry:hover {
  /* Highlights a user when hovered */
  background-color: #F5F5F5;
  border-radius: 8px;
  cursor: pointer;
}

#follows-container {
  /* Adds scrollbar if the follow list is long */
  max-height: 250px;
  overflow-y: auto;
}

h1,
h2,
h5 {
  /* Keeps consistent red for titles */
  color: var(--bs-primary);
}

.carrot-icon::before {
  /* Adds a right-pointing triangle before collapsible text */
  content: "▶";
  display: inline-block;
  transition: transform 0.2s ease;
}

button[aria-expanded="true"] .carrot-icon::before {
  /* Points triangle down when section is expanded */
  content: "▼";
}

.btn-unfollow {
  /* White background with red border and text by default */
  background-color: white !important;
  color: var(--bs-primary) !important;
  border: 2px solid var(--bs-primary) !important;
}

.btn-unfollow:hover {
  /* Inverts colors when hovered for emphasis */
  background-color: var(--bs-primary) !important;
  color: white !important;
}

.btn-outline-danger {
  /* Custom red outline matching the app’s theme */
  border-color: var(--bs-primary) !important;
  color: var(--bs-primary) !important;
}

.btn-outline-danger:hover {
  /* Filled red background on hover */
  background-color: var(--bs-primary) !important;
  color: white !important;
}

.btn-outline-light {
  /* Styling for logout button */
  border-color: white !important;
  color: white !important;
}

.btn-outline-light:hover {
  /* Inverts logout to red-on-white when hovered over */
  background-color: white !important;
  color: var(--bs-primary) !important;
}

.alert {
  /* Smooth fade when showing or hiding messages */
  transition: opacity 0.3s ease;
}

body.dark-mode {
  /* Dark mode styles */
  background-color: #121212;
  color: #E4E4E4;
}

body.dark-mode .navbar {
  /* Navbar adjustments for dark mode */
  background-color: #1E1E1E !important;
}

body.dark-mode .navbar .howler-brand {
  /* Keeps the brand name red even in dark mode */
  color: #CC0000 !important;
}

body.dark-mode .card {
  background-color: #1F1F1F;
  border-color: #333;
  color: #E4E4E4;
}

body.dark-mode .btn-primary {
  /* Primary buttons in dark mode remain red */
  background-color: #B00000 !important;
  border-color: #B00000 !important;
}

body.dark-mode .btn-primary:hover {
  /* Slightly darkens button on hover */
  background-color: #CC0000 !important;
}

body.dark-mode .btn-outline-danger {
  /* Delete buttons use lighter red tones for better contrast */
  border-color: #FF4D4D !important;
  color: #FF4D4D !important;
}

body.dark-mode .btn-outline-danger:hover {
  background-color: #FF4D4D !important;
  color: #FFF !important;
}

body.dark-mode .btn-outline-light {
  /* Light-outline buttons adjust to gray */
  border-color: #E4E4E4 !important;
  color: #E4E4E4 !important;
}

body.dark-mode .btn-outline-light:hover {
  background-color: #E4E4E4 !important;
  color: #121212 !important;
}

body.dark-mode input,
body.dark-mode textarea {
  /* Styling for form inputs and textareas in dark mode */
  background-color: #2B2B2B;
  color: #E4E4E4;
  border-color: #444;
}

body.dark-mode a {
  color: #FF6666;
}

body.dark-mode a:hover {
  color: #FF9999;
}

body.dark-mode .text-muted {
  color: #BBBBBB !important;
}

body.dark-mode .follow-list {
  /* Follow dropdown box */
  background-color: #1F1F1F !important;
  border-color: #333 !important;
}

body.dark-mode .follow-list .user-entry:hover {
  background-color: #2A2A2A !important;
}

body.dark-mode #profile-username {
  color: #BBBBBB !important;
}

body.dark-mode textarea.form-control {
  background-color: #2B2B2B !important;
  color: #E4E4E4 !important;
  border-color: #444 !important;
}

body.dark-mode textarea.form-control::placeholder {
  /* Makes placeholder text lighter for readability */
  color: #AAA !important;
}

body.dark-mode textarea.form-control:focus {
  /* Keeps the textarea dark even when focused */
  background-color: #2B2B2B !important;
  color: #E4E4E4 !important;
  border-color: #666 !important;
  box-shadow: none !important;
}

body.dark-mode a.text-dark,
body.dark-mode .text-dark {
  color: #F0F0F0 !important;
}

body.dark-mode a.text-dark:hover {
  color: #FF6666 !important;
}

body.dark-mode .btn-unfollow {
  background-color: transparent !important;
  color: #FF6666 !important;
  border: 2px solid #FF6666 !important;
}

body.dark-mode .btn-unfollow:hover {
  background-color: #FF6666 !important;
  color: #121212 !important;
  border-color: #FF6666 !important;
}