/**
 * Primary Academic Styling Document
 * Integrates institutional navy branding, serif typsetting, and removes default Bootstrap "roundness".
 */

:root {
  /* Institutional Deep Navy Blue overriding generic blue */
  --bs-primary: #1a365d;
  --bs-primary-rgb: 26, 54, 93;
  --bs-link-color: #1a365d;
  --bs-link-color-rgb: 26, 54, 93;
  --bs-border-radius: 2px;
  --bs-border-radius-lg: 3px;
  --bs-border-radius-sm: 1px;
}

[data-bs-theme="dark"] {
  /* Shift to a discernible deep institutional navy blue instead of generic black */
  --bs-body-bg: #0a192f;
  --bs-body-bg-rgb: 10, 25, 47;
  --bs-body-color: #f1f5f9;
  --bs-tertiary-bg: #112240; /* Slightly lighter navy for cards/sidebars */
  --bs-border-color: #233554;
  --bs-primary: #38bdf8;
  --bs-primary-rgb: 56, 189, 248;
  --bs-link-color: #38bdf8;
  --bs-link-hover-color: #7dd3fc;
}

/* ---------------------------------------------------- */
/* Component Overrides                                  */
/* ---------------------------------------------------- */

[data-bs-theme="dark"] .sidebar {
  background-color: var(--bs-tertiary-bg) !important;
}

[data-bs-theme="dark"] .sidebar .nav-link {
  color: #94a3b8; /* Clearer light gray for inactive items */
}

[data-bs-theme="dark"] .sidebar .nav-link:hover {
  color: #f1f5f9;
}

[data-bs-theme="dark"] .sidebar .nav-link.text-primary,
[data-bs-theme="dark"] .sidebar .nav-link.active {
  color: var(--bs-primary) !important;
}

[data-bs-theme="dark"] .sidebar-heading {
  color: #64748b !important; /* Discernible secondary header */
}

[data-bs-theme="dark"] .navbar {
  background-color: var(--bs-body-bg) !important;
  border-bottom: 2px solid #1e293b;
}

[data-bs-theme="dark"] .dropdown-menu {
  background-color: var(--bs-tertiary-bg);
  border-color: var(--bs-border-color);
}

/* ---------------------------------------------------- */
/* Typography Subsystems                                */
/* ---------------------------------------------------- */

/* Force headers to classically spaced traditional web-safe Serifs */
h1, h2, h3, h4, h5, h6, .navbar-brand {
  font-family: Georgia, "Times New Roman", Times, serif;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Standardize body text to dense, high-legibility sans-serif */
body, table, .form-control, .btn, .nav-link {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

p {
  line-height: 1.6;
}

/* ---------------------------------------------------- */
/* Aesthetic Cleanups: "De-Slop" the UI Elements        */
/* ---------------------------------------------------- */

/* Institutional Command Buttons */
.btn {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  border-radius: 2px !important;
  transition: all 0.2s ease-in-out;
  width: 240px; /* Force exact uniform sizing for standard actions */
  max-width: 100%; /* Ensure responsiveness on small screens */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

/* Exempting utility buttons (like icons or small list actions) from uniform sizing */
.btn-sm, .navbar .btn, .theme-toggle-btn, .btn-close {
  min-width: auto !important;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
}

.btn-primary {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
  box-shadow: none !important;
}

.btn-primary:hover {
  background-color: #0d2242; /* Deeper navy on hover */
  border-color: #0d2242;
}

.btn-secondary, .btn-outline-secondary {
  border-radius: 2px !important;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Remove default Bootstrap focus glow to maintain "Professional" flatness */
.btn:focus, .form-control:focus {
  box-shadow: none !important;
  border-color: var(--bs-primary);
  outline: none;
}

/* Explicitly square off the "bubbly" UI artifacts from stock generation */
.card, .form-control, .form-select, .alert, .badge, .navbar, .modal-content {
  border-radius: 2px !important;
}

/* Suppress heavy generic AI shadows into subtle page depth indicators */
.shadow-sm, .shadow, .shadow-lg {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

/* Increase contrast for the main application header specifically in Light mode */
[data-bs-theme="light"] .navbar {
  border-bottom: 2px solid #1a365d;
}

/* Theme Toggle Button Specific Styling */
.theme-toggle-btn {
  background: transparent;
  border: none;
  padding: 0.5rem;
  color: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.theme-toggle-btn:hover {
  opacity: 0.7;
}

.theme-toggle-btn svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

/* ---------------------------------------------------- */
/* Global Utilities & Structural Cleanups               */
/* ---------------------------------------------------- */

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--bs-primary);
  color: #fff;
  padding: 8px 12px;
  z-index: 9999;
  text-decoration: none;
  border-radius: 0 0 var(--bs-border-radius) 0;
}

.skip-link:focus {
  top: 0;
}

footer {
  border-top: 1px solid var(--bs-border-color);
  padding: 1rem 0;
  margin-top: 2rem;
  color: var(--bs-secondary-color);
  font-size: 0.875rem;
}
