/**
 * Name Detail Page Styles
 * Styles for individual name detail pages at /names/{slug}/
 */

/* Page Layout */
.name-detail-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.875rem;
  color: #666;
  margin-bottom: 1.5rem;
  padding: 0.5rem 0;
}

.breadcrumbs a {
  color: #0066cc;
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumbs .separator {
  margin: 0 0.5rem;
  color: #999;
}

.breadcrumbs [aria-current="page"] {
  color: #333;
  font-weight: 500;
}

/* Header Section */
.name-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  position: relative;
}

.name-header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.favorites-button-container {
  margin-left: auto;
}

.favorites-button-container .favorite-btn {
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all 0.2s;
  color: #666;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.favorites-button-container .favorite-btn:hover {
  transform: scale(1.1);
  background: #f8f9fa;
  border-color: #bbb;
  color: #333;
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.favorites-button-container .favorite-btn.active {
  background: linear-gradient(90deg, #FFE7F0, #FFD3E0);
  border: 2px solid #FF8DAA;
  color: #c2185b;
  box-shadow: 0 4px 12px rgba(255, 141, 170, 0.3);
}

.favorites-button-container .favorite-btn.active.gender-boy {
  background: linear-gradient(90deg, #e3f2fd, #bbdefb);
  border: 2px solid #2196F3;
  color: #1565c0;
  box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.favorites-button-container .favorite-btn.active.gender-girl {
  background: linear-gradient(90deg, #fce4ec, #f8bbd9);
  border: 2px solid #E91E63;
  color: #c2185b;
  box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

.favorites-button-container .favorite-btn.active.gender-unisex {
  background: linear-gradient(90deg, #f3e5f5, #e1bee7);
  border: 2px solid #9C27B0;
  color: #7b1fa2;
  box-shadow: 0 4px 12px rgba(156, 39, 176, 0.3);
}

.name-title {
  font-size: 2.5rem;
  margin: 0;
  color: #333;
}

.badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.badge-trending {
  background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
  color: white;
}

.badge-classic {
  background: linear-gradient(135deg, #4ecdc4, #44a08d);
  color: white;
}

/* Primary Info Grid */
.primary-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.info-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: #666;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.info-value {
  font-size: 1.125rem;
  font-weight: 500;
  color: #333;
}

/* Pronunciation Section */
.pronunciation-section {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pronunciation-label {
  font-size: 0.875rem;
  color: #666;
}

.phonetic {
  font-size: 1.25rem;
  font-family: 'Courier New', monospace;
  color: #495057;
  background: #f8f9fa;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
}

.audio-btn {
  background: #0066cc;
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.2s, transform 0.2s;
  margin-left: auto;
}

.audio-btn:hover:not(:disabled) {
  background: #0052a3;
  transform: scale(1.05);
}

.audio-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Intro Summary */
.intro-summary {
  background: #fff;
  border-left: 4px solid #0066cc;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-radius: 0 8px 8px 0;
}

.intro-summary p {
  margin: 0;
  line-height: 1.7;
  color: #444;
  font-size: 1rem;
}

/* Tags Section */
.tags-section {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tag {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.2s;
  font-weight: 500;
  border: none;
  cursor: pointer;
}

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

/* Button-specific styles for gender tags */
button.tag {
  background: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  text-align: left;
}

.tag-gender-boy {
  background: #e3f2fd;
  color: #1565c0;
}

.tag-gender-girl {
  background: #fce4ec;
  color: #c2185b;
}

.tag-gender-unisex {
  background: #f3e5f5;
  color: #7b1fa2;
}

.tag-origin {
  background: #e8f5e9;
  color: #2e7d32;
}

.tag-badge {
  cursor: default;
}

.tag-badge-trending {
  background: #ffebee;
  color: #c62828;
}

.tag-badge-classic {
  background: #e0f2f1;
  color: #00695c;
}

/* Popularity Section */
.popularity-section {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
}

.popularity-section h2 {
  font-size: 1rem;
  margin: 0 0 0.75rem 0;
  color: #333;
}

.popularity-display {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.popularity-bar {
  flex: 1;
  height: 10px;
  background: #e9ecef;
  border-radius: 5px;
  overflow: hidden;
}

.popularity-fill {
  height: 100%;
  background: linear-gradient(90deg, #4ecdc4, #44a08d);
  border-radius: 5px;
  transition: width 0.5s ease;
}

.popularity-score {
  font-weight: 600;
  color: #333;
  min-width: 60px;
  text-align: right;
}

/* Related Names Grid */
.related-names-section,
.similar-names-section {
  margin-bottom: 1.5rem;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 12px;
}

.related-names-section h2,
.similar-names-section h2 {
  font-size: 1.25rem;
  margin: 0 0 0.5rem 0;
  color: #333;
}

.section-description {
  color: #666;
  font-size: 0.875rem;
  margin: 0 0 1rem 0;
}

.related-names-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
}

.related-name-card {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
  text-decoration: none;
  color: #333;
  transition: all 0.2s;
  font-weight: 500;
}

.related-name-card:hover {
  background: #e9ecef;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  color: #0066cc;
}

/* Similar Names List */
.similar-names-list {
  line-height: 2;
}

.similar-name-link {
  color: #0066cc;
  text-decoration: none;
  transition: color 0.2s;
}

.similar-name-link:hover {
  text-decoration: underline;
  color: #0052a3;
}

/* FAQ Section */
.faq-section {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.faq-section h2 {
  font-size: 1.25rem;
  margin: 0 0 1rem 0;
  color: #333;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.faq-item {
  background: #fff;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.faq-question {
  font-size: 1rem;
  margin: 0 0 0.5rem 0;
  color: #333;
  font-weight: 600;
}

.faq-answer {
  margin: 0;
  color: #555;
  line-height: 1.6;
}

/* CTA Buttons Section */
.cta-section {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-top: 1rem;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
  font-size: 0.9375rem;
}

.cta-btn-primary {
  background: #0066cc;
  color: white;
}

.cta-btn-primary:hover {
  background: #0052a3;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.3);
}

.cta-btn-secondary {
  background: #e9ecef;
  color: #333;
}

.cta-btn-secondary:hover {
  background: #dee2e6;
  transform: translateY(-1px);
}

/* 404 Not Found Section */
.not-found-section {
  text-align: center;
  padding: 3rem 1rem;
}

.not-found-section h1 {
  font-size: 2rem;
  color: #333;
  margin-bottom: 1rem;
}

.not-found-section p {
  color: #666;
  margin-bottom: 2rem;
}

.not-found-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

/* Brand title fix for detail pages */
.brand-title {
  font-size: 1.25rem;
  margin: 0;
}

/* Back Button Styling */
.back-btn {
  font-size: 0.9375rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  white-space: nowrap;
  text-decoration: none;
}

.back-btn:hover {
  text-decoration: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .name-detail-page {
    padding: 0.75rem;
  }
  
  .name-header {
    padding: 1.5rem;
  }
  
  .name-title {
    font-size: 2rem;
  }
  
  .name-header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .favorites-button-container {
    margin-left: 0;
    align-self: flex-end;
    position: absolute;
    top: 1rem;
    right: 1rem;
  }
  
  .favorites-button-container .favorite-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    border-width: 2px;
  }
  
  .primary-info {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .pronunciation-section {
    flex-wrap: wrap;
  }
  
  .audio-btn {
    margin-left: 0;
  }
  
  .related-names-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .cta-section {
    flex-direction: column;
  }
  
  .cta-btn {
    justify-content: center;
    width: 100%;
  }
  
  .not-found-actions {
    flex-direction: column;
  }
  
  /* Back button mobile styling */
  .back-btn {
    font-size: 0.875rem;
    padding: 0.5rem 0.875rem;
  }
}

/* Name Information Section (FAQ Style) */
.name-info-section {
  background: linear-gradient(180deg, var(--bg-faq-section-start) 0%, var(--bg-faq-section-end) 100%);
}

.name-info-list .faq-item:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.name-info-list .faq-item[open] {
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.name-info-list .faq-question::-webkit-details-marker {
  display: none;
}

.name-info-list .faq-question:hover {
  color: var(--accent);
}

.name-info-list .faq-question:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.name-info-list .faq-item[open] .faq-icon {
  transform: rotate(45deg);
}

/* Mobile responsive for name info section */
@media (max-width: 768px) {
  .name-info-section {
    padding: 16px !important;
  }
  
  .name-info-list .faq-question {
    padding: 16px 20px !important;
    font-size: 1rem !important;
  }
  
  .name-info-list .faq-answer {
    padding: 0 20px 20px 20px !important;
  }
}

/* Focus states for accessibility */
.tag:focus,
.related-name-card:focus,
.similar-name-link:focus,
.cta-btn:focus,
.audio-btn:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

/* Ensure minimum touch targets */
@media (pointer: coarse) {
  .tag,
  .related-name-card,
  .cta-btn {
    min-height: 44px;
    min-width: 44px;
  }
}
