/* browse.css - Specific styles for browse.html */

/* Page Header */
/* Browse Page Header - Match Hero Assistant Layout */
.browse-page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0.5rem 0;
    position: relative;
    overflow: hidden;
}

.browse-page-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(to right, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 4rem 4rem;
    opacity: 0.3;
}

.hero-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
}

.hero-content {
    text-align: center;
    color: white;
    flex: 1;
    max-width: 500px;
    margin: 0 2rem;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    font-size: 1.25rem;
    opacity: 0.9;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.hero-image {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.assistant-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.assistant-card:hover {
    transform: translateY(-5px);
}

.assistant-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.assistant-card:hover .assistant-img {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.assistant-info {
    text-align: center;
}

.assistant-name {
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    opacity: 0.9;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.assistant-card:hover .assistant-name {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Floating animation for assistants */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.assistant-img {
    animation: float 6s ease-in-out infinite;
}

.hero-image.right .assistant-img {
    animation-delay: 1s;
}

.browse-search {
  max-width: 500px;
  margin: 1rem auto 1rem auto;
}

.search-container {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-muted);
  z-index: 2;
}

.browse-search .search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  padding: 0.75rem 1rem 0.75rem 3rem;
  font-size: 1rem;
  color: var(--color-foreground);
  transition: var(--transition);
}

.browse-search .search-input:focus {
  background: white;
  border-color: white;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
  outline: none;
}

.browse-search .search-input::placeholder {
  color: var(--color-muted);
}

/* Alphabet Navigation - UPDATED FOR WRAPPING */
.alphabet-nav {
  background: var(--color-background);
  padding: 1rem 0;
  position: sticky;
  top: 4rem;
  z-index: 99;
  backdrop-filter: blur(8px);
  background-color: rgba(255, 255, 255, 0.95);
  margin: 0;
}

.dark .alphabet-nav {
  background-color: rgba(15, 23, 42, 0.95);
}

.alphabet-nav-content {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.alphabet-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: all 0.2s ease;
  text-decoration: none;
  color: var(--color-foreground);
  flex-shrink: 0; /* Prevent shrinking */
}

.alphabet-link:hover,
.alphabet-link:focus {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

.alphabet-link.active {
  background: var(--color-primary) !important; /* Fixed variable */
  color: white !important;
  border-color: var(--color-primary) !important; /* Fixed variable */
  z-index: 2;
}

/* Main Content */
.browse-content {
  padding: 2rem 0 4rem;
}

.guides-container {
  max-width: 1280px;
  margin: 0 auto;
}

/* Guide sections with proper scroll margin */
.guide-section {
  margin-bottom: 3rem;
  padding: 2rem;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.guide-section:hover {
  box-shadow: var(--shadow-md);
}

.guide-section.empty-section {
  background: transparent;
  border: 2px dashed var(--color-border);
  text-align: center;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--color-border);
}

.section-letter {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  margin: 0;
}

.guide-count {
  font-size: 0.875rem;
  color: var(--color-muted);
  font-weight: 500;
  background: var(--color-background);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  border: 1px solid var(--color-border);
}

/* Guides Grid */
.guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
}

.guide-card {
  background: var(--color-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: var(--transition);
  text-decoration: none;
  display: block;
}

.guide-card:hover {
  background: var(--color-card-hover);
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.guide-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-foreground);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.guide-excerpt {
  font-size: 0.875rem;
  color: var(--color-muted);
  line-height: 1.5;
  margin: 0;
}

/* Empty State */
.empty-state {
  padding: 3rem 2rem;
  text-align: center;
}

.empty-state p {
  color: var(--color-muted);
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
}

.btn:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--color-card);
  color: var(--color-foreground);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-card-hover);
  border-color: var(--color-primary);
}

/* Focus Styles for Accessibility */
.alphabet-link:focus,
.guide-card:focus,
.btn:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .guides-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
  }
  
  .browse-page-header .hero-container {
    padding: 0 2rem;
  }
  
  .browse-page-header .assistant-img {
    width: 70px;
    height: 70px;
  }
}

  @media (max-width: 1024px) {
  .assistant-name {
    white-space: normal !important;
    word-wrap: break-word !important;
    max-width: 80px !important;
    text-align: center;
    line-height: 1.2;
    padding: 0.25rem 0.5rem;
    height: auto !important;
    justify-content: center;
    font-size: x-small;
  }
}

@media (max-width: 768px) {
  .browse-page-header {
    padding: 1.5rem 0 1rem;
  }
  
  .browse-page-header h1 {
    font-size: 2rem;
  }
  
  .browse-page-header .page-description {
    font-size: 1rem;
  }
  
  .browse-page-header .hero-container {
    flex-direction: column;
    gap: 1.5rem;
    padding: 0 1rem;
    margin: 0;
    max-width: 100%;
  }
  
  .browse-page-header .hero-image.left,
  .browse-page-header .hero-content,
  .browse-page-header .hero-image.right {
    order: unset;
  }
  
  .browse-page-header .assistant-card {
    display: none;
  }
  
  .browse-page-header .assistant-img {
    width: 60px;
    height: 60px;
  }
  
  .browse-page-header .assistant-name {
    font-size: 0.8rem;
  }
  
  .alphabet-nav {
    top: 3rem;
    padding: 0.75rem 0;
  }
  
  .alphabet-nav-content {
    min-width: unset; /* Remove the min-width constraint */
    width: 100%; /* Allow full width */
    flex-wrap: wrap; /* Ensure wrapping is enabled */
    justify-content: center; /* Center the items */
    gap: 0.25rem; /* Maintain proper spacing */
  }
  
  .alphabet-link {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.8rem;
    flex: 0 0 auto; /* Prevent items from growing/shrinking */
  }
  
  .guide-section {
    padding: 1.5rem;
    margin-bottom: 2rem;
    scroll-margin-top: 7rem;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .guides-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .guide-card {
    padding: 1.25rem;
  }
}

@media (max-width: 480px) {
  .browse-page-header {
    padding: 1rem 0 0.5rem;
  }
  
  .browse-page-header h1 {
    font-size: 1.75rem;
  }
  
  .browse-page-header .assistant-card {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .browse-page-header .assistant-img {
    width: 50px;
    height: 50px;
  }
  
  .browse-page-header .assistant-name {
    font-size: 0.75rem;
  }
  
  .alphabet-nav {
    top: 3rem; /* Match smaller mobile header */
  }

  .alphabet-nav-content {
    gap: 0.125rem;
  }
  
  .alphabet-link {
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
  }
  
  .guide-section {
    padding: 1rem;
    margin-bottom: 1.5rem;
    scroll-margin-top: 7rem;
  }
  
  .section-letter {
    font-size: 1.75rem;
  }
}

/* Dark Mode Specific Adjustments */
.dark .browse-search .search-input {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.dark .browse-search .search-input:focus {
  background: var(--color-card);
  border-color: var(--color-primary);
}

.dark .guide-card {
  background: var(--color-background);
}

.dark .guide-card:hover {
  background: var(--color-card);
}

/* Loading States */
.guide-card.loading {
  opacity: 0.6;
  pointer-events: none;
}

.guide-card.loading::after {
  content: "Loading...";
  display: block;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.875rem;
}

/* Print Styles */
@media print {
  .alphabet-nav,
  .footer {
    display: none;
  }
  
  .guide-section {
    break-inside: avoid;
    border: 1px solid #ccc;
    box-shadow: none;
  }
  
  .guide-card {
    border: 1px solid #ddd;
  }
}

/* End of browse.css */