/* style.css */

/* --- General Body & Typography --- */
* {
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  margin: 0;
  padding-top: 120px; /* Initial padding to prevent content jump */
  background-color: #f4f4f9;
  color: #333;
  overflow-x: hidden;
}

header {
  text-align: center;
  padding: 1rem 1.5rem;
  background-color: #333;
  color: white;
  position: fixed; /* Changed to fixed */
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  border-bottom: 1px solid #444;
}

.header-main {
  display: grid;
  grid-template-columns: auto 1fr auto; /* Defines 3 columns: Left | Center | Right */
  align-items: center;
  gap: 1rem; /* Adds a little space between elements */
}

header h1 {
  grid-column: 2 / 3;
  margin: 0;
  font-size: 1.8rem;
  text-align: center; /* Ensures text is centered within its column */
  justify-self: center;
}

#filter-toggle-btn {
  grid-column: 1 / 2;
  justify-self: start;
  display: none; /* Hidden by default */
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  z-index: 1001;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

#filter-toggle-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

#filter-toggle-btn .material-symbols-outlined {
  color: white;
  font-size: 24px;
  transition: transform 0.3s ease;
}

header.filter-menu-open #filter-toggle-btn .material-symbols-outlined {
  transform: rotate(180deg);
}



#menu-toggle-btn {
  grid-column: 3 / 4;
  justify-self: end;
  display: none; /* Hidden by default */
  background: none;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  z-index: 1001;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

#menu-toggle-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

#menu-toggle-btn span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: white;
  margin: 5px 0;
  transition: all 0.3s;
}

header.filters-open #menu-toggle-btn span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

header.filters-open #menu-toggle-btn span:nth-child(2) {
  opacity: 0;
}

header.filters-open #menu-toggle-btn span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

#status-message {
  font-style: italic;
  color: #ccc;
  min-height: 1.2em;
  margin-top: 0.5rem;
}

main {
  padding: 1.5rem;
}

/* --- Styles for Year Headings --- */
.year-heading {
  font-size: 2rem;
  font-weight: 300;
  color: #444;
  margin-top: 3.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e0e0e0;
}

#dorama-grid > .year-heading:first-of-type {
  margin-top: 0;
}

/* --- The Responsive Grid Container --- */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

/* --- Dorama Card Styling --- */
.dorama-card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  transition: all 0.25s ease-in-out;
  display: flex;
  flex-direction: column;
  border: 3px solid transparent;
  height: 100%;
}

.dorama-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.dorama-card.highlighted {
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 10px 30px rgba(0, 110, 230, 0.5);
  border-color: #0069d9;
}

.dorama-card h3,
.dorama-card .secondary-title {
  margin-left: 0;
  margin-right: 0;
}

.dorama-card h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  color: #0056b3;
}

.dorama-card .secondary-title {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1rem;
  border-bottom: 1px solid #eee;
  padding-bottom: 1rem;
}

/* --- Actor List Styles --- */
.dorama-card .actors-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
}

.dorama-card .actors-list li {
  background-color: #e9f5ff;
  color: #0056b3;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  margin-top: 0.4rem;
  margin-right: 0.5rem;
  display: inline-block;
  cursor: pointer;
}

.dorama-card .actors-list li:hover {
  background-color: #d1eaff;
}

/* --- Styles for Filter Menu Controls (Left Menu) --- */
.filter-menu-controls {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0 1rem;
}

.filter-menu-controls input,
.filter-menu-controls select {
  padding: 0.7rem 1rem;
  border: 1px solid #555;
  border-radius: 5px;
  font-size: 1rem;
  background-color: #444;
  color: #eee;
  width: 140px;
}

.filter-menu-controls select {
  width: 150px;
}

.filter-menu-controls select option {
  background-color: #444;
  color: #eee;
}

.filter-menu-controls .year-range-separator {
  color: #ccc;
  font-weight: bold;
}

.filter-menu-controls button {
  background-color: #007bff;
  color: white;
  border: none;
  padding: 0.7rem 1.2rem;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background-color 0.2s;
}

.filter-menu-controls button:disabled {
  background-color: #6c757d;
  cursor: not-allowed;
}

.filter-menu-controls button#reset-button {
  background-color: #dc3545;
}

.filter-menu-controls button#reset-button:hover {
  background-color: #c82333;
}

.filter-menu-controls button#clear-highlights-btn {
  background-color: #ffc107;
  color: #212529;
  font-weight: 500;
}

.filter-menu-controls button#clear-highlights-btn:hover {
  background-color: #e0a800;
}

/* --- Styles for Filter Controls (Right Menu) --- */
.filter-controls {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0 1rem;
}

.filter-controls input,
.filter-controls select {
  padding: 0.7rem 1rem;
  border: 1px solid #555;
  border-radius: 5px;
  font-size: 1rem;
  background-color: #444;
  color: #eee;
  width: 140px;
}

.filter-controls select {
  cursor: pointer;
}

.filter-controls select option {
  background-color: #444;
  color: #eee;
}

.filter-controls .year-range-separator {
  color: #aaa;
  font-size: 1rem;
}

.filter-controls button {
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 5px;
  font-size: 0.9rem; /* Set base font size to 0.9rem */
  cursor: pointer;
  transition: background-color 0.2s ease;
  color: white;
}

.filter-controls button:disabled {
  background-color: #555 !important;
  cursor: not-allowed;
}

.filter-controls button#filter-button {
  background-color: #007bff;
}

.filter-controls button#filter-button:hover {
  background-color: #0056b3;
}

.filter-controls button#reset-button {
  background-color: #6c757d;
}

.filter-controls button#reset-button:hover {
  background-color: #5a6268;
}

.filter-controls button#clear-highlights-btn {
  background-color: #dc3545;
}

.filter-controls button#clear-highlights-btn:hover {
  background-color: #c82333;
}

.filter-controls button#share-button {
  background-color: #28a745;
}

.filter-controls button#share-button:hover {
  background-color: #218838;
}

.filter-controls button#export-csv-btn {
  background-color: #17a2b8;
  color: white;
}

.filter-controls button#export-csv-btn:hover {
  background-color: #138496;
}

.filter-controls button#import-csv-btn {
  background-color: #6f42c1;
  color: white;
  font-size: 0.9rem;
  padding: 0.7rem 1rem;
}

.filter-controls button#import-csv-btn:hover {
  background-color: #5a2d91;
}

/* --- File Input Wrapper Styles --- */
.file-input-wrapper {
  display: inline-block;
  position: relative;
  vertical-align: middle;
}

.file-input-wrapper input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.filter-controls #import-csv-label,
.filter-controls #parse-file-label { /* START: Added new label */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: white;
  background-color: #6f42c1;
  border: 1px solid #6f42c1;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  white-space: nowrap;
  user-select: none;
  margin: 0;
  box-sizing: border-box;
  vertical-align: middle;
  min-height: 2.4rem;
  line-height: 1.2;
}

.filter-controls #parse-file-label {
  background-color: #fd7e14; /* Orange color for distinction */
  border-color: #fd7e14;
}

.filter-controls #import-csv-label:hover {
  background-color: #5a2d91;
  border-color: #5a2d91;
}

.filter-controls #parse-file-label:hover {
  background-color: #e86a02;
  border-color: #e86a02;
}


.filter-controls #import-csv-label:active,
.filter-controls #parse-file-label:active { /* START: Added new label */
  transform: translateY(1px);
}

/* Focus styles for accessibility */
.file-input-wrapper input[type="file"]:focus + label {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* --- Styles for the Toggle Switch --- */
.toggle-switch-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 1rem;
}

.toggle-label {
  color: #ccc;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #555;
  transition: 0.4s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #007bff;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* --- Styles for the Dropdown Container --- */
.dropdown-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 1rem;
}

.dropdown-label {
  color: #ccc;
  font-size: 0.9rem;
  user-select: none;
  white-space: nowrap;
}

.dropdown-container select {
  padding: 0.5rem 0.8rem;
  border: 1px solid #555;
  border-radius: 5px;
  font-size: 0.9rem;
  background-color: #444;
  color: #eee;
  min-width: 220px;
  cursor: pointer;
}

.dropdown-container select option {
  background-color: #444;
  color: #eee;
}

/* --- Styles for Status Messages --- */
.status-container,
.active-filter-container {
  min-height: 1.5rem;
  padding-top: 0.75rem;
}

#share-status {
  color: #28a745;
  font-size: 0.9rem;
  margin: 0;
  padding: 0;
  transition: opacity 0.5s;
}

.active-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background-color: #e9f5ff;
  color: #0056b3;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid #bce0ff;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

.active-filter-pill.dataset-info {
  background-color: #f8f9fa;
  color: #495057;
  border: 1px solid #dee2e6;
  font-weight: 500;
}

.clear-filter-btn,
.clear-search-btn {
  background: #007bff;
  color: white;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  cursor: pointer;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 2px;
}

.clear-filter-btn:hover,
.clear-search-btn:hover {
  background: #0056b3;
}

/* --- Rule for Hiding Actors --- */
#main-content.actors-hidden .actors-list {
  display: none;
}

/* --- Add these styles at the end of style.css --- */

@media (max-width: 960px) {
  header {
    padding: 0.8rem 1.5rem;
  }

  body {
    font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f9;
    color: #333;
    overflow-x: hidden;
  }

  header.filters-open {
    padding-bottom: 1rem;
  }

  #filter-toggle-btn {
    display: block;
    top: 0.8rem;
  }

  #menu-toggle-btn {
    display: block;
    top: 0.8rem;
  }

  #filter-menu-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #333;
    border-top: 1px solid #444;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    max-height: 70vh;
    overflow-y: auto;
    padding: 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }

  header.filter-menu-open #filter-menu-container {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    padding: 1rem;
  }

  #filters-container {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #333;
    border-top: 1px solid #444;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    max-height: 70vh;
    overflow-y: auto;
    padding: 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }

  header.filters-open #filters-container {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    padding: 1rem;
  }

  .filter-menu-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    margin-top: 0;
  }

  .filter-menu-controls input,
  .filter-menu-controls select,
  .filter-menu-controls button {
    width: 100%;
    font-size: 1rem;
    padding: 0.8rem 1rem;
  }

  .filter-menu-controls input:focus,
  .filter-menu-controls select:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
  }

  .filter-menu-controls .year-range-separator {
    display: none;
  }

  .filter-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    margin-top: 0;
  }

  .filter-controls input,
  .filter-controls select,
  .filter-controls button {
    width: 100%;
    font-size: 1rem;
    padding: 0.8rem 1rem;
  }

  .filter-controls .file-input-wrapper {
    width: 100%;
  }

  .filter-controls button,
  .filter-controls #import-csv-label,
  .filter-controls #parse-file-label {
    width: 100%;
    font-size: 1rem;
    padding: 0.8rem 1rem;
  }

  .filter-controls input:focus,
  .filter-controls select:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
  }

  .filter-controls .year-range-separator {
    display: none;
  }

  .toggle-switch-container {
    justify-content: space-between;
    margin-left: 0;
    padding: 0.8rem 0;
    border-top: 1px solid #444;
  }

  .toggle-switch-container:first-of-type {
    border-top: none;
    margin-top: 1rem;
  }

  .dropdown-container {
    justify-content: space-between;
    margin-left: 0;
    padding: 0.8rem 0;
    border-top: 1px solid #444;
  }

  .dropdown-container select {
    width: 100%;
    font-size: 1rem;
    padding: 0.8rem 1rem;
  }

  /* Close menu when clicking outside on mobile */
  header.filter-menu-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: -1;
  }

  header.filters-open::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: -1;
  }

  /* --- Main Content Adjustments for Mobile --- */
  main {
    padding: 1rem;
  }

  .grid-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .dorama-card {
    padding: 1rem;
  }

  .year-heading {
    font-size: 1.5rem;
    margin-top: 2.5rem;
  }
}

/* --- Modal Styles --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.modal-content {
  background-color: #fff;
  padding: 25px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 1300px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  font-size: 30px;
  color: #aaa;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #333;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
}

#modal-image-container {
  margin-top: 20px;
  margin-bottom: 25px;
  text-align: center;
  border: 1px solid #ddd;
}

#modal-image-container img {
  max-width: 100%;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-actions > div {
  display: flex;
  gap: 10px;
}

.modal-actions button {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

#modal-copy-btn {
  background-color: #007bff;
  color: white;
}
#modal-copy-btn:hover {
  background-color: #0056b3;
}

#modal-download-btn {
  background-color: #28a745;
  color: white;
}
#modal-download-btn:hover {
  background-color: #218838;
}

body.modal-open {
  overflow: hidden;
}

/* --- Custom Dialog Modal Styles --- */
.dialog-modal {
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem 1rem 2rem;
  border-bottom: 1px solid #e0e0e0;
}

.dialog-header h3 {
  margin: 0;
  color: #333;
  font-size: 1.2rem;
  font-weight: 600;
}

.dialog-body {
  padding: 1.5rem 2rem;
  max-height: 300px;
  overflow-y: auto;
}

.dialog-body p {
  margin: 0;
  line-height: 1.6;
  color: #555;
  white-space: pre-line;
}

.dialog-actions {
  padding: 1rem 2rem 1.5rem 2rem;
  border-top: 1px solid #e0e0e0;
}

#dialog-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.dialog-btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 5px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
}

.dialog-btn-primary {
  background-color: #007bff;
  color: white;
}

.dialog-btn-primary:hover {
  background-color: #0056b3;
}

.dialog-btn-secondary {
  background-color: #28a745;
  color: white;
}

.dialog-btn-secondary:hover {
  background-color: #218838;
}

.dialog-btn-danger {
  background-color: #dc3545;
  color: white;
}

.dialog-btn-danger:hover {
  background-color: #c82333;
}

.dialog-btn-light {
  background-color: #f8f9fa;
  color: #495057;
  border: 1px solid #dee2e6;
}

.dialog-btn-light:hover {
  background-color: #e9ecef;
}

/* START: New styles for the Fuzzy Match Review Modal */
.fuzzy-match-review-modal .dialog-header {
    align-items: center;
}

.fuzzy-match-review-modal .dialog-header h3 {
    margin-right: auto; /* Pushes toggle and close button to the right */
}

.toggle-switch-container.modal-toggle {
    margin-left: 1rem;
    margin-right: 1rem;
}

.modal-toggle .toggle-label {
    color: #555;
    font-weight: 500;
    white-space: nowrap;
}

.fuzzy-match-review-modal {
  max-width: 800px;
  width: 90%;
}

#fuzzy-match-body {
  max-height: 60vh;
  padding: 1rem;
  background-color: #f9f9f9;
}

.fuzzy-match-item {
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-bottom: 1rem;
  padding: 1rem;
}

.fuzzy-match-item:last-child {
  margin-bottom: 0;
}

.fuzzy-match-original-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #eee;
  margin-bottom: 1rem;
}

.fuzzy-match-original-text span {
  font-weight: normal;
  color: #666;
  font-style: italic;
}

.fuzzy-match-options-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fuzzy-match-option {
  display: block;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fuzzy-match-option:hover {
  background-color: #f0f8ff;
  border-color: #007bff;
}

.fuzzy-match-option input[type="radio"] {
  margin-right: 10px;
}

.fuzzy-match-option.selected {
  background-color: #e0f2fe;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.match-details .title {
  font-weight: 600;
  color: #0056b3;
}
.match-details .year {
  color: #555;
  margin-left: 8px;
}
.match-details .score {
  font-size: 0.8rem;
  color: #28a745;
  font-weight: bold;
  margin-left: 8px;
}

.no-match-found {
  color: #dc3545;
  font-style: italic;
}
.fuzzy-match-review-modal .dialog-header {
  flex-wrap: wrap; /* Allows items to wrap onto a new line */
  row-gap: 0.75rem; /* Adds vertical space when items wrap */
}

.fuzzy-match-review-modal .dialog-header h3 {
  flex-basis: 100%; /* Makes the title take the full first line */
  margin-right: 0;   /* Resets the desktop margin */
}

.toggle-switch-container.modal-toggle {
  order: 1;          /* Ensures toggle comes first on the second line */
  margin-left: 0;
  margin-right: auto; /* Pushes the close button to the far right */
}

.fuzzy-match-review-modal .dialog-header .modal-close {
  order: 2; /* Ensures close button comes after the toggle */
}

/* END: New styles for the Fuzzy Match Review Modal */

/* Manual Selection Dropdown Styles */
.manual-selection-option {
  flex-direction: column !important;
  align-items: stretch !important;
}

.manual-selection-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 0.5rem;
}

.manual-selection-label {
  font-weight: 600;
  color: #333;
}

.manual-selection-dropdown-container {
  position: relative;
  width: 100%;
}

.manual-selection-input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
}

.manual-selection-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.manual-selection-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
  display: none;
}

.dropdown-item {
  padding: 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.15s ease;
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover,
.dropdown-item.selected {
  background-color: #f8fafc;
}

.dropdown-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.dropdown-item-title {
  font-weight: 600;
  color: #1e293b;
  font-size: 0.9rem;
  flex: 1;
}

.dropdown-item-subtitle {
  font-size: 0.8rem;
  color: #64748b;
}

.match-badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-weight: 600;
  margin-left: 0.5rem;
  white-space: nowrap;
}

.match-badge.exact {
  background-color: #10b981;
  color: white;
}

.match-badge.high {
  background-color: #3b82f6;
  color: white;
}

.match-badge.medium {
  background-color: #f59e0b;
  color: white;
}

.match-badge.low {
  background-color: #6b7280;
  color: white;
}

.match-badge.very-low {
  background-color: #9ca3af;
  color: white;
}

.match-badge.none {
  background-color: #e5e7eb;
  color: #6b7280;
}

.match-type {
  font-size: 0.65rem;
  padding: 0.15rem 0.3rem;
  border-radius: 3px;
  background-color: #e5e7eb;
  color: #374151;
  margin-left: 0.25rem;
  font-weight: 500;
}

.dropdown-more {
  background-color: #f8fafc;
  color: #64748b;
  font-size: 0.8rem;
  font-style: italic;
  text-align: center;
  cursor: default;
}

.dropdown-more:hover {
  background-color: #f8fafc;
}