/* Home Page Styles */

/* Page specific background */
body.page-home {
  background: #f4f6fb;
}

/* Hero Section */
.hero-section {
  position: relative;
  overflow: hidden;
  min-height: 75vh;
  display: flex;
  align-items: center;
  background: linear-gradient(140deg, rgba(37, 99, 235, 0.96) 0%, rgba(76, 29, 149, 0.94) 55%, rgba(147, 51, 234, 0.9) 100%);
  color: #fff;
  border-radius: 0 0 3rem 3rem;
  box-shadow: 0 32px 60px rgba(37, 99, 235, 0.35);
  margin-bottom: 4rem;
}

.hero-section h1 {
  width: 100%;
  text-align: center;
}

.hero-section::before,
.hero-section::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  opacity: 0.35;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.4), transparent 65%);
  filter: blur(0);
}

.hero-section::before {
  width: 32rem;
  height: 32rem;
  top: -12rem;
  left: -12rem;
}

.hero-section::after {
  width: 28rem;
  height: 28rem;
  bottom: -10rem;
  right: -8rem;
}

.hero-body {
  position: relative;
  z-index: 1;
}

.hero-subtitle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xs) var(--space-lg);
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  font-size: var(--font-size-md);
  margin-bottom: var(--space-xl);
  letter-spacing: 0.04em;
}

.hero-features {
  list-style: none;
  padding: 0;
  margin: 0 0 2.5rem;
  display: grid;
  gap: 0.75rem;
}

.hero-features li {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: var(--font-size-md);
  color: rgba(255, 255, 255, 0.85);
}

.hero-features .icon-circle {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: var(--font-size-lg);
}

.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-metrics .metric {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 1.2rem;
  padding: 0.9rem 1.2rem;
  min-width: 9rem;
  text-align: center;
}

.hero-metrics strong {
  display: block;
  font-size: var(--font-size-h4);
}

/* Section Styles */
.section-title {
  font-size: var(--font-size-h2);
  font-weight: 700;
  margin-bottom: var(--space-lg);
  line-height: var(--line-height-snug);
}

.section-description {
  color: var(--brand-muted);
  font-size: var(--font-size-lg);
  line-height: var(--line-height-relaxed);
  max-width: 38rem;
  margin: 0 auto var(--space-3xl);
}

/* Info Cards */
.info-card {
  background: #fff;
  border-radius: var(--radius-2xl);
  padding: var(--space-2xl);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--brand-border);
  height: 100%;
}

.info-card h3 {
  font-size: var(--font-size-h4);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-md);
}

.info-card p {
  color: var(--brand-muted);
  font-size: var(--font-size-md);
  line-height: var(--line-height-relaxed);
  margin-bottom: 0;
}

/* Workflow Steps */
.workflow-steps {
  display: grid;
  gap: 1.5rem;
}

.workflow-step {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--brand-border);
  display: flex;
  gap: var(--space-lg);
  align-items: flex-start;
}

.workflow-step .step-index {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(147, 51, 234, 0.22));
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.workflow-step h4 {
  font-size: var(--font-size-h5);
  line-height: var(--line-height-snug);
  margin-bottom: var(--space-xs);
}

.workflow-step p {
  color: var(--brand-muted);
  font-size: var(--font-size-md);
  line-height: var(--line-height-relaxed);
  margin-bottom: 0;
}

/* Topic Cards - Home Page Variant */
.topic-card {
  border-radius: var(--radius-xl);
  border: 1px solid var(--brand-border);
  box-shadow: var(--shadow-lg);
  background: #fff;
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.25s ease;
}

.topic-card:hover {
  box-shadow: 0 22px 50px rgba(37, 99, 235, 0.13);
}

.topic-card__header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.topic-card__title {
  font-size: var(--font-size-h5);
  font-weight: 700;
  margin: 0;
  color: var(--brand-dark);
  line-height: var(--line-height-snug);
}

.topic-card__title:hover {
  color: var(--brand-primary);
}

.topic-card__excerpt {
  color: var(--brand-muted);
  margin: 0;
  font-size: var(--font-size-md);
  line-height: var(--line-height-relaxed);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.topic-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.75rem;
  margin-top: 0.25rem;
  border-top: 1px dashed rgba(15, 23, 42, 0.1);
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  background: #eef2ff;
  color: #374151;
  font-size: var(--font-size-xs);
  font-weight: 600;
}

.meta-chip.text-success {
  background: rgba(25, 135, 84, 0.14);
  color: #0f5132;
}

.meta-chip.text-danger {
  background: rgba(220, 53, 69, 0.14);
  color: #842029;
}

.meta-chip.text-muted {
  background: #f1f5f9;
  color: #475569;
}

.meta-chip i {
  font-size: 1rem;
}

.topic-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding-top: 0.6rem;
  margin-top: auto;
  border-top: 1px dashed rgba(15, 23, 42, 0.1);
}

.tag-badge {
  background: rgba(37, 99, 235, 0.14);
  color: var(--brand-primary);
  font-weight: 600;
}

/* Community Highlight */
.community-highlight {
  position: relative;
  border-radius: 2rem;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(147, 51, 234, 0.12));
  padding: 3rem;
  overflow: hidden;
}

.community-highlight::after {
  content: "";
  position: absolute;
  inset: -30% -40% auto;
  height: 120%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.22), transparent 70%);
  opacity: 0.5;
}

.community-highlight .quote {
  max-width: 36rem;
  position: relative;
  z-index: 1;
}

/* Call to Action */
.call-to-action {
  border-radius: 2rem;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
  color: #fff;
  padding: 3rem;
  box-shadow: 0 30px 40px rgba(37, 99, 235, 0.28);
}

/* Trending Tags */
.trending-tags .badge {
  margin: var(--space-xs);
  font-size: var(--font-size-md);
  padding: var(--space-sm) var(--space-lg);
  background: rgba(13, 110, 253, 0.1);
  color: var(--brand-primary);
  border-radius: var(--radius-full);
}

/* Responsive Styles */
@media (max-width: 991.98px) {
  .hero-section {
    border-radius: 0 0 2.5rem 2.5rem;
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
}

@media (max-width: 575.98px) {
  .hero-metrics {
    gap: 0.75rem;
  }

  .hero-metrics .metric {
    min-width: calc(50% - 0.4rem);
    padding: 0.7rem 0.9rem;
  }

  .call-to-action {
    padding: 2.2rem 1.8rem;
  }
}

/* Governance Table Styles */
.governance-table-box {
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: .75rem;
  padding: 1rem;
  overflow-y: visible;
}

.governance-table-box .table {
  margin-bottom: 0;
}

.governance-table-box .table thead th {
  background-color: #f8f9fa;
  color: #495057;
  font-weight: 600;
  border-bottom: 2px solid #dee2e6;
  padding: 1rem 0.75rem;
  font-size: 0.9rem;
}

.governance-table-box .table tbody td {
  padding: 1rem 0.75rem;
  vertical-align: middle;
}

.governance-table-box .table-hover tbody tr:hover {
  background-color: #f8f9fa;
}

.governance-table-box .badge {
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
}

/* Pagination Styles */
.pagination .page-link {
  color: var(--brand-primary);
  border-color: #dee2e6;
  padding: 0.5rem 0.75rem;
  font-weight: 500;
}

.pagination .page-link:hover {
  background-color: rgba(37, 99, 235, 0.1);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.pagination .page-item.active .page-link {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
}

.pagination .page-item.disabled .page-link {
  color: #6c757d;
  background-color: #fff;
  border-color: #dee2e6;
}

/* AI Vote Cell Styles */
.ai-vote-cell {
  position: relative;
}

.ai-vote-cell .btn-outline-secondary.rounded-circle {
  width: 28px;
  height: 28px;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.ai-vote-cell .btn-outline-secondary.rounded-circle:hover {
  transform: scale(1.1);
  background-color: rgba(108, 117, 125, 0.1);
}

/* AI Detail Overlay */
.ai-detail-overlay {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 10px;
  z-index: 1050;
  width: 350px;
  max-width: 400px;
  animation: fadeInDown 0.3s ease-out;
}

.ai-detail-card {
  background: #fff;
  border: 2px solid #0d6efd;
  border-radius: 0.75rem;
  padding: 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  text-align: start;
}

.ai-detail-card strong {
  color: #0d6efd;
  font-size: 0.95rem;
}

.ai-detail-card p {
  color: #495057;
  font-size: 0.9rem;
  line-height: 1.6;
}

.ai-detail-card .btn-close {
  font-size: 0.7rem;
  padding: 0.25rem;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* Topic View Button */
.btn-outline-primary.rounded-circle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  transition: all 0.2s ease;
}

.btn-outline-primary.rounded-circle:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
}

.btn-outline-primary.rounded-circle i {
  font-size: 1.1rem;
}

/* Smooth Scroll */
html {
  scroll-behavior: smooth;
}

/* Responsive Styles for Governance Table */
@media (max-width: 768px) {
  .governance-table-box {
    padding: .5rem;
  }
  
  .governance-table-box .table {
    font-size: .85rem;
  }
  
  .governance-table-box .table thead th,
  .governance-table-box .table tbody td {
    padding: .5rem .25rem;
    font-size: .8rem;
  }
  
  .governance-table-box .badge {
    font-size: .7rem;
    padding: .3rem .5rem;
  }
  
  .btn-outline-primary.rounded-circle {
    width: 32px;
    height: 32px;
    padding: 0 !important;
  }
  
  .btn-outline-primary.rounded-circle i {
    font-size: .9rem;
  }
  
  .ai-vote-cell .btn-outline-secondary.rounded-circle {
    width: 24px;
    height: 24px;
  }
  
  .ai-detail-overlay {
    width: 90vw;
    max-width: 280px;
    left: 50%;
    transform: translateX(-50%);
  }
  
  .ai-detail-card {
    font-size: .85rem;
  }
  
  @keyframes fadeInDown {
    from {
      opacity: 0;
      transform: translateX(-50%) translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }
  }
}

/* Ensure proper positioning for overlay */
.governance-table-box tbody td {
  position: relative;
}

.governance-table-box tbody td:has(.ai-vote-cell) {
  overflow: visible;
}

/* Card body overflow */
.card-body {
  overflow: visible !important;
}

/* Table scrolling with overflow consideration */
.governance-table-box .table-responsive {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
}
