/* src/components/Resources/Resources.css */

.resources-page {
  margin: 20px auto 20px;
  max-width: 1200px;
  padding: 20px;

.resources-disclaimer p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.5;
}

/* ======= Improved Filter Bar ======= */
.resources-filters {
  background-color: var(--navbar-bg);
  border: 2px solid var(--card-border);
  border-radius: 8px;
  padding: 1.1em;
  max-width: 480px;
  align-content: center;
}

.filter-options {
  margin-bottom: 5px;
}

.filter-label {
  font-size: 0.95rem;
  font-weight: 600;
  margin-right: 8px;
  color: var(--text);
  white-space: nowrap;
}

.filter-options {
  display: flex;
  align-items: center;
}

.filter-dropdowns {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  width: 100%;
  align-items: center;
  justify-content: center;
}

.category-filter-dropdown,
.quality-filter {
  display: flex;
  align-items: center;
}

.filter-select {
  padding: 8px 32px 8px 12px;
  border: 2px solid var(--card-border);
  border-radius: 6px;
  font-size: 0.95rem;
  background-color: var(--navbar-bg);
  color: var(--text);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 16px;
  transition: all 0.2s ease;
}

.filter-select:focus {
  border-color: var(--button-bg);
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--button-bg-rgb), 0.1);
}

/* Toggle filters container - Modified for horizontal layout */
.toggle-filters {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* New and Score toggle styling */
.toggle-filter {
  display: flex;
  align-items: center;
}

.toggle-label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.toggle-label input[type="checkbox"] {
  appearance: none;
  background-color: var(--card-border);
  border-radius: 8px;
  cursor: pointer;
  height: 20px;
  margin: 0 8px 0 0;
  position: relative;
  transition: background-color .3s;
  width: 38px;
}

.toggle-label input[type="checkbox"]:checked {
  background-color: var(--button-bg);
}

.toggle-label input[type="checkbox"]::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 5px;
  top: 1px;
  left: 2px;
  background-color: white;
  transition: transform 0.3s;
}

.dark-mode .toggle-label input[type="checkbox"]::before {
  background-color: #666;
}

.toggle-label input[type="checkbox"]:checked::before {
  transform: translateX(14px);
}

.toggle-label input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(var(--button-bg-rgb), 0.2);
}

.toggle-text {
  font-size: .95rem;
  font-weight: 600;
  font-family: articulat-cf;
  white-space: nowrap;
  padding-top: 3px;
}

.resource-meta {
  flex-direction: row;
}

/* ======= Content Sections ======= */
.featured-section,
.all-resources-section,
.random-resources-section {
  margin-bottom: 40px;
}

.all-resources-section {
  margin-bottom: 4px;
}

.featured-section h2,
.all-resources-section h2,
.random-resources-section h2 {
  font-size: 1.3rem;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--card-border);
  padding-bottom: 8px;
}

/* Random resources section styling */
.random-resources-section {
  background-color: rgba(var(--button-bg-rgb), 0.05);
  border-radius: 10px;
  margin-top: 20px;
  margin-bottom: 30px;
  border: 2px solid rgba(var(--button-bg-rgb), 0.1);
}

.random-resources-section h2 {
  border-bottom-color: rgba(var(--button-bg-rgb), 0.2);
}

/* Category section styling */
.category-header {
  font-size: 1.2rem;
  margin: 45px 0 16px;
  padding-bottom: 6px;
}

/* Featured section description */
.featured-description {
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
  color: var(--text);
  font-style: italic;
  opacity: 0.8;
}

.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

/* ======= Resource Cards ======= */
.resource-card {
  border: 2px solid var(--card-border);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s;
  text-decoration: none;
  color: inherit;
  background-color: var(--background);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.resource-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.resource-content {
  padding: 16px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.filter-disclaimer-container {
  display: flex;
  gap: 20px;
  align-content: center;
  justify-content: space-between;
}

/* Improved resource header styling */
.resource-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.resource-name {
  font-size: 1.1rem;
  margin: 0;
  color: var(--button-bg);
  line-height: 1.3;
}

/* Resource badges container */
.resource-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
  margin-top: 3px;
}

/* Badge styling */
.new-badge, .score-badge {
  align-items: center;
  border-radius: 5.9px;
  color: var(--button-text);
  display: inline-flex;
  font-size: .7rem;
  font-weight: 700;
  height: 18px;
  padding: 2px 8px;
  padding-bottom: 0px;
  vertical-align: text-bottom;
  margin-bottom: 4px;
}

/* NEW badge styling */
.new-badge {
  animation: pulse 2s infinite;
  background-color: #666 !important;
}

/* SCORE badge styling */
.score-badge {
  background-color: var(--button-bg) !important;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.resource-description {
  font-size: 0.9rem;
  color: var(--text);
  margin: 0 0 8px 0;
  flex-grow: 1;
  opacity: 0.8;
}

/* Resource domain styling */
.resource-domain {
  font-size: 0.85rem;
  color: var(--text);
  opacity: 0.7;
  margin: 0 0 16px 0;
}

.resource-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

/* Categories display */
.resource-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.resource-category {
  font-size: 0.8rem;
  background-color: var(--card-border);
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--text);
}

/* Tags display */
.resource-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.resource-tag {
  font-size: 0.75rem;
  background-color: rgba(var(--button-bg-rgb), 0.1);
  padding: 3px 6px;
  border-radius: 4px;
  color: var(--text);
  opacity: 0.8;
}

.no-results {
  text-align: center;
  padding: 40px;
  color: var(--text);
  opacity: 0.7;
}

/* Resource Loader */
.resource-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}

.loader-spinner {
  border: 4px solid var(--card-border);
  border-left-color: var(--button-bg);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
  transition: border-color 0.3s ease;
}

.resource-loader p {
  color: var(--text);
  opacity: 0.8;
}

#new-toggle:focus,
#score-toggle:focus {
  border-color: var(--card-border);
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 920px) {
  .filter-controls-container {
    flex-direction: column;
  }

  & .feeling-lucky-button {
    font-size: 0.9em;
  }
}

@media (max-width: 768px) {
  .resources-page {
    padding: 10px;
  }
  
  .resources-page .alt-card {
    padding: 1rem;
  }
  
  .feature-cards {
    flex-direction: column;
    gap: 0.8rem;
    align-items: center;
  }
  
  .filters-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .filter-dropdowns {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  
  .filter-dropdown {
    width: 100%;
    justify-content: space-between;
    flex-direction: column;
  }
  
  .toggle-filters {
    width: 100%;
    justify-content: space-between;
    flex-direction: column;
  }
  
  .filter-share-button {
    width: 100%;
  }
  
  .filter-share-button .share-button {
    width: 100%;
  }
  
  .resources-header h1 {
    font-size: 1.5rem;
  }
  
  .resources-grid {
    grid-template-columns: 1fr;
  }
}

/* Responsive adjustments */
@media (max-width: 710px) {
  .filter-disclaimer-container {
    display: flex;
    gap: 20px;
    align-content: center;
    justify-content: center;
    flex-direction: column;
  }

  .resources-filters {
    max-width: unset;
  }

  .resources-disclaimer {
    margin: auto;
    max-width: unset;
  }
}

@media (max-width: 400px) {
  .resources-page {
    max-width: 100%;
  }

  .search-filters-container {
    gap: 0px;
  }

  .search-filters-container {
    gap: 0rem;
  }
  
  .resources-header h1 {
    font-size: 1.4rem;
  }

  .header-tagline p {
    font-size: 0.9rem;
  }
  
  .toggle-filters {
    flex-direction: column;
    gap: 10px;
  }

  .filters-row {
    align-items: center;
  }
}
}

.resources-page .alt-card {
  text-align: left;
  background: var(--navbar-bg);
  border-radius: 12px;
  border: 5px solid var(--card-border);
  padding: 1.7rem;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* ======= Redesigned Header Section ======= */
.resources-header {
  display: flex;
  flex-direction: column;
  gap: 2em;
  margin-bottom: 2rem;
  margin-top: 1em;
}

/* Header main section with title and tagline */
.header-main {
  text-align: center;
}

.resources-header h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--button-bg);
  letter-spacing: -0.01em;
}

.header-tagline p {
  font-size: 1.1rem;
  color: var(--text);
  opacity: 0.85;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.4;
}

/* Feature cards */

.feature-cards {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.feature-card {
  display: flex;
  align-items: center;
  background-color: var(--card-border);
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  transition: transform 0.2s, background-color 0.2s;
}

.feature-card:hover {
  transform: translateY(-2px);
  background-color: rgba(var(--button-bg-rgb), 0.1);
}

.feature-icon {
  font-size: 1.2rem;
  margin-right: 0.5rem;
}

.feature-text {
  font-size: 0.95rem;
  font-weight: 500;
}

/* Renamed search classes to avoid collision with SearchBar component */
.resources-search-container {
  flex-grow: 1;
  width: 100%;
  position: relative;
}

.resources-search-input {
  width: 100%;
  padding: 9px 15px;
  border: 2px solid var(--card-border);
  border-radius: 6px;
  font-size: 1rem;
  background-color: var(--navbar-bg);
  color: var(--text);
  transition: all 0.3s ease;
}

.resources-search-input:hover,
.resources-search-input:focus {
  border-color: var(--button-bg);
  background-color: var(--background);
  outline: none;
}

/* Update the search-filters-container class to match the new search class names */
.search-filters-container {
  align-items: center;
  display: flex;
  gap: 15px;
  justify-content: space-between;
  margin: auto;
}

/* Quick actions */
.quick-actions {
  display: flex;
  gap: 0.5rem;
  height: 100%; /* Make it fill the container height */
}

/* Share button */
.share-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background-color: var(--button-bg);
  color: var(--button-text);
  padding: 0 20px; /* Adjusted padding */
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 100%; /* Make it fill the container height */
}

/* Smaller share button in filter row */
.share-button.compact {
  padding: 0 14px; /* Adjusted padding */
  font-size: 0.85rem;
  height: 36px; /* Fixed height for the compact version */
}

.share-button:hover,
.feeling-lucky-button:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  color: white;
}

.share-button:active,
.feeling-lucky-button:active {
  transform: translateY(0);
}

.share-icon {
  font-size: 1.1rem;
}

.header-tagline-detail {
  font-size: 0.8em !important;
  margin-top: 7px !important;
}

/* Feeling Lucky button */
.feeling-lucky-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--card-border);
  color: var(--text);
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 100%; /* Make it fill the container height */
  white-space: nowrap; /* Prevent text wrapping */
}

/* ======= Filter Controls Container ======= */
.filter-controls-container {
  align-items: unset;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 0px;
  flex-direction: column;
  align-content: center;
}

.filter-section {
  width: 100%;
}

/* Filters row - for horizontal alignment */
.filters-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Filter dropdown */
.filter-dropdown {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Filter share button container */
.filter-share-button {
  display: flex;
  align-items: center;
}

/* Enhanced disclaimer styling */
.resources-disclaimer {
  align-items: flex-start;
  border-radius: 8px;
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  background-color: var(--background);
  border: 2px solid var(--card-border);
  flex-basis: 40%;
}

.disclaimer-icon {
  font-size: 1.2rem;
  margin-top: 2px;
}