.content {
  padding-left: 20px; /* Adjust this value as needed */
  margin-bottom: 10px; /* Adjust this value as needed */
}

.content.collapsed {
  visibility: hidden;
  height: 0;
  overflow: hidden;
}

.toggle-arrow {
  margin-right: 8px;
  cursor: pointer;
}

.toggle-group {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.toggle-group h2 {
  margin: 0;
}

.toggle-arrow {
  display: inline-block;
  transition: transform 0.2s;
}

.toggle-arrow.open {
  transform: rotate(90deg);
}

.content.collapsible {
  display: none;
}

.content.collapsible.open {
  display: block;
}

h2 {
  font-size: 1.5rem; /* Adjust this value as needed */
  margin: 0;
  padding-left: 10px; /* Adjust this value as needed */
}

div[data-controller="collapsible"] {
  margin-bottom: 0px;
}

.content.collapsed + .toggle-group {
  margin-bottom: 0px;
}

.content.collapsed .collapsible {
  margin-bottom: -10px; /* Adjust this value as needed */
}

input[type="text"],
textarea,
select,
.recommendation-form /* .recommend-to-input, */
.recommendation-form /* .item-input */ {
  width: 100%;
  max-width: 300px;
  box-sizing: border-box;
  padding: 0.5em;
  margin: 0 auto; /* Center align the input elements */
}

.submit-button {
  width: 100%;
  max-width: 300px;
  padding: 0.75rem 1.5rem;
  background-color: #3182ce;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s;
  display: block;
  margin: 20px auto 0 auto; /* Add margin-top to create space */
}

.submit-button:hover {
  background-color: #2c5282;
}

@media (max-width: 600px) {
  h1 {
    font-size: 1.2rem; /* Adjust this value as needed */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px; /* Adjust this value as needed */
  }

  .recommendation {
    padding: 10px;
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* Center align the title and the link */
.page-header,
.page-footer {
  text-align: center;
  margin: 0 auto;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 600;
  color: #1a202c;
  margin-bottom: 1.5rem;
}

.page-footer a {
  color: #3182ce;
  text-decoration: none;
  transition: color 0.2s;
}

.page-footer a:hover {
  color: #2c5282;
  text-decoration: underline;
}

.recommendations-container {
  display: block;  /* Changed from flex to block */
}

.recommendations-section {
  margin-bottom: 2rem;  /* Add some spacing between sections */
}

.recommendation-card {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin: 10px;
  padding: 15px;
  width: calc(33% - 20px); /* Adjust width for three cards per row */
  transition: transform 0.2s;
}

.recommendation-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.recommendation-title {
  font-size: 1.25rem;
  font-weight: bold;
  color: #1a202c;
  margin-bottom: 10px;
}

.recommendation-details {
  font-size: 0.9rem;
  color: #4a5568;
  margin-bottom: 10px;
}

.recommendation-actions {
  display: flex;
  justify-content: space-between;
}

.recommendation-button {
  background-color: #3b82f6;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.recommendation-button:hover {
  background-color: #2563eb;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .recommendation-card {
    width: calc(50% - 20px); /* Two cards per row on smaller screens */
  }
}

@media (max-width: 480px) {
  .recommendation-card {
    width: 100%; /* One card per row on mobile */
  }
}

.bond-strength {
  color: #666;
  font-size: 0.9em;
  margin-left: 0.5em;
}

.recommendation {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.recommendation form {
  margin: 0;
  display: inline;
}

.recommendation button {
  padding: 0.25rem 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border-radius: 0.25rem;
  background-color: #f3f4f6;
  border: 1px solid #d1d5db;
  cursor: pointer;
}

.recommendation button:hover {
  background-color: #e5e7eb;
}

.forward-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.35rem;
  margin-left: 0.5rem;
  font-size: 1rem;
  line-height: 1;
  border-radius: 0.25rem;
  background-color: #f3f4f6;
  border: 1px solid #d1d5db;
  cursor: pointer;
}

.forward-button:hover {
  background-color: #e5e7eb;
}

/* Form Container */
.recommendation-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Top-level form fields */
.recommendation-form > .form-field,
.new-item-section .form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  border: none !important;
  background: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Form field container */
.form-field {
  position: relative;
  z-index: 1;
}

/* Search container */
[data-controller="item-search"] {
  position: relative !important;
  z-index: 1000 !important;  /* High z-index for the container */
}

/* Search results container */
[data-item-search-target="results"],
[data-search-target="results"] {
  position: absolute !important;
  top: calc(100% + 5px) !important;  /* Position below input with small gap */
  left: 0 !important;
  width: 100% !important;
  background-color: white !important;
  border: 1px solid #ced4da !important;
  border-radius: 4px !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
  z-index: 1001 !important;  /* Higher than container */
  margin: 0 !important;
  padding: 0 !important;
}

/* Search result items */
[data-item-search-target="results"] div,
[data-search-target="results"] div {
  padding: 8px 12px !important;
  cursor: pointer !important;
  background-color: white !important;
  position: relative !important;
  z-index: 1002 !important;  /* Higher than results container */
}

[data-item-search-target="results"] div:hover,
[data-search-target="results"] div:hover {
  background-color: #f8f9fa !important;
}

/* Input styling */
.form-field input[type="text"],
.form-field input[type="url"],
.form-field input[type="number"],
.form-field input[type="tel"],
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 1rem;
  position: relative;
  z-index: 999;  /* Below search results */
  background-color: white;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Error Messages */
.error-messages {
  color: #dc3545;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 20px;
}

.error-messages h2 {
  font-size: 1.1em;
  margin-top: 0;
}

/* Form Fields */
.form-field label {
  font-weight: 500;
  color: #333;
}

/* Extra Fields Sections */
.extra-fields {
  margin-top: 1rem;
  width: 100%;
  border: none !important;
  background: none !important;
  padding: 0 !important;
}

.extra-fields h4 {
  margin-top: 0;
  margin-bottom: 1rem;
}

/* Platform Links Section */
.platform-links-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}

/* Reset all search-related elements */
[data-controller="item-search"],
[data-controller="search"] {
  position: relative;
  z-index: 100;  /* Higher than surrounding content */
}

/* ISBN Status */
.isbn-field {
  position: relative;
}

.isbn-status {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
}

/* Submit Button */
.submit-button {
  background-color: #0d6efd;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}

.submit-button:hover {
  background-color: #0b5ed7;
}

.submit-button:focus {
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Forward Button */
.forward-button {
  background: none;
  border: none;
  color: #0d6efd;
  cursor: pointer;
  padding: 2px 8px;
  font-size: 1.2rem;
  border-radius: 4px;
}

.forward-button:hover {
  background-color: #f8f9fa;
}

/* Responsive Design */
@media (max-width: 768px) {
  .recommendation-form {
    padding: 15px;
  }
  
  .form-field {
    margin-bottom: 1rem;
  }
  
  .extra-fields {
    padding: 10px;
  }
}

/* Toggle Groups */
.toggle-group {
  cursor: pointer;
  padding: 8px;
  margin: 4px 0;
  display: flex;
  align-items: center;
}

.toggle-arrow {
  margin-right: 8px;
  cursor: pointer;
}

.content.collapsible {
  display: none;
}

.content.collapsible.open {
  display: block;
}

/* User Links */
.user-link {
  color: #0d6efd;
  text-decoration: none;
}

.user-link:hover {
  text-decoration: underline;
}

/* Bond Strength Debug Info */
.bond-strength {
  color: #6c757d;
  margin-left: 8px;
}

.new-item-section {
  width: 100%;
  margin: 1rem 0;
  border: none !important;
  background: none !important;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
  width: 100%;
}

/* Override any type-specific field styles from items.css */
.book-fields,
.album-fields,
.location-fields,
.amazon-url-field {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  border-radius: 0 !important;
}

/* Reset all search-related elements */
[data-controller="item-search"],
[data-controller="search"],
[data-item-search-target="results"],
[data-search-target="results"] {
  border: none !important;
  background: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Additional reset for any potential border-related properties */
* {
  outline: none !important;
  box-shadow: none !important;
}

/* Reset for search-specific elements */
.search-enabled,
.search-results,
.search-container {
  border: none !important;
  background: none !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
}

h1.recommendations-title {
  font-weight: 400;  /* Normal weight instead of bold */
  color: #666;       /* Softer gray color */
  margin-bottom: 2rem;
}

.item-link {
  color: #2c5282;
  text-decoration: none;
  transition: color 0.2s;
}

.item-link:hover {
  color: #1a365d;
  text-decoration: underline;
}
