/* ==========================================================================
   TibCal.com — Reusable UI Components
   ========================================================================== */

/* Hero Banner Component */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #ffffff;
  padding: var(--space-12) 0 var(--space-16) 0;
  text-align: center;
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  margin-bottom: var(--space-10);
}

.hero-title {
  font-size: var(--font-size-4xl);
  color: #ffffff;
  margin-bottom: var(--space-3);
  letter-spacing: -0.025em;
}

.hero-subtitle {
  font-size: var(--font-size-xl);
  color: #dbeafe;
  max-width: 600px;
  margin: 0 auto var(--space-8) auto;
  font-weight: var(--font-weight-regular);
}

/* Homepage Search Box inside Hero */
.hero-search-wrapper {
  max-width: 640px;
  margin: 0 auto;
  position: relative;
}

.hero-search-form {
  display: flex;
  background-color: var(--color-bg-surface);
  border-radius: var(--radius-full);
  padding: var(--space-2);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.75rem 1.25rem;
  font-size: var(--font-size-base);
  color: var(--color-text-main);
}

.hero-search-input:focus {
  outline: none;
}

.hero-search-btn {
  background-color: var(--color-primary);
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  transition: background-color 0.15s ease;
}

.hero-search-btn:hover {
  background-color: var(--color-primary-hover);
}

/* Category Grid & Cards */
.section-title {
  font-size: var(--font-size-2xl);
  color: var(--color-text-main);
  margin-bottom: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

.category-card {
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  text-decoration: none;
  color: var(--color-text-main);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.category-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
  text-decoration: none;
}

.category-icon-wrapper {
  width: 3rem;
  height: 3rem;
  background-color: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.category-icon-wrapper svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: currentColor;
}

.category-card-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-main);
  margin-bottom: var(--space-2);
}

.category-card-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: 0;
  flex: 1;
}

/* Calculator Grid & Cards */
.calculator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-12);
}

.calc-card {
  background-color: var(--color-bg-surface);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-decoration: none;
  color: var(--color-text-main);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
}

.calc-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.calc-card.placeholder-card {
  background-color: #fafafa;
  border-style: dashed;
}

.calc-card.placeholder-card:hover {
  border-color: var(--color-border);
  box-shadow: none;
}

.calc-badge {
  display: inline-block;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  background-color: var(--color-bg-subtle);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  align-self: flex-start;
}

.calc-badge-placeholder {
  background-color: #fef3c7;
  color: #92400e;
}

.calc-card-title {
  font-size: 1.05rem;
  font-weight: var(--font-weight-bold);
  line-height: 1.35;
  color: var(--color-text-main);
  margin-bottom: var(--space-2);
  transition: color 0.15s ease;
}

.calc-card:hover .calc-card-title {
  color: var(--color-primary);
}

.calc-card-desc {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  margin-bottom: 0;
}

/* Breadcrumb Component (Supports both .breadcrumb and .tc-breadcrumbs) */
.breadcrumb,
.tc-breadcrumbs {
  margin-bottom: var(--space-6);
  font-size: var(--font-size-sm);
}

.breadcrumb,
.tc-breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--color-text-light);
}

.tc-breadcrumbs__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.tc-breadcrumbs__item:not(:last-child)::after {
  content: "›";
  color: var(--color-text-light);
  opacity: 0.6;
  font-size: 0.9em;
}

.breadcrumb a,
.tc-breadcrumbs__item a {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.breadcrumb a:hover,
.tc-breadcrumbs__item a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.breadcrumb-separator {
  color: var(--color-text-light);
  opacity: 0.6;
}

.tc-breadcrumbs__item--active,
.tc-breadcrumbs__item[aria-current="page"] {
  color: var(--color-text-main);
  font-weight: var(--font-weight-medium);
}

/* Search Overlay Modal */
.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.search-modal.is-active {
  opacity: 1;
  pointer-events: auto;
}

.search-modal-container {
  background-color: var(--color-bg-surface);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 640px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.search-modal-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-border-light);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.search-modal-input {
  flex: 1;
  border: none;
  font-size: var(--font-size-lg);
  color: var(--color-text-main);
}

.search-modal-input:focus {
  outline: none;
}

.search-modal-close {
  background: none;
  border: none;
  font-size: var(--font-size-sm);
  color: var(--color-text-light);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.search-modal-results {
  max-height: 360px;
  overflow-y: auto;
  padding: var(--space-2) 0;
}

.search-result-item {
  padding: var(--space-3) var(--space-4);
  display: block;
  text-decoration: none;
  color: var(--color-text-main);
  border-bottom: 1px solid var(--color-bg-subtle);
}

.search-result-item:hover {
  background-color: var(--color-primary-light);
  text-decoration: none;
}

.search-result-meta {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.search-empty-state {
  padding: var(--space-4);
  text-align: center;
  color: var(--color-text-muted);
}

/* 404 Error Page Components */
.error-container {
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}

.error-content-body {
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}

.error-code {
  font-size: 4rem;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}

.error-title {
  margin-bottom: var(--space-4);
}

.error-text {
  font-size: var(--font-size-lg);
  margin-bottom: var(--space-8);
  color: var(--color-text-muted);
}

.error-actions {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-10);
}

.error-actions a {
  text-decoration: none;
}

.error-categories-wrapper {
  border-top: 1px solid var(--color-border-light);
  padding-top: var(--space-6);
  text-align: left;
}

.error-categories-title {
  font-size: var(--font-size-base);
  margin-bottom: var(--space-3);
  text-align: center;
}

.error-categories-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-2);
  list-style: none;
  padding: 0;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Call To Action Banner Component
   -------------------------------------------------------------------------- */
.cta-banner {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-10) var(--space-8);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  margin-top: var(--space-8);
}

.cta-banner::before {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

.cta-content {
  flex: 1;
  max-width: 680px;
}

.cta-title {
  font-size: var(--font-size-2xl);
  color: #ffffff;
  margin-bottom: var(--space-2);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.02em;
}

.cta-desc {
  font-size: var(--font-size-base);
  color: #94a3b8;
  margin: 0;
  line-height: var(--line-height-relaxed);
}

.cta-action {
  flex-shrink: 0;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--color-primary);
  color: #ffffff;
  padding: 0.875rem 1.75rem;
  border-radius: var(--radius-lg);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.cta-btn:hover {
  background-color: var(--color-primary-dark);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45);
}

.cta-btn svg {
  transition: transform 0.2s ease;
}

.cta-btn:hover svg {
  transform: translateX(4px);
}

@media (max-width: 767px) {
  .cta-banner {
    flex-direction: column;
    text-align: center;
    padding: var(--space-8) var(--space-6);
  }

  .cta-action {
    width: 100%;
  }

  .cta-btn {
    width: 100%;
    justify-content: center;
  }
}
