html {
  font-size: 70%; /* ~30% smaller than default */
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Make any username instance bold across the app */
.username-bold {
  font-weight: 700;
}

/* Ensure dropdown menu appears above all page content (common) */
.navbar-nav .user-btn-group {
  position: relative;
  z-index: 1050;
}

.navbar-nav .user-btn-group .dropdown-menu {
  z-index: 1060;
}

/* User Search Autocomplete */
#userSearch:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

#searchResults {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1050;
    margin-top: 0.125rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

#searchResults .dropdown-item {
    cursor: pointer;
}

#searchResults .dropdown-item:hover {
    background-color: #f8f9fa;
}

/* Threading lines fix for dark mode */
.reply-connector, .thread-line {
    background-color: var(--bs-border-color);
}

.reply-line-mask {
    background-color: var(--bs-body-bg);
}

[data-bs-theme="dark"] {
  /* Ensure utility "bg-white" doesn't stay bright in dark mode for card header */
}

[data-bs-theme="dark"] .card-header.bg-white {
  background-color: var(--bs-body-bg) !important;
  color: var(--bs-body-color) !important;
  border-bottom: 1px solid var(--bs-border-color) !important;
}

/* Upload area override (was set inline to light background) */
[data-bs-theme="dark"] #uploadArea {
  background: var(--bs-body-bg) !important;
  border-color: var(--bs-border-color) !important;
}

[data-bs-theme="dark"] #uploadArea:hover {
  /* Slightly lighter overlay on hover in dark mode */
  background: rgba(255,255,255,0.02) !important;
  border-color: rgba(255,255,255,0.06) !important;
}

/* Also ensure file preview boxes use appropriate bg in dark mode */
[data-bs-theme="dark"] .file-preview .bg-light,
[data-bs-theme="dark"] .file-preview.bg-light {
  background-color: rgba(255,255,255,0.03) !important;
  color: var(--bs-body-color) !important;
  border-color: var(--bs-border-color) !important;
}

/* Blinking cursor for logo */
.blinking-cursor {
  animation: blink-fade 0.8s infinite ease-in-out;
}

@keyframes blink-fade {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Rainbow LED Line */
.rainbow-line {
  height: 1px;
  width: 100%;
  background: linear-gradient(90deg, 
    #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8f00ff, 
    #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #8f00ff, #ff0000
  );
  background-size: 200% 100%;
  animation: rainbow-scroll 3s linear infinite;
  opacity: 1;
  position: relative;
  z-index: 999;
}

@keyframes rainbow-scroll {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}