/* ===== REUSABLE COMPONENTS ===== */
/* BEM methodology component library for Onyx Mail */

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--btn-padding);
  min-height: var(--btn-height);
  font-family: inherit;
  font-size: var(--font-base);
  font-weight: var(--font-weight-medium);
  line-height: 1;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  user-select: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* Primary button with gradient */
.btn--primary {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
}

.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-purple);
}

/* Secondary button with purple border */
.btn--secondary {
  background: transparent;
  color: var(--color-primary);
  border-color: rgba(var(--color-primary-rgb), 0.3);
}

.btn--secondary:hover {
  background: rgba(var(--color-primary-rgb), 0.1);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Ghost button */
.btn--ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: transparent;
}

.btn--ghost:hover {
  background: var(--bg-card);
  color: var(--color-text-primary);
}

/* Button sizes */
.btn--sm {
  padding: var(--space-xs) var(--space-md);
  min-height: 36px;
  font-size: var(--font-sm);
}

.btn--lg {
  padding: var(--space-md) var(--space-xl);
  min-height: 52px;
  font-size: var(--font-lg);
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: var(--border-dark-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-base);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(var(--color-primary-rgb), 0.2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Terminal-style card */
.card--terminal {
  background: var(--color-dark-base);
  border: var(--border-purple-subtle);
  font-family: var(--font-mono);
  position: relative;
}

.card--terminal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-subtle);
  opacity: 0.3;
}

/* Feature card */
.card--feature {
  text-align: center;
  padding: var(--space-2xl);
}

.card--feature:hover {
  border-color: rgba(var(--color-primary-rgb), 0.3);
}

/* Card with gradient border */
.card--gradient-border {
  position: relative;
  background: var(--bg-card);
  border: none;
}

.card--gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1px;
  background: var(--gradient-primary);
  border-radius: inherit;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: xor;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
}

/* ===== TEXT EFFECTS ===== */
.text--gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  /* Fallback for browsers that don't support background-clip */
  color: var(--color-primary);
}

.text--mono {
  font-family: var(--font-mono);
  color: var(--color-text-mono);
  font-size: var(--font-sm);
}

.text--glow {
  color: var(--color-primary);
  text-shadow: 0 0 10px rgba(var(--color-primary-rgb), 0.5);
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--font-xs);
  font-weight: var(--font-weight-medium);
  background: var(--bg-purple-subtle);
  color: var(--color-primary);
  border: var(--border-purple-subtle);
  border-radius: var(--radius-sm);
}

.badge--success {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.2);
}

.badge--warning {
  background: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.2);
}

.badge--error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}

/* ===== NAVIGATION ===== */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.nav__logo {
  display: block;
}

.nav__menu {
  display: flex;
  align-items: center;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  list-style: none;
}

.nav__link {
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
  transition: color var(--transition-base);
  position: relative;
}

.nav__link:hover,
.nav__link--active {
  color: var(--color-primary);
}

.nav__link--active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
}

.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 3px;
  padding: var(--space-xs);
  background: transparent;
  border: none;
  cursor: pointer;
}



/* ===== MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}

.modal.active {
  display: flex;
}

.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.modal__content {
  position: relative;
  background: var(--color-dark-secondary);
  border: var(--border-purple-subtle);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: var(--border-dark-subtle);
}

.modal__title {
  margin: 0;
  color: var(--color-text-primary);
}

.modal__close {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: var(--font-xl);
  cursor: pointer;
  padding: var(--space-xs);
  transition: color var(--transition-base);
}

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

.modal__body {
  padding: var(--space-lg);
}

/* ===== FORM COMPONENTS ===== */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-label {
  display: block;
  margin-bottom: var(--space-sm);
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
}

.form-input {
  width: 100%;
  height: var(--input-height);
  padding: var(--input-padding);
  background: var(--bg-card);
  border: var(--border-dark);
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  transition: all var(--transition-base);
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

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

/* ===== STATS GRID ===== */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-xl);
}

.stat {
  text-align: center;
  padding: var(--space-lg);
}

.stat__number {
  display: block;
  font-size: var(--font-3xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.stat__label {
  color: var(--color-text-secondary);
  font-size: var(--font-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== HERO COMPONENT ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: var(--color-dark-base);
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero__title {
  margin-bottom: var(--space-lg);
}

.hero__subtitle {
  font-size: var(--font-lg);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-2xl);
  line-height: var(--line-height-relaxed);
}

.hero__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

@media (min-width: 640px) {
  .hero__actions {
    flex-direction: row;
    justify-content: center;
  }
}

/* Hero background effects */
.hero__grid-pattern {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(var(--color-primary-rgb), 0.01) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--color-primary-rgb), 0.01) 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: 0.3;
}

.hero__scan-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-subtle);
  animation: scan 8s linear infinite;
}

@keyframes scan {
  0% { transform: translateY(0); }
  100% { transform: translateY(100vh); }
}

.hero__timestamp {
  font-family: var(--font-mono);
  color: var(--color-text-muted);
  font-size: var(--font-xs);
  margin-bottom: var(--space-2xl);
  opacity: 0.6;
}

.hero__title-main {
  color: var(--color-text-primary);
  font-size: var(--font-5xl);
  font-weight: var(--font-weight-light);
  margin-bottom: var(--space-lg);
  letter-spacing: 0.1em;
  line-height: var(--line-height-tight);
}

.hero__title-accent {
  font-weight: var(--font-weight-normal);
}

.hero__description {
  color: var(--color-text-secondary);
  font-size: var(--font-lg);
  line-height: var(--line-height-relaxed);
  max-width: 600px;
  margin: 0 auto var(--space-2xl);
}

.hero__redacted {
  color: var(--color-text-muted);
}

.hero__footer-text {
  color: var(--color-text-muted);
  font-size: var(--font-sm);
  font-family: var(--font-mono);
  margin-bottom: var(--space-2xl);
}

.hero__stats {
  margin-top: var(--space-4xl);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== TERMINAL COMPONENT ===== */
.terminal {
  background: var(--color-dark-base);
  border: var(--border-purple-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  font-family: var(--font-mono);
  font-size: var(--font-sm);
  color: var(--color-text-mono);
  position: relative;
  overflow: hidden;
}

.terminal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-subtle);
  opacity: 0.3;
}

.terminal__line {
  margin-bottom: var(--space-xs);
  animation: fadeInUp 0.3s ease-out;
}

.terminal__prompt {
  color: var(--color-primary);
}

.terminal__timestamp {
  color: var(--color-text-muted);
  opacity: 0.6;
}

/* ===== ABOUT PAGE COMPONENTS ===== */
.about-hero {
  background: linear-gradient(180deg, var(--color-dark-base) 0%, var(--color-dark-base) 100%);
  padding: 120px 0 80px;
  position: relative;
  overflow: hidden;
}

.about-hero__title {
  color: var(--color-text-primary);
  font-size: var(--font-4xl);
  font-weight: var(--font-weight-light);
  margin-bottom: var(--space-lg);
  letter-spacing: 0.05em;
  line-height: var(--line-height-tight);
}

.about-hero__subtitle {
  color: var(--color-text-secondary);
  font-size: var(--font-xl);
  line-height: var(--line-height-relaxed);
  max-width: 700px;
  margin: 0 auto;
}

.about-section {
  padding: var(--space-4xl) 0;
  background: var(--bg-base);
}

.about-section__header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.about-section__title {
  color: var(--color-text-primary);
  font-size: var(--font-4xl);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-md);
}

.about-section__subtitle {
  color: var(--color-text-muted);
  font-size: var(--font-base);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.about-card {
  background: var(--color-dark-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 0;
  position: relative;
  overflow: hidden;
  padding: var(--space-2xl);
}

.about-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, transparent 0%, var(--color-secondary) 50%, transparent 100%);
  opacity: 0.5;
}

/* ===== SECTION COMPONENTS ===== */
.section-features {
  padding: var(--space-4xl) 0;
  background: var(--bg-base);
  border-top: 1px solid rgba(var(--color-primary-rgb), 0.05);
}

.section-features__header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.section-features__subtitle {
  color: var(--color-text-muted);
  font-size: var(--font-sm);
  font-family: var(--font-mono);
  margin-bottom: var(--space-md);
}

.section-features__title {
  color: var(--color-text-primary);
  font-size: var(--font-4xl);
  font-weight: var(--font-weight-light);
  letter-spacing: 0.05em;
}

/* ===== FEATURE CARD VARIANTS ===== */
.feature-card {
  background: var(--color-dark-secondary);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: var(--space-xl);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}

.feature-card:hover {
  border-color: rgba(var(--color-primary-rgb), 0.3);
  transform: translateY(-2px);
}

.feature-card--with-accent {
  position: relative;
}

.feature-card--with-accent::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, var(--color-primary), transparent);
  opacity: 0.3;
}

.feature-card__icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.feature-card__header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.feature-card__title {
  color: var(--color-text-primary);
  font-size: var(--font-lg);
  font-weight: var(--font-weight-medium);
  margin: 0;
}

.feature-card__description {
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  margin-bottom: var(--space-lg);
}

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

.feature-card__list-item {
  color: var(--color-text-secondary);
  font-size: var(--font-sm);
  margin-bottom: var(--space-xs);
  position: relative;
  padding-left: var(--space-md);
  line-height: var(--line-height-relaxed);
}

.feature-card__list-item::before {
  content: '→';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--color-primary);
}

.feature-card__toggle {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid rgba(var(--color-primary-rgb), 0.2);
  padding: var(--space-xs) var(--space-md);
  font-size: var(--font-sm);
  font-weight: var(--font-weight-medium);
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  cursor: pointer;
  transition: all var(--transition-base);
  border-radius: var(--radius-sm);
}

.feature-card__toggle:hover {
  background: rgba(var(--color-primary-rgb), 0.1);
  border-color: var(--color-primary);
}

.feature-card__toggle-arrow {
  transition: transform var(--transition-base);
}

.feature-card__toggle[aria-expanded="true"] .feature-card__toggle-arrow {
  transform: rotate(180deg);
}

.feature-card__expandable {
  display: none;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-card__expandable.active {
  display: block;
  animation: fadeInUp 0.3s ease-out;
}