/* --- MyWord 2.0 Modern UI --- */
/* Killer Search Bar Edition */

/* 1. FONT IMPORT */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&display=swap');

/* 2. THEME & COLOR VARIABLES */
:root {
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --text-color: #212529;
  --text-muted: #6c757d;
  --border-color: #dee2e6;
  --accent-color: #0d6efd;
  --accent-color-hover: #0b5ed7;
  --shadow-color: rgba(0, 0, 0, 0.05);
  --search-bg: #e9ecef;
}

[data-bs-theme="dark"] {
  --bg-color: #121212;
  --card-bg: #1e1e1e;
  --text-color: #e9ecef;
  --text-muted: #adb5bd;
  --border-color: #495057;
  --accent-color: #4dabf7;
  --accent-color-hover: #74c0fc;
  --shadow-color: rgba(0, 0, 0, 0.15);
  --search-bg: #2b2b2b;
}

/* 3. BASE STYLES */
body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
  padding-top: 90px;
  /* Offset for the taller fixed navbar */
}

.clickable-word {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.clickable-word:hover {
  background-color: rgba(132, 187, 247, 0.802);
  /* Bootstrap primary color */
  border-radius: 4px;
}

/* For Light Mode, we force the text to be black. */
.theme-aware-text {
  color: #fff !important;
  background-color: #212529 !important;

}

/* For Dark Mode, we force the text to be light. */
[data-bs-theme="dark"] .theme-aware-text {
  color: #212529 !important;
  background-color: #fff !important;
}

/* NEW: Custom class for the navigation bar background */
/* NEW: Custom class for the navigation bar background */
.navbar-custom {
  background-color: #ffffff;
  /* Your light mode color */
  padding-top: 1rem;
  /* This adds padding to the top */
  padding-bottom: 1rem;
  /* This adds padding to the bottom */
}

/* NEW: Dark mode override for the custom class */
[data-bs-theme="dark"] .navbar-custom {
  background-color: #212529;
  /* A proper dark mode color */
}

/* 4. KILLER SEARCH BAR STYLES */
.killer-search-bar {
  position: relative;
  background: var(--search-bg);
  border-radius: 0.5rem;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid transparent;
  /* Hidden border initially */
}

.killer-search-bar:focus-within {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px rgba(var(--accent-color-rgb), 0.25);
}

.killer-search-bar .form-control {
  background: transparent;
  border: none;
  color: var(--text-color);
  height: 48px;
  font-size: 1.1rem;
  padding-left: 1.25rem;
}

.killer-search-bar .form-control:focus {
  box-shadow: none;
}

.killer-search-bar .btn {
  height: 48px;
  border: none;
  font-weight: 500;
}

.killer-search-bar .btn-word-label {
  background-color: var(--text-color);
  color: var(--bg-color);
  border-radius: 0.5rem 0 0 0.5rem;
  padding: 0 1.5rem;
}

.killer-search-bar .btn-search {
  background-color: var(--accent-color);
  color: white;
  font-size: 1.25rem;
  border-radius: 0 0.5rem 0.5rem 0;
}

.killer-search-bar .btn-search:hover {
  background-color: var(--accent-color-hover);
}

@media (max-width: 767px) {
  .killer-search-bar .btn-word-label {
    display: none;
    /* Hide "Word" button on mobile for more space */
  }

  .killer-search-bar .form-control {
    border-radius: 0.5rem 0 0 0.5rem;
  }
}


/* 5. OTHER MODERN COMPONENTS (Unchanged) */
.card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 12px var(--shadow-color);
  transition: all 0.3s ease;
}

.card-header {
  background-color: transparent;
  border-bottom: 1px solid var(--border-color);
  font-weight: 500;
}

.hero-card .display-4 {
  font-family: 'Menlo', 'Monaco', 'Consolas', monospace;
  font-weight: 700;
}

.action-btn {
  font-size: 1.5rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.action-btn:hover {
  color: var(--accent-color);
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1rem;
}

.resource-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-decoration: none;
  transition: all 0.2s ease-in-out;
}

.resource-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px var(--shadow-color);
  border-color: var(--accent-color);
}

.resource-card img {
  max-height: 40px;
  width: auto;
  filter: grayscale(1);
  opacity: 0.7;
  transition: all 0.2s ease-in-out;
}

.resource-card:hover img {
  filter: grayscale(0);
  opacity: 1;
}

[data-bs-theme="dark"] .resource-card img {
  filter: invert(1) grayscale(1);
  opacity: 0.6;
}

[data-bs-theme="dark"] .resource-card:hover img {
  filter: invert(0) grayscale(0);
  opacity: 1;
}

.toast-container {
  z-index: 1100;
}

/* 8. DEAD SPACE FIX */
/* Overriding Bootstrap's default padding on the theme switch */
.theme-switch.form-switch {
  padding-left: 0.5em;
}

/* 7. DARK MODE TOGGLE SWITCH (FINAL, CLEAN ICONS) */
.theme-switch .form-check-input {
  width: 52px;
  height: 26px;
  margin-left: 0;
  cursor: pointer;
  background-color: var(--bs-secondary-bg);
  border-color: var(--bs-border-color-translucent);
  transition: background-position .15s ease-in-out;
}

/* Sun Icon for Light Mode (Dark Grey) */
[data-bs-theme="light"] .theme-switch .form-check-input {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23212529' class='bi bi-sun-fill' viewBox='0 0 16 16'%3e%3cpath d='M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707z'/%3e%3c/svg%3e");
  background-position: 5px center;
  background-repeat: no-repeat;
  background-size: 14px 14px;
  /* THIS IS THE NEW LINE */
}

/* Moon Icon for Dark Mode (No stars) */
[data-bs-theme="dark"] .theme-switch .form-check-input {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23FFF' class='bi bi-moon-fill' viewBox='0 0 16 16'%3e%3cpath d='M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z'/%3e%3c/svg%3e");
  background-position: calc(100% - 5px) center;
  background-size: 14px 14px;
  /* THIS IS THE NEW LINE */
}

.expandable-list .list-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-color);
  list-style-position: inside;
}

.expandable-list .list-item:first-child {
  padding-top: 0;
}

.expandable-list .list-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.expandable-list .list-item.hidden-item {
  display: none;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
}

.expandable-list.expanded .list-item.hidden-item {
  display: list-item;
}

.btn-show-more {
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 1rem;
  background: none;
  border: none;
  color: var(--accent-color);
  cursor: pointer;
  padding: 0.25rem 0;
}

.btn-show-more:hover {
  text-decoration: underline;
}

.table {
  --bs-table-bg: var(--card-bg);
  --bs-table-border-color: var(--border-color);
  --bs-table-striped-bg: rgba(0, 0, 0, 0.02);
  --bs-table-hover-bg: rgba(0, 0, 0, 0.06);
  color: var(--text-color);
}

[data-bs-theme="dark"] .table {
  --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
  --bs-table-hover-bg: rgba(255, 255, 255, 0.06);
}

.footer {
  background-color: var(--card-bg);
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 1.5rem 0;
  margin-top: 3rem;
}

/* 8. KILLER HEADER ALIGNMENT FIX */
.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  /* This creates a consistent space between items */
}