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

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

.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;
}

/* Search and quick actions container */
.search-filters-container {
  align-items: center;
  display: inline-flex;
  gap: 1rem;
  justify-content: center;
}

/* Improved search input */
.search-container {
  max-width: 400px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  opacity: 0.6;
}

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

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

/* Quick actions */
.quick-actions {
  display: flex;
  gap: 0.5rem;
}

/* Share button */
.share-button {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--button-bg);
  color: var(--button-text);
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.share-button:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

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

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

/* ======= 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;
}

/* 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;
}

.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);
}

/* Star filter styling */
.star-filter-container {
  display: flex;
  align-items: center;
  gap: 2px;
  background-color: var(--navbar-bg);
  border: 2px solid var(--card-border);
  border-radius: 6px;
  padding: 6px 10px;
}

.star-filter-container .quality-star {
  cursor: pointer;
  font-size: 1.4rem;
  transition: transform 0.1s, color 0.2s;
  line-height: 1;
}

.star-filter-container .quality-star:hover {
  transform: scale(1.15);
}

.star-filter-container .quality-star.filled {
  color: #ffd700;
}

.star-filter-container .quality-star.empty {
  color: var(--card-border);
}

.quality-filter-clear {
  margin-left: 5px;
  cursor: pointer;
  background-color: rgba(var(--text-rgb), 0.1);
  color: var(--text);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
  transition: all 0.2s ease;
}

.quality-filter-clear:hover {
  background-color: rgba(var(--text-rgb), 0.2);
}

/* 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;
}

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

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

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

/* 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;
}

.quick-actions .share-button {
  padding: 14px 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-top: 5px;
  border-radius: 4px;
  color: var(--text);
  opacity: 0.8;
}

/* Enhanced quality stars */
.resource-quality {
  display: flex;
}

.quality-star {
  font-size: 1.4em;
  font-weight: 700;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.quality-star.filled {
  color: #ffd700;
}

.quality-star.empty {
  color: var(--card-border);
}

.star-filter-container .quality-star.filled {
  margin-bottom: 3.5px;
}

.star-filter-container .quality-star.empty {
  margin-bottom: 3.5px;
}

.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;
  }
}

@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;
  }
  
  .search-filters-container {
    align-items: stretch;
    flex-direction: row;
  }
  
  .search-container {
    max-width: none;
  }
  
  .filters-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .filter-dropdowns {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  
  .category-filter-dropdown,
  .quality-filter,
  .new-filter,
  .score-filter {
    width: 100%;
  }
  
  .category-filter-dropdown,
  .quality-filter {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }
  
  .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%;
  }
  
  .resources-header h1 {
    font-size: 1.4rem;
  }

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

  .search-filters-container {
    align-items: stretch;
    flex-direction: row;
  }

  .filter-dropdown {
    display: flex;
    flex-direction: column;
  }

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

}