/**
 * AVIHPSAM - Domain Index Page Styles
 * Modern documentation style - clean, compact, readable
 */

/* ============================================
   DOMAIN HEADER - Compact clean banner
   ============================================ */

.domain-header {
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  color: white;
  padding: 1.5rem 0;
  text-align: center;
}

.domain-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.domain-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.domain-sanskrit {
  font-size: 0.9rem;
  opacity: 0.8;
  margin-bottom: 6px;
  font-family: var(--font-sanskrit);
}

.domain-description {
  font-size: 0.875rem;
  opacity: 0.85;
  max-width: 550px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ============================================
   SIDEBAR LAYOUT - Main container
   ============================================ */

.domain-layout {
  display: flex;
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: calc(100vh - 300px);
  background: #fff;
}

/* ============================================
   SIDEBAR - Left navigation panel
   ============================================ */

.domain-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #fafbfc;
  border-right: 1px solid #e2e8f0;
  padding: 1rem 0;
  position: sticky;
  top: 60px;
  height: fit-content;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}

.sidebar-header {
  padding: 0 1rem 0.75rem;
  margin-bottom: 0.5rem;
}

.sidebar-header h3 {
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin: 0;
  font-weight: 600;
}

.sidebar-nav {
  list-style: none;
  padding: 0 0.5rem;
  margin: 0;
}

.sidebar-nav-item {
  margin: 2px 0;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  text-decoration: none;
  color: #475569;
  font-size: 0.8125rem;
  border-radius: 6px;
  transition: all 0.15s ease;
  cursor: pointer;
}

.sidebar-nav-link:hover {
  background: #f1f5f9;
  color: #1e293b;
}

.sidebar-nav-link.active {
  background: rgba(30, 64, 175, 0.1);
  color: var(--color-primary);
  font-weight: 500;
}

.sidebar-nav-icon {
  font-size: 0.9rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-nav-text {
  flex-grow: 1;
}

.sidebar-nav-count {
  font-size: 0.6875rem;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 500;
}

.sidebar-nav-link.active .sidebar-nav-count {
  background: var(--color-primary);
  color: white;
}

/* Separator in sidebar */
.sidebar-separator {
  height: 1px;
  background: #e2e8f0;
  margin: 8px 12px;
}

/* ============================================
   CONTENT AREA - Right panel with topics
   ============================================ */

.domain-content {
  flex-grow: 1;
  padding: 1.25rem 1.5rem;
  min-width: 0;
  background: #fff;
}

.content-header {
  margin-bottom: 1rem;
}

.content-header h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1e293b;
}

.content-header-icon {
  font-size: 1rem;
}

.content-header p {
  color: #64748b;
  font-size: 0.8125rem;
  margin: 0;
}

/* ============================================
   TOPIC GRID - Responsive columns
   ============================================ */

.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 1200px) {
  .topic-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .topic-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   TOPIC CARD - Clean border style
   ============================================ */

.topic-card {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  text-decoration: none !important;
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 140px;
}

.topic-card:hover {
  border-color: var(--color-accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.topic-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.topic-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 2px;
  line-height: 1.3;
}

.topic-card-sanskrit {
  font-size: 0.8125rem;
  color: #64748b;
  margin-bottom: 6px;
  font-family: var(--font-sanskrit);
}

.topic-card-overview {
  font-size: 0.8125rem;
  color: #64748b;
  line-height: 1.5;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.topic-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.topic-card-category {
  font-size: 0.6875rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.topic-card-cta {
  color: var(--color-accent);
  font-size: 0.8125rem;
  font-weight: 500;
  transition: gap 0.2s ease;
}

.topic-card:hover .topic-card-cta {
  color: var(--color-primary);
}

/* Tier badges - Compact pills */
.tier-badge {
  font-size: 0.625rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tier-1a {
  background: #dcfce7;
  color: #166534;
}

.tier-1b {
  background: #dbeafe;
  color: #1e40af;
}

.tier-1c {
  background: #f0fdf4;
  color: #166534;
}

.tier-2 {
  background: #fef3c7;
  color: #92400e;
}

.tier-3 {
  background: #f3e8ff;
  color: #7c3aed;
}

.tier-4 {
  background: #fee2e2;
  color: #991b1b;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.category-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2.5rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.category-empty-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.75rem;
  opacity: 0.5;
}

.category-empty h3 {
  color: #475569;
  font-size: 1rem;
  margin-bottom: 4px;
}

.category-empty p {
  color: #64748b;
  font-size: 0.8125rem;
}

/* ============================================
   SEARCH/FILTER BAR
   ============================================ */

.content-toolbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.content-search {
  flex-grow: 1;
  max-width: 280px;
}

.content-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.8125rem;
  transition: border-color 0.2s ease;
}

.content-search input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.08);
}

.content-sort {
  font-size: 0.8125rem;
  color: #64748b;
}

/* ============================================
   STATS BAR
   ============================================ */

.domain-stats-bar {
  background: white;
  border-bottom: 1px solid #e2e8f0;
  padding: 8px 0;
}

.domain-stats-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.8125rem;
  color: #64748b;
}

.domain-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.domain-stat strong {
  color: #1e293b;
}

/* ============================================
   RESPONSIVE - Mobile layout
   ============================================ */

@media (max-width: 768px) {
  .domain-layout {
    flex-direction: column;
  }

  .domain-sidebar {
    width: 100%;
    position: relative;
    top: 0;
    max-height: none;
    padding: 0.75rem 0;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }

  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    gap: 4px;
    padding: 0 0.75rem;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-nav-item {
    margin: 0;
  }

  .sidebar-nav-link {
    white-space: nowrap;
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .sidebar-nav-link.active {
    background: var(--color-primary);
    color: white;
  }

  .sidebar-nav-link.active .sidebar-nav-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
  }

  .sidebar-header {
    display: none;
  }

  .sidebar-separator {
    display: none;
  }

  .sidebar-nav-count {
    display: none;
  }

  .domain-content {
    padding: 1rem;
  }

  .topic-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .topic-card {
    min-height: auto;
    padding: 0.875rem;
  }

  .domain-header {
    padding: 1.25rem 0;
  }

  .domain-header h1 {
    font-size: 1.25rem;
  }
}

/* ============================================
   LOADING STATE
   ============================================ */

.loading-skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.topic-card-skeleton {
  height: 140px;
}

/* ============================================
   NO RESULTS STATE
   ============================================ */

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem;
  color: #64748b;
  font-size: 0.875rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px dashed #e2e8f0;
}
