/**
 * Youth Bible Studies - Navigation Filter Styles
 * Requirements: 4.1, 4.2, 4.3, 4.4, 4.5, 4.8, 4.9, 4.10, 11.1
 */

/* Container */
.navigation-filter {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}

/* Pathway Tabs */
.pathway-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #e0e0e0;
  overflow-x: auto;
}

.pathway-tab {
  padding: 0.75rem 1.5rem;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 1rem;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.pathway-tab:hover {
  color: #333;
  background-color: #f5f5f5;
}

.pathway-tab.active {
  color: #4ecdc4;
  border-bottom-color: #4ecdc4;
  font-weight: 600;
}

/* Search Container */
.search-container {
  position: relative;
  margin-bottom: 1.5rem;
}

.search-input {
  width: 100%;
  padding: 0.875rem 3rem 0.875rem 1rem;
  font-size: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  transition: border-color 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: #4ecdc4;
}

.search-clear-btn {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #999;
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.3s ease;
}

.search-clear-btn:hover {
  color: #333;
}

/* Search Suggestions */
.search-suggestions,
.recent-searches {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 2px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.suggestion-item,
.recent-search-item {
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.suggestion-item:hover,
.recent-search-item:hover {
  background-color: #f5f5f5;
}

.suggestion-item strong {
  color: #4ecdc4;
  font-weight: 600;
}

.recent-searches-header {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #666;
  background-color: #f9f9f9;
  border-bottom: 1px solid #e0e0e0;
}

.recent-search-icon {
  margin-right: 0.5rem;
  opacity: 0.6;
}

/* Filter Controls */
.filter-controls {
  margin-bottom: 1.5rem;
}

.filter-group {
  margin-bottom: 1.5rem;
}

.filter-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #333;
}

.filter-hint {
  font-size: 0.8125rem;
  color: #666;
  margin: 0.5rem 0 0;
  line-height: 1.4;
}

.recommendations-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  color: #333;
}

.recommendations-toggle-label input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-chips.scrollable {
  max-height: 200px;
  overflow-y: auto;
  padding: 0.5rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: #f5f5f5;
  border: 2px solid #e0e0e0;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-chip:hover {
  background-color: #e8f8f5;
  border-color: #4ecdc4;
  color: #333;
}

.filter-chip.active {
  background-color: #4ecdc4;
  border-color: #4ecdc4;
  color: white;
}

.chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.375rem;
  background-color: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.filter-chip.active .chip-count {
  background-color: rgba(255, 255, 255, 0.3);
}

.filter-select {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  background-color: white;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.filter-select:focus {
  outline: none;
  border-color: #4ecdc4;
}

/* Active Filters Display */
.active-filters {
  margin-bottom: 1.5rem;
}

.active-filters-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background-color: #f9f9f9;
  border-radius: 8px;
}

.active-filters-label {
  font-weight: 600;
  color: #666;
  margin-right: 0.5rem;
}

.active-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background-color: #4ecdc4;
  color: white;
  border-radius: 16px;
  font-size: 0.875rem;
  font-weight: 500;
}

.remove-filter-btn {
  background: none;
  border: none;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  margin-left: 0.25rem;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.remove-filter-btn:hover {
  opacity: 1;
}

.clear-all-filters-btn {
  padding: 0.375rem 0.875rem;
  background-color: #ff6b6b;
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.clear-all-filters-btn:hover {
  background-color: #ff5252;
}

/* Continue Section */
.continue-section {
  margin-bottom: 2rem;
}

.continue-container {
  padding: 1.5rem;
  background-color: #fff5e6;
  border-left: 4px solid #ff6b6b;
  border-radius: 8px;
}

.continue-title {
  margin: 0 0 1rem 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
}

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

/* Study Results */
.study-results {
  margin-top: 2rem;
}

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

.results-count {
  font-size: 1rem;
  font-weight: 600;
  color: #666;
}

.view-toggle {
  display: flex;
  gap: 0.5rem;
}

.view-btn {
  padding: 0.5rem 0.75rem;
  background-color: #f5f5f5;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.view-btn:hover {
  background-color: #e8f8f5;
  border-color: #4ecdc4;
}

.view-btn.active {
  background-color: #4ecdc4;
  border-color: #4ecdc4;
  color: white;
}

/* Studies Container */
.studies-container {
  min-height: 200px;
}

.studies-container.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.studies-container.list-view {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Study Card */
.study-card {
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

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

.study-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background-color: #f9f9f9;
}

.study-path-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
}

.study-testament-badge {
  padding: 0.25rem 0.5rem;
  background-color: #e0e0e0;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #666;
}

.study-card-body {
  padding: 1rem;
}

.study-title {
  margin: 0 0 0.5rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #333;
  line-height: 1.4;
}

.study-reference {
  margin: 0 0 0.75rem 0;
  font-size: 0.875rem;
  color: #666;
  font-style: italic;
}

.study-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  color: #666;
}

.study-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.topic-tag {
  padding: 0.25rem 0.5rem;
  background-color: #f0f0f0;
  border-radius: 8px;
  font-size: 0.75rem;
  color: #666;
}

.study-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background-color: #f9f9f9;
  border-top: 1px solid #e0e0e0;
}

.study-status {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.study-status.status-not_started {
  background-color: #e0e0e0;
  color: #666;
}

.study-status.status-in_progress {
  background-color: #fff3cd;
  color: #856404;
}

.study-status.status-completed {
  background-color: #d4edda;
  color: #155724;
}

.study-status.status-revisited {
  background-color: #d1ecf1;
  color: #0c5460;
}

.study-open-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background-color: #4ecdc4;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.study-open-btn:hover {
  background-color: #44a08d;
}

/* List View Specific Styles */
.studies-container.list-view .study-card {
  display: flex;
  flex-direction: row;
}

.studies-container.list-view .study-card-header {
  flex-direction: column;
  justify-content: center;
  min-width: 120px;
}

.studies-container.list-view .study-card-body {
  flex: 1;
}

.studies-container.list-view .study-card-footer {
  min-width: 200px;
  flex-direction: column;
  gap: 0.5rem;
}

/* No Results */
.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: #666;
}

.no-results p {
  margin: 0.5rem 0;
  font-size: 1rem;
}

/* Error Message */
.error-message {
  text-align: center;
  padding: 3rem 1rem;
  color: #ff6b6b;
}

.error-message button {
  margin-top: 1rem;
  padding: 0.75rem 1.5rem;
  background-color: #4ecdc4;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.error-message button:hover {
  background-color: #44a08d;
}

/* Responsive Design */
@media (max-width: 768px) {
  .navigation-filter {
    padding: 0.5rem;
  }

  .pathway-tabs {
    gap: 0.25rem;
  }

  .pathway-tab {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  .filter-chips {
    gap: 0.375rem;
  }

  .filter-chip {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
  }

  .studies-container.grid-view {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .studies-container.list-view .study-card {
    flex-direction: column;
  }

  .studies-container.list-view .study-card-header {
    flex-direction: row;
    justify-content: space-between;
  }

  .studies-container.list-view .study-card-footer {
    flex-direction: row;
    justify-content: space-between;
  }

  .continue-studies {
    grid-template-columns: 1fr;
  }

  .results-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .pathway-tab {
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }

  .study-title {
    font-size: 1rem;
  }

  .active-filters-container {
    padding: 0.75rem;
  }

  .continue-container {
    padding: 1rem;
  }
}

/* Dark mode: driven by youth section toggle (.dark-mode), slate palette */
.dark-mode .navigation-filter {
  color: var(--color-text-primary, #f1f5f9);
}

.dark-mode .pathway-tabs {
  border-bottom-color: var(--color-border, #334155);
}

.dark-mode .pathway-tab {
  color: var(--color-text-secondary, #cbd5e1);
}

.dark-mode .pathway-tab:hover {
  color: var(--color-text-primary, #f1f5f9);
  background-color: var(--color-surface, #1e293b);
}

.dark-mode .pathway-tab.active {
  color: #4ecdc4;
  border-bottom-color: #4ecdc4;
}

.dark-mode .search-input,
.dark-mode .filter-select {
  background-color: var(--color-surface, #1e293b);
  border-color: var(--color-border, #334155);
  color: var(--color-text-primary, #f1f5f9);
}

.dark-mode .search-input::placeholder {
  color: var(--color-text-tertiary, #94a3b8);
}

.dark-mode .search-clear-btn {
  color: var(--color-text-secondary, #cbd5e1);
}

.dark-mode .search-clear-btn:hover {
  color: var(--color-text-primary, #f1f5f9);
}

.dark-mode .search-suggestions,
.dark-mode .recent-searches {
  background: var(--color-surface, #1e293b);
  border-color: var(--color-border, #334155);
}

.dark-mode .filter-chip {
  background-color: var(--color-surface, #1e293b);
  border-color: var(--color-border, #334155);
  color: var(--color-text-secondary, #cbd5e1);
}

.dark-mode .filter-chip:hover {
  background-color: var(--color-surface-elevated, #334155);
  border-color: #4ecdc4;
  color: var(--color-text-primary, #f1f5f9);
}

/* ===== Notes pathway view ===== */
.ybs-notes-view {
  padding: 1rem 0;
}

.ybs-notes-view__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.ybs-notes-view__export {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.ybs-notes-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ybs-notes-empty {
  padding: 2rem;
  text-align: center;
  color: var(--color-text-secondary, #6b7280);
  background: var(--color-bg-secondary, #f9fafb);
  border-radius: 8px;
}

.ybs-note-card {
  background: var(--color-background, #fff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  transition: box-shadow 0.2s ease;
}

.ybs-note-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.ybs-note-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.ybs-note-card__meta {
  font-size: 0.8125rem;
  color: var(--color-text-secondary, #6b7280);
}

.ybs-note-card__actions {
  display: flex;
  gap: 0.5rem;
}

.ybs-note-btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: var(--color-bg-secondary, #f3f4f6);
  color: var(--color-text-primary, #111827);
}

.ybs-note-btn:hover {
  background: var(--color-border, #e5e7eb);
}

.ybs-note-btn--delete:hover {
  background: #fee2e2;
  color: #991b1b;
}

.ybs-note-card__content {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--color-text-primary, #111827);
  white-space: pre-wrap;
  word-break: break-word;
}

.ybs-note-card__link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary, #6366f1);
  text-decoration: none;
}

.ybs-note-card__link:hover {
  text-decoration: underline;
}

.ybs-note-edit-panel,
.ybs-note-add-panel {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--color-bg-secondary, #f9fafb);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 8px;
}

.ybs-note-edit-panel__title,
.ybs-note-add-panel .ybs-note-edit-panel__title {
  margin: 0 0 0.75rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary, #111827);
}

.ybs-note-edit-textarea {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.5;
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: 6px;
  resize: vertical;
  box-sizing: border-box;
  color: var(--color-text-primary, #111827);
  background: var(--color-background, #fff);
}

.ybs-note-edit-textarea:focus {
  outline: none;
  border-color: var(--color-primary, #6366f1);
}

.ybs-note-edit-panel__actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.dark-mode .ybs-notes-empty,
.dark-mode .ybs-note-card {
  background: var(--color-surface, #1e293b);
  border-color: var(--color-border, #334155);
}

.dark-mode .ybs-note-card__meta {
  color: var(--color-text-secondary, #cbd5e1);
}

.dark-mode .ybs-note-edit-panel,
.dark-mode .ybs-note-add-panel {
  background: var(--color-surface, #1e293b);
  border-color: var(--color-border, #334155);
}
