/* ========================================
   REUSABLE COMPONENTS
   Consistent UI elements across all pages
   ======================================== */

/* ========================================
   SKIP LINKS (Accessibility)
   ======================================== */

.skip-links {
  position: absolute;
  top: -100px;
  left: 0;
  z-index: 9999;
  width: 100%;
  background: #4338ca;
  padding: 1rem;
  text-align: center;
}

.skip-links:focus-within {
  top: 0;
}

.skip-link {
  color: white;
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  display: inline-block;
  margin: 0 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0.25rem;
}

.skip-link:focus {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* ========================================
   UNIFIED CHIP/TAG STYLES
   ======================================== */

.chip,
.tag-chip,
.category-chip,
[class*="chip"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: all 0.2s ease;
  text-decoration: none;
  border: 1px solid transparent;
}

/* Default chip style */
.chip {
  background: rgba(99, 102, 241, 0.1);
  color: #4338ca;
  border-color: rgba(99, 102, 241, 0.2);
}

.chip:hover {
  background: rgba(99, 102, 241, 0.15);
  transform: translateY(-1px);
}

/* Category-specific chip colors */
.chip--tech,
.category-chip--tech {
  background: rgba(16, 185, 129, 0.1);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.2);
}

.chip--tech:hover,
.category-chip--tech:hover {
  background: rgba(16, 185, 129, 0.15);
}

.chip--finance,
.category-chip--finance {
  background: rgba(245, 158, 11, 0.1);
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.2);
}

.chip--finance:hover,
.category-chip--finance:hover {
  background: rgba(245, 158, 11, 0.15);
}

.chip--travel,
.category-chip--travel {
  background: rgba(239, 68, 68, 0.1);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.2);
}

.chip--travel:hover,
.category-chip--travel:hover {
  background: rgba(239, 68, 68, 0.15);
}

.chip--mind,
.category-chip--mind {
  background: rgba(139, 92, 246, 0.1);
  color: #5b21b6;
  border-color: rgba(139, 92, 246, 0.2);
}

.chip--mind:hover,
.category-chip--mind:hover {
  background: rgba(139, 92, 246, 0.15);
}

/* Tag chips (hashtag style) */
.tag-chip {
  background: transparent;
  color: #6366f1;
  border: none;
  padding: 0.125rem 0.25rem;
  font-size: 0.85rem;
}

.tag-chip:hover {
  color: #4338ca;
}

/* Active chip state */
.chip.is-active,
button.chip.is-active {
  background: #4338ca;
  color: white;
  border-color: #4338ca;
}

.chip.is-active:hover {
  background: #3730a3;
  border-color: #3730a3;
}

/* ========================================
   UNIFIED BUTTON STYLES
   ======================================== */

.btn-primary,
.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, #4338ca, #3730a3);
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(67, 56, 202, 0.2);
}

.btn-primary:hover,
.cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(67, 56, 202, 0.3);
  background: linear-gradient(135deg, #3730a3, #312e81);
  color: white;
}

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

/* Secondary button */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: white;
  color: #4338ca;
  border: 2px solid #4338ca;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: #4338ca;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(67, 56, 202, 0.2);
}

/* Ghost button */
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: rgba(99, 102, 241, 0.08);
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-ghost:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
  color: #4338ca;
}

/* Small button variant */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* Icon in button */
.btn-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ========================================
   CARD STYLES
   ======================================== */

.card-unified {
  padding: 1.5rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 1rem;
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.card-unified:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  border-color: rgba(99, 102, 241, 0.2);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.card-body {
  flex: 1;
}

.card-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* ========================================
   FILTER BUTTONS
   ======================================== */

.filter-button {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: white;
  color: #1f2937;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.filter-button:hover {
  border-color: #4338ca;
  background: rgba(67, 56, 202, 0.05);
}

.filter-button.is-active {
  background: #4338ca;
  color: white;
  border-color: #4338ca;
}

.filter-button:focus {
  outline: 2px solid #4338ca;
  outline-offset: 2px;
}

/* ========================================
   META INFORMATION
   ======================================== */

.meta-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: #6b7280;
  flex-wrap: wrap;
}

.meta-divider {
  color: #d1d5db;
}

.meta-time {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* ========================================
   ACCESSIBILITY HELPERS
   ======================================== */

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

.sr-only-focusable:focus {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .chip,
  .btn-primary,
  .btn-secondary,
  .btn-ghost {
    border-width: 2px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .chip,
  .btn-primary,
  .btn-secondary,
  .btn-ghost,
  .card-unified,
  .filter-button {
    transition: none;
  }
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

@media (max-width: 768px) {
  .btn-primary,
  .btn-secondary,
  .btn-ghost,
  .cta-button {
    width: 100%;
    justify-content: center;
  }

  .meta-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .meta-divider {
    display: none;
  }
}
