/**
 * TelegramPage - Arkham-style Telegram integration page
 * Uses design system tokens
 */

.telegram-page {
  min-height: 100vh;
  overflow-x: hidden;
}

/* Loading State */
.telegram-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  gap: var(--space-3);
  color: var(--intel-text-muted);
}

.telegram-loading__spinner {
  width: 32px;
  height: 32px;
  border: 2px solid var(--intel-border-subtle);
  border-top-color: var(--intel-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ─────────────────────────────────────────────────────────────
   HERO SECTION
   ───────────────────────────────────────────────────────────── */

.telegram-hero {
  position: relative;
  min-height: 50vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--space-6);
  overflow: hidden;
}

.telegram-hero__grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(var(--intel-border-subtle) 1px, transparent 1px),
    linear-gradient(90deg, var(--intel-border-subtle) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.3;
  mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 40%, transparent 100%);
}

.telegram-hero__content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  text-align: center;
}

.telegram-hero__icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--intel-cyan-bg);
  border: 1px solid rgba(0, 255, 136, 0.2);
  border-radius: var(--radius-xl);
  margin: 0 auto var(--space-4);
  color: var(--intel-cyan);
}

.telegram-hero__title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: var(--weight-bold);
  color: var(--intel-text-primary);
  line-height: var(--leading-tight);
  margin: var(--space-4) 0;
  letter-spacing: var(--tracking-tight);
}

.telegram-hero__title-accent {
  color: var(--intel-cyan);
}

.telegram-hero__subtitle {
  font-size: var(--text-md);
  color: var(--intel-text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 550px;
  margin: 0 auto;
}

/* ─────────────────────────────────────────────────────────────
   SECTIONS
   ───────────────────────────────────────────────────────────── */

.telegram-section {
  padding: var(--space-12) var(--space-6);
}

.telegram-section--alt {
  background: var(--intel-bg-surface);
}

.telegram-section__container {
  max-width: 800px;
  margin: 0 auto;
}

/* ─────────────────────────────────────────────────────────────
   SETUP STEPS
   ───────────────────────────────────────────────────────────── */

.telegram-setup {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.telegram-step {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-5);
  transition: all var(--transition-fast);
}

.telegram-step:hover {
  border-color: var(--intel-border-strong);
}

.telegram-step--completed {
  border-color: rgba(0, 255, 136, 0.3);
  background: rgba(0, 255, 136, 0.03);
}

.telegram-step--completed:hover {
  border-color: rgba(0, 255, 136, 0.5);
}

.telegram-step__number {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--intel-cyan-bg);
  border: 1px solid rgba(0, 255, 136, 0.2);
  border-radius: var(--radius-lg);
  color: var(--intel-cyan);
  font-weight: var(--weight-bold);
  font-size: var(--text-md);
  flex-shrink: 0;
}

.telegram-step--completed .telegram-step__number {
  background: rgba(0, 255, 136, 0.15);
  border-color: rgba(0, 255, 136, 0.3);
  color: var(--intel-green);
}

.telegram-step__content {
  flex: 1;
}

.telegram-step__content h3 {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--intel-text-primary);
  margin: 0 0 var(--space-2);
}

.telegram-step__content p {
  font-size: var(--text-sm);
  color: var(--intel-text-secondary);
  line-height: var(--leading-relaxed);
  margin: 0;
}

.telegram-step__content code {
  background: var(--intel-bg-hover);
  padding: var(--space-0-5) var(--space-1);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--intel-cyan);
}

.telegram-disabled {
  color: var(--intel-text-muted);
  font-style: italic;
}

/* Wallet Connected State */
.telegram-wallet-connected {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.telegram-wallet-address {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--intel-text-primary);
  background: var(--intel-bg-hover);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
}

/* Buttons */
.telegram-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2-5) var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-decoration: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
  margin-top: var(--space-3);
}

.telegram-btn--primary {
  background: var(--intel-cyan);
  color: var(--intel-bg-deep);
}

.telegram-btn--primary:hover {
  background: var(--intel-cyan-bright);
  box-shadow: var(--glow-green);
}

.telegram-btn--secondary {
  background: var(--intel-bg-surface);
  color: var(--intel-text-primary);
  border: 1px solid var(--intel-border-default);
}

.telegram-btn--secondary:hover {
  background: var(--intel-bg-hover);
  border-color: var(--intel-border-strong);
}

.telegram-btn--secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.telegram-btn--lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-md);
}

/* Code Display */
.telegram-code {
  margin-top: var(--space-4);
  text-align: center;
}

.telegram-code__value {
  display: inline-block;
  padding: var(--space-3) var(--space-6);
  background: var(--intel-cyan-bg);
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: var(--radius-lg);
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: var(--weight-bold);
  color: var(--intel-cyan);
  letter-spacing: 0.2em;
}

.telegram-code__note {
  display: block;
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--intel-text-muted);
}

/* Error */
.telegram-error {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--intel-red-bg);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--intel-red);
}

/* ─────────────────────────────────────────────────────────────
   CONNECTED STATE
   ───────────────────────────────────────────────────────────── */

.telegram-connected {
  text-align: center;
  padding: var(--space-8);
  background: rgba(0, 255, 136, 0.03);
  border: 1px solid rgba(0, 255, 136, 0.15);
  border-radius: var(--radius-xl);
}

.telegram-connected__icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 255, 136, 0.15);
  border-radius: 50%;
  margin: 0 auto var(--space-4);
  font-size: var(--text-2xl);
  color: var(--intel-green);
}

.telegram-connected h2 {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--intel-text-primary);
  margin: 0 0 var(--space-2);
}

.telegram-connected > p {
  font-size: var(--text-sm);
  color: var(--intel-text-secondary);
  margin: 0 0 var(--space-6);
}

/* Bot Commands */
.telegram-commands {
  text-align: left;
  margin-bottom: var(--space-6);
}

.telegram-commands h3 {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--intel-text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  margin: 0 0 var(--space-3);
}

.telegram-commands__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
}

.telegram-command {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--intel-bg-surface);
  border-radius: var(--radius-md);
}

.telegram-command code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--intel-cyan);
}

.telegram-command span {
  font-size: var(--text-sm);
  color: var(--intel-text-secondary);
}

/* ─────────────────────────────────────────────────────────────
   FEATURES SECTION
   ───────────────────────────────────────────────────────────── */

.telegram-features__header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.telegram-features__header h2 {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--intel-text-primary);
  margin: var(--space-3) 0 0;
}

.telegram-features__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.telegram-feature {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-5);
}

.telegram-feature__icon {
  font-size: var(--text-xl);
  flex-shrink: 0;
}

.telegram-feature h4 {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  color: var(--intel-text-primary);
  margin: 0 0 var(--space-1);
}

.telegram-feature p {
  font-size: var(--text-sm);
  color: var(--intel-text-secondary);
  margin: 0;
}

/* ─────────────────────────────────────────────────────────────
   PLANS SECTION
   ───────────────────────────────────────────────────────────── */

.telegram-plans__header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.telegram-plans__header h2 {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--intel-text-primary);
  margin: var(--space-3) 0 0;
}

.telegram-plans__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.telegram-plan {
  position: relative;
  padding: var(--space-6);
  text-align: center;
  transition: all var(--transition-fast);
}

.telegram-plan:hover {
  border-color: var(--intel-border-strong);
}

.telegram-plan--featured {
  border-color: rgba(0, 255, 136, 0.3);
  background: rgba(0, 255, 136, 0.03);
}

.telegram-plan--featured:hover {
  border-color: rgba(0, 255, 136, 0.5);
}

.telegram-plan__badge {
  position: absolute;
  top: calc(-1 * var(--space-2));
  left: 50%;
  transform: translateX(-50%);
}

.telegram-plan__name {
  font-size: var(--text-sm);
  color: var(--intel-text-secondary);
  margin-bottom: var(--space-2);
}

.telegram-plan__count {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--intel-text-primary);
}

.telegram-plan--featured .telegram-plan__count {
  color: var(--intel-cyan);
}

.telegram-plan__label {
  font-size: var(--text-sm);
  color: var(--intel-text-muted);
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────────────────────── */

@media (max-width: 767px) {
  .telegram-hero {
    min-height: auto;
    padding: var(--space-12) var(--space-4);
  }

  .telegram-section {
    padding: var(--space-10) var(--space-4);
  }

  .telegram-step {
    flex-direction: column;
    gap: var(--space-3);
  }

  .telegram-commands__grid,
  .telegram-features__grid {
    grid-template-columns: 1fr;
  }

  .telegram-plans__grid {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .telegram-plan--featured {
    order: -1;
  }
}

@media (max-width: 480px) {
  .telegram-hero__title {
    font-size: var(--text-2xl);
  }

  .telegram-code__value {
    font-size: var(--text-xl);
    padding: var(--space-2) var(--space-4);
  }
}
