/**
 * TCH Components - The Connected Haven
 * Core UI components for the smart home guide
 *
 * @package Blocksy_Child_TCH
 * @version 1.0.0
 */

/* ==========================================================================
   1. ECOSYSTEM CARDS
   ========================================================================== */

.ecosystem-card {
  position: relative;
  padding: 32px;
  background: var(--tch-white);
  border-radius: 20px;
  border: 2px solid var(--tch-light);
  text-align: center;
  transition: all 0.3s ease;
  overflow: hidden;
}

.ecosystem-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--ecosystem-color, var(--tch-primary));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.ecosystem-card:hover {
  border-color: var(--ecosystem-color, var(--tch-primary));
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.ecosystem-card:hover::before {
  transform: scaleX(1);
}

.ecosystem-card__logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ecosystem-card__logo img,
.ecosystem-card__logo svg {
  max-width: 100%;
  max-height: 100%;
}

.ecosystem-card__name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--tch-dark);
}

.ecosystem-card__tagline {
  font-size: 0.9375rem;
  color: var(--tch-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.ecosystem-card__count {
  font-size: 0.875rem;
  color: var(--tch-muted);
  margin-bottom: 16px;
}

.ecosystem-card__features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
  text-align: left;
}

.ecosystem-card__features li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 8px;
  font-size: 0.9375rem;
  color: var(--tch-text);
}

.ecosystem-card__features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 16px;
  height: 16px;
  background: var(--ecosystem-color, var(--tch-primary));
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='currentColor'%3E%3Cpath fill-rule='evenodd' d='M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z' clip-rule='evenodd'/%3E%3C/svg%3E");
}

.ecosystem-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--tch-primary);
  font-weight: 600;
  text-decoration: none;
  transition: gap 0.2s ease;
}

.ecosystem-card__cta:hover {
  gap: 12px;
}

.ecosystem-card__cta svg {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
}

.ecosystem-card:hover .ecosystem-card__cta svg {
  transform: translateX(4px);
}

/* Ecosystem Color Variants */
.ecosystem-card--alexa {
  --ecosystem-color: var(--ecosystem-alexa);
}

.ecosystem-card--homekit {
  --ecosystem-color: #000000;
}

.ecosystem-card--google {
  --ecosystem-color: var(--ecosystem-google);
}

.ecosystem-card--smartthings {
  --ecosystem-color: var(--ecosystem-smartthings);
}

.ecosystem-card--matter {
  --ecosystem-color: var(--ecosystem-matter);
}

/* Ecosystem Grid */
.ecosystem-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

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

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

  .ecosystem-card {
    padding: 24px;
  }
}

/* ==========================================================================
   2. GUIDE CARDS
   ========================================================================== */

.guide-card {
  display: flex;
  flex-direction: column;
  background: var(--tch-white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.guide-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.guide-card__image {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.guide-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.guide-card:hover .guide-card__image img {
  transform: scale(1.05);
}

.guide-card__badge {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 6px 12px;
  background: var(--tch-primary);
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.guide-card__badge--beginner {
  background: var(--tch-accent);
}

.guide-card__badge--intermediate {
  background: var(--tch-secondary);
}

.guide-card__badge--advanced {
  background: var(--tch-primary);
}

.guide-card__badge--new {
  background: #ef4444;
}

.guide-card__badge--updated {
  background: #8b5cf6;
}

.guide-card__ecosystem-tag {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: var(--tch-white);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.guide-card__ecosystem-tag img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.guide-card__content {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.guide-card__category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tch-primary);
  margin-bottom: 8px;
}

.guide-card__title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 12px;
}

.guide-card__title a {
  color: var(--tch-dark);
  text-decoration: none;
  transition: color 0.2s ease;
}

.guide-card__title a:hover {
  color: var(--tch-primary);
}

.guide-card__excerpt {
  color: var(--tch-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 16px;
  flex: 1;
}

.guide-card__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.8125rem;
  color: var(--tch-muted);
  padding-top: 16px;
  border-top: 1px solid var(--tch-light);
}

.guide-card__meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.guide-card__meta svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

/* Guide Card Grid */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

@media (max-width: 1024px) {
  .guide-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

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

  .guide-card__content {
    padding: 20px;
  }
}

/* Guide Card Horizontal Variant */
.guide-card--horizontal {
  flex-direction: row;
}

.guide-card--horizontal .guide-card__image {
  width: 280px;
  flex-shrink: 0;
  aspect-ratio: auto;
}

.guide-card--horizontal .guide-card__content {
  justify-content: center;
}

@media (max-width: 768px) {
  .guide-card--horizontal {
    flex-direction: column;
  }

  .guide-card--horizontal .guide-card__image {
    width: 100%;
    aspect-ratio: 16/9;
  }
}

/* Featured Guide Card */
.guide-card--featured {
  grid-column: span 2;
}

.guide-card--featured .guide-card__title {
  font-size: 1.5rem;
}

@media (max-width: 640px) {
  .guide-card--featured {
    grid-column: span 1;
  }
}

/* ==========================================================================
   3. RESOURCE DOWNLOAD BOX
   ========================================================================== */

.resource-box {
  background: linear-gradient(135deg, var(--tch-primary) 0%, var(--tch-primary-dark) 100%);
  border-radius: 20px;
  padding: 40px;
  color: white;
  display: flex;
  align-items: center;
  gap: 32px;
}

.resource-box__icon {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.resource-box__icon svg {
  width: 40px;
  height: 40px;
}

.resource-box__content {
  flex: 1;
}

.resource-box__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.8;
  margin-bottom: 8px;
}

.resource-box__title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.resource-box__description {
  opacity: 0.9;
  margin-bottom: 0;
  line-height: 1.6;
}

.resource-box__cta {
  flex-shrink: 0;
}

.resource-box__cta .btn {
  background: white;
  color: var(--tch-primary);
  padding: 14px 28px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.resource-box__cta .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.resource-box__cta .btn svg {
  width: 20px;
  height: 20px;
}

/* Resource Box Variants */
.resource-box--secondary {
  background: linear-gradient(135deg, var(--tch-secondary) 0%, var(--tch-secondary-dark) 100%);
}

.resource-box--secondary .resource-box__cta .btn {
  color: var(--tch-secondary);
}

.resource-box--accent {
  background: linear-gradient(135deg, var(--tch-accent) 0%, var(--tch-accent-dark) 100%);
}

.resource-box--accent .resource-box__cta .btn {
  color: var(--tch-accent);
}

.resource-box--dark {
  background: linear-gradient(135deg, var(--tch-dark) 0%, #0f172a 100%);
}

@media (max-width: 768px) {
  .resource-box {
    flex-direction: column;
    text-align: center;
    padding: 32px 24px;
  }

  .resource-box__icon {
    width: 64px;
    height: 64px;
  }

  .resource-box__icon svg {
    width: 32px;
    height: 32px;
  }

  .resource-box__title {
    font-size: 1.25rem;
  }
}

/* Resource Card (Smaller variant) */
.resource-card {
  background: var(--tch-white);
  border-radius: 16px;
  padding: 24px;
  border: 2px solid var(--tch-light);
  display: flex;
  align-items: flex-start;
  gap: 20px;
  transition: all 0.2s ease;
}

.resource-card:hover {
  border-color: var(--tch-primary);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.1);
}

.resource-card__icon {
  width: 48px;
  height: 48px;
  background: var(--tch-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--tch-primary);
}

.resource-card__icon svg {
  width: 24px;
  height: 24px;
}

.resource-card__content {
  flex: 1;
}

.resource-card__type {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tch-primary);
  margin-bottom: 4px;
}

.resource-card__title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--tch-dark);
  margin-bottom: 8px;
}

.resource-card__description {
  font-size: 0.875rem;
  color: var(--tch-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.resource-card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tch-primary);
  text-decoration: none;
}

.resource-card__link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   4. SECTION HEADERS
   ========================================================================== */

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header--left {
  text-align: left;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--tch-light);
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tch-primary);
  margin-bottom: 16px;
}

.section-badge svg {
  width: 16px;
  height: 16px;
}

.section-badge--primary {
  background: rgba(37, 99, 235, 0.1);
}

.section-badge--secondary {
  background: rgba(245, 158, 11, 0.1);
  color: var(--tch-secondary-dark);
}

.section-badge--accent {
  background: rgba(16, 185, 129, 0.1);
  color: var(--tch-accent-dark);
}

.section-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(2rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--tch-dark);
  margin-bottom: 16px;
  line-height: 1.2;
}

.section-title--gradient {
  background: linear-gradient(135deg, var(--tch-primary) 0%, var(--tch-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--tch-muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.section-header--left .section-subtitle {
  margin: 0;
}

.section-header__actions {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.section-header--left .section-header__actions {
  justify-content: flex-start;
}

/* ==========================================================================
   5. BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  line-height: 1.5;
}

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3);
}

.btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Primary Button */
.btn-primary {
  background: var(--tch-primary);
  color: white;
}

.btn-primary:hover {
  background: var(--tch-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Gradient Primary Button */
.btn-gradient {
  background: linear-gradient(135deg, var(--tch-primary) 0%, var(--tch-primary-light) 100%);
  color: white;
}

.btn-gradient:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

/* Secondary Button */
.btn-secondary {
  background: var(--tch-secondary);
  color: white;
}

.btn-secondary:hover {
  background: var(--tch-secondary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3);
}

/* Accent Button */
.btn-accent {
  background: var(--tch-accent);
  color: white;
}

.btn-accent:hover {
  background: var(--tch-accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

/* Outline Button */
.btn-outline {
  background: transparent;
  border: 2px solid var(--tch-primary);
  color: var(--tch-primary);
}

.btn-outline:hover {
  background: var(--tch-primary);
  color: white;
}

.btn-outline-white {
  background: transparent;
  border: 2px solid white;
  color: white;
}

.btn-outline-white:hover {
  background: white;
  color: var(--tch-primary);
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--tch-primary);
  padding: 12px 16px;
}

.btn-ghost:hover {
  background: var(--tch-light);
}

/* Dark Button */
.btn-dark {
  background: var(--tch-dark);
  color: white;
}

.btn-dark:hover {
  background: #0f172a;
  transform: translateY(-2px);
}

/* Button Sizes */
.btn-lg {
  padding: 16px 32px;
  font-size: 1.125rem;
  border-radius: 14px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
  border-radius: 8px;
}

.btn-xs {
  padding: 6px 12px;
  font-size: 0.75rem;
  border-radius: 6px;
}

/* Button States */
.btn:disabled,
.btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-loading {
  position: relative;
  color: transparent;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Button Group */
.btn-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-group--center {
  justify-content: center;
}

/* ==========================================================================
   6. ALERTS & NOTICES
   ========================================================================== */

.alert {
  padding: 16px 20px;
  border-radius: 12px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.alert__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.alert__content {
  flex: 1;
}

.alert__title {
  font-weight: 600;
  margin-bottom: 4px;
}

.alert__message {
  font-size: 0.9375rem;
  line-height: 1.5;
}

.alert--info {
  background: rgba(37, 99, 235, 0.1);
  border: 1px solid rgba(37, 99, 235, 0.2);
  color: var(--tch-primary-dark);
}

.alert--success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--tch-accent-dark);
}

.alert--warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--tch-secondary-dark);
}

.alert--error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #dc2626;
}

/* Pro Tip Box */
.pro-tip {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  gap: 16px;
}

.pro-tip__icon {
  width: 48px;
  height: 48px;
  background: var(--tch-primary);
  color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pro-tip__icon svg {
  width: 24px;
  height: 24px;
}

.pro-tip__label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tch-primary);
  margin-bottom: 4px;
}

.pro-tip__content {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--tch-text);
}

/* ==========================================================================
   7. BADGES & TAGS
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge--primary {
  background: rgba(37, 99, 235, 0.1);
  color: var(--tch-primary);
}

.badge--secondary {
  background: rgba(245, 158, 11, 0.1);
  color: var(--tch-secondary-dark);
}

.badge--accent {
  background: rgba(16, 185, 129, 0.1);
  color: var(--tch-accent-dark);
}

.badge--dark {
  background: var(--tch-dark);
  color: white;
}

.badge--alexa {
  background: rgba(0, 202, 255, 0.1);
  color: #0099cc;
}

.badge--homekit {
  background: rgba(0, 0, 0, 0.1);
  color: #000000;
}

.badge--google {
  background: rgba(66, 133, 244, 0.1);
  color: var(--ecosystem-google);
}

.badge--smartthings {
  background: rgba(21, 191, 255, 0.1);
  color: #0099cc;
}

/* Tag */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--tch-light);
  color: var(--tch-text);
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.tag:hover {
  background: var(--tch-primary);
  color: white;
}

.tag svg {
  width: 14px;
  height: 14px;
}

/* Tag Group */
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ==========================================================================
   8. STATS & COUNTERS
   ========================================================================== */

.stat-card {
  text-align: center;
  padding: 32px 24px;
  background: var(--tch-white);
  border-radius: 16px;
  border: 1px solid var(--tch-light);
}

.stat-card__value {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 3rem;
  font-weight: 800;
  color: var(--tch-primary);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-card__label {
  font-size: 0.875rem;
  color: var(--tch-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-card--accent .stat-card__value {
  color: var(--tch-accent);
}

.stat-card--secondary .stat-card__value {
  color: var(--tch-secondary);
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

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

/* ==========================================================================
   9. COMPARISON TABLE
   ========================================================================== */

.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--tch-white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.comparison-table th,
.comparison-table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--tch-light);
}

.comparison-table th {
  background: var(--tch-light);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--tch-dark);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.comparison-table td {
  font-size: 0.9375rem;
  color: var(--tch-text);
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table tr:hover td {
  background: rgba(37, 99, 235, 0.02);
}

.comparison-table__feature {
  font-weight: 600;
  color: var(--tch-dark);
}

.comparison-table__check {
  color: var(--tch-accent);
}

.comparison-table__cross {
  color: #ef4444;
}

/* ==========================================================================
   10. FORMS
   ========================================================================== */

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--tch-dark);
  margin-bottom: 8px;
  font-size: 0.9375rem;
}

.form-label--required::after {
  content: '*';
  color: #ef4444;
  margin-left: 4px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--tch-light);
  border-radius: 12px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--tch-text);
  background: var(--tch-white);
  transition: all 0.2s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--tch-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--tch-muted);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-help {
  font-size: 0.8125rem;
  color: var(--tch-muted);
  margin-top: 6px;
}

.form-error {
  font-size: 0.8125rem;
  color: #ef4444;
  margin-top: 6px;
}

.form-input--error {
  border-color: #ef4444;
}

/* Newsletter Form */
.newsletter-form {
  display: flex;
  gap: 12px;
  max-width: 480px;
}

.newsletter-form .form-input {
  flex: 1;
}

@media (max-width: 480px) {
  .newsletter-form {
    flex-direction: column;
  }

  .newsletter-form .btn {
    width: 100%;
  }
}

/* ==========================================================================
   11. BREADCRUMBS
   ========================================================================== */

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--tch-muted);
  margin-bottom: 24px;
}

.breadcrumbs a {
  color: var(--tch-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumbs a:hover {
  color: var(--tch-primary);
}

.breadcrumbs__separator {
  color: var(--tch-light);
}

.breadcrumbs__current {
  color: var(--tch-text);
  font-weight: 500;
}

/* ==========================================================================
   12. PAGINATION
   ========================================================================== */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
}

.pagination__item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  font-weight: 500;
  color: var(--tch-text);
  text-decoration: none;
  background: var(--tch-white);
  border: 1px solid var(--tch-light);
  transition: all 0.2s ease;
}

.pagination__item:hover {
  border-color: var(--tch-primary);
  color: var(--tch-primary);
}

.pagination__item--active {
  background: var(--tch-primary);
  border-color: var(--tch-primary);
  color: white;
}

.pagination__item--disabled {
  opacity: 0.5;
  pointer-events: none;
}

.pagination__ellipsis {
  color: var(--tch-muted);
  padding: 0 8px;
}

/* ==========================================================================
   13. LOADING STATES
   ========================================================================== */

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

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

.skeleton--text {
  height: 1em;
  margin-bottom: 0.5em;
}

.skeleton--title {
  height: 1.5em;
  width: 60%;
  margin-bottom: 1em;
}

.skeleton--image {
  aspect-ratio: 16/9;
}

.skeleton--avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--tch-light);
  border-top-color: var(--tch-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner--sm {
  width: 24px;
  height: 24px;
  border-width: 2px;
}

.spinner--lg {
  width: 56px;
  height: 56px;
  border-width: 4px;
}

/* ==========================================================================
   14. TOOLTIPS
   ========================================================================== */

[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::before,
[data-tooltip]::after {
  position: absolute;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  z-index: 100;
}

[data-tooltip]::before {
  content: attr(data-tooltip);
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 12px;
  background: var(--tch-dark);
  color: white;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  border-radius: 8px;
}

[data-tooltip]::after {
  content: '';
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--tch-dark);
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   15. TESTIMONIALS
   ========================================================================== */

.testimonial-card {
  background: var(--tch-white);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.testimonial-card__quote {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--tch-text);
  margin-bottom: 24px;
  position: relative;
  padding-left: 24px;
}

.testimonial-card__quote::before {
  content: '"';
  position: absolute;
  left: 0;
  top: -8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 3rem;
  font-weight: 800;
  color: var(--tch-primary);
  opacity: 0.3;
  line-height: 1;
}

.testimonial-card__author {
  display: flex;
  align-items: center;
  gap: 16px;
}

.testimonial-card__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

.testimonial-card__name {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  color: var(--tch-dark);
  margin-bottom: 4px;
}

.testimonial-card__role {
  font-size: 0.875rem;
  color: var(--tch-muted);
}

.testimonial-card__rating {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}

.testimonial-card__rating svg {
  width: 20px;
  height: 20px;
  color: #fbbf24;
}

/* ==========================================================================
   16. FEATURE LIST
   ========================================================================== */

.feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-list__item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--tch-light);
}

.feature-list__item:last-child {
  border-bottom: none;
}

.feature-list__icon {
  width: 40px;
  height: 40px;
  background: rgba(37, 99, 235, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--tch-primary);
}

.feature-list__icon svg {
  width: 20px;
  height: 20px;
}

.feature-list__title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  color: var(--tch-dark);
  margin-bottom: 4px;
}

.feature-list__description {
  font-size: 0.9375rem;
  color: var(--tch-muted);
  line-height: 1.5;
}

/* ==========================================================================
   17. ACCORDION / FAQ
   ========================================================================== */

.accordion {
  border: 1px solid var(--tch-light);
  border-radius: 16px;
  overflow: hidden;
}

.accordion__item {
  border-bottom: 1px solid var(--tch-light);
}

.accordion__item:last-child {
  border-bottom: none;
}

.accordion__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 20px 24px;
  background: var(--tch-white);
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--tch-dark);
  transition: background 0.2s ease;
}

.accordion__header:hover {
  background: var(--tch-light);
}

.accordion__icon {
  width: 24px;
  height: 24px;
  color: var(--tch-muted);
  transition: transform 0.3s ease;
}

.accordion__item.is-open .accordion__icon {
  transform: rotate(180deg);
}

.accordion__content {
  padding: 0 24px 20px;
  color: var(--tch-text);
  line-height: 1.6;
}

/* ==========================================================================
   18. TABS
   ========================================================================== */

.tabs {
  margin-bottom: 32px;
}

.tabs__list {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid var(--tch-light);
  padding-bottom: 0;
  margin-bottom: 24px;
  overflow-x: auto;
}

.tabs__tab {
  padding: 12px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--tch-muted);
  position: relative;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.tabs__tab::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--tch-primary);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.tabs__tab:hover {
  color: var(--tch-dark);
}

.tabs__tab.is-active {
  color: var(--tch-primary);
}

.tabs__tab.is-active::after {
  transform: scaleX(1);
}

.tabs__panel {
  display: none;
}

.tabs__panel.is-active {
  display: block;
}

/* ==========================================================================
   19. MODAL
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--tch-white);
  border-radius: 20px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.95);
  transition: transform 0.3s ease;
}

.modal-overlay.is-open .modal {
  transform: translateY(0) scale(1);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0;
}

.modal__title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--tch-dark);
}

.modal__close {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: none;
  background: var(--tch-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.modal__close:hover {
  background: var(--tch-primary);
  color: white;
}

.modal__body {
  padding: 24px;
}

.modal__footer {
  padding: 0 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ==========================================================================
   20. UTILITY CLASSES
   ========================================================================== */

/* Pulse Animation */
.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, var(--tch-primary) 0%, var(--tch-accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.container--narrow {
  max-width: 800px;
}

.container--wide {
  max-width: 1536px;
}

/* Section Spacing */
.section {
  padding: 80px 0;
}

.section--sm {
  padding: 48px 0;
}

.section--lg {
  padding: 120px 0;
}

/* Background Variants */
.bg-light {
  background-color: var(--tch-light);
}

.bg-dark {
  background-color: var(--tch-dark);
  color: var(--tch-white);
}

.bg-gradient {
  background: linear-gradient(135deg, var(--tch-primary) 0%, var(--tch-accent) 100%);
  color: var(--tch-white);
}

/* Text Alignment */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

/* Visibility */
.sr-only,
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   21. READING PROGRESS BAR
   ========================================================================== */

.tch-reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  z-index: 9999;
}

.tch-reading-progress__bar {
  height: 100%;
  background: linear-gradient(90deg, var(--tch-primary) 0%, var(--tch-accent) 100%);
  width: 0;
  transition: width 0.1s ease-out;
}

/* ==========================================================================
   22. COPY CODE BUTTON
   ========================================================================== */

.tch-copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.2s ease;
}

pre:hover .tch-copy-btn {
  opacity: 1;
}

.tch-copy-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

.tch-copy-btn.is-copied {
  background: var(--tch-accent);
  border-color: var(--tch-accent);
  color: white;
}

/* ==========================================================================
   23. ANIMATION UTILITIES
   ========================================================================== */

[data-animate] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].is-animated {
  opacity: 1;
  transform: translateY(0);
}

[data-animate="fade-up"] {
  transform: translateY(30px);
}

[data-animate="fade-down"] {
  transform: translateY(-30px);
}

[data-animate="fade-left"] {
  transform: translateX(30px);
}

[data-animate="fade-right"] {
  transform: translateX(-30px);
}

[data-animate="zoom-in"] {
  transform: scale(0.9);
}

[data-animate="zoom-out"] {
  transform: scale(1.1);
}

/* Staggered animations */
[data-animate-delay="100"] { transition-delay: 0.1s; }
[data-animate-delay="200"] { transition-delay: 0.2s; }
[data-animate-delay="300"] { transition-delay: 0.3s; }
[data-animate-delay="400"] { transition-delay: 0.4s; }
[data-animate-delay="500"] { transition-delay: 0.5s; }

/* Body loaded state */
.tch-loaded [data-animate] {
  /* Allow animations only after page load */
}
