/**
 * Claudezilla Support Page Styles
 * Adapted from extension/support.css for website
 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --terracotta: #D14D32;
  --terracotta-dark: #b83e28;
  --terracotta-glow: rgba(209, 77, 50, 0.4);
  --bg-dark: #0a0a0a;
  --bg-card: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #aaaaaa;
  --grid-color: rgba(209, 77, 50, 0.08);
}

body {
  font-family: 'Space Mono', monospace;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  position: relative;
}

/* Animated grid background */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 0;
  animation: gridPulse 20s ease-in-out infinite;
}

@keyframes gridPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

/* Navigation */
.main-nav {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-logo {
  font-family: 'Orbitron', sans-serif;
  font-size: 24px;
  font-weight: 900;
  color: var(--terracotta);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: -1px;
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-links a {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s;
  font-weight: 700;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--terracotta);
}

/* Nav Install Button */
.nav-install {
  background: linear-gradient(135deg, #b83e28 0%, #D14D32 50%, #FCD34D 100%);
  color: var(--bg-dark) !important;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 700;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 12px var(--terracotta-glow);
}

.nav-install:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--terracotta-glow);
  color: var(--bg-dark) !important;
}

/* Nav GitHub Button */
.nav-github {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-github:hover {
  background: #333;
  border-color: var(--terracotta);
  transform: translateY(-1px);
}

.nav-github svg {
  width: 20px;
  height: 20px;
  fill: var(--text-secondary);
  transition: fill 0.3s;
}

.nav-github:hover svg {
  fill: var(--text-primary);
}

.container {
  position: relative;
  z-index: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 32px 40px;
}

.support-card {
  background: var(--bg-card);
  border: 2px solid rgba(209, 77, 50, 0.3);
  border-radius: 12px;
  padding: 40px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto auto auto auto auto auto;
  gap: 16px;
  column-gap: 60px;
  align-items: start;
}

h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 32px;
  font-weight: 900;
  margin-bottom: 8px;
  color: var(--terracotta);
  grid-column: 1 / -1;
  grid-row: 1;
}

.subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 0;
  grid-column: 1 / -1;
  grid-row: 2;
}

label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
}

/* Amount Label */
.amount-label {
  grid-column: 1;
  grid-row: 3;
}

/* Amount Pills */
.suggested-amounts {
  grid-column: 1;
  grid-row: 4;
  display: flex;
  gap: 12px;
}

.amount-pill {
  flex: 1;
  padding: 14px 12px;
  background: transparent;
  border: 2px solid var(--text-secondary);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Space Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.amount-pill:hover {
  border-color: var(--terracotta);
}

.amount-pill.active {
  background: rgba(209, 77, 50, 0.2);
  border-color: var(--terracotta);
  color: var(--terracotta);
}

.custom-amount {
  grid-column: 1;
  grid-row: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #000;
  border: 1px solid var(--text-secondary);
  border-radius: 8px;
  padding: 14px 16px;
  height: 52px;
}

.currency {
  font-size: 20px;
  color: var(--text-secondary);
  font-weight: 700;
}

#customAmount {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: 'Space Mono', monospace;
  font-size: 20px;
  outline: none;
}

#customAmount::placeholder {
  color: #444;
}

/* Frequency Toggle */
.frequency-toggle {
  grid-column: 1;
  grid-row: 6;
  display: flex;
  gap: 12px;
}

.frequency-btn {
  flex: 1;
  padding: 14px 12px;
  background: transparent;
  border: 2px solid var(--text-secondary);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.frequency-btn:hover {
  border-color: var(--terracotta);
}

.frequency-btn.active {
  background: rgba(209, 77, 50, 0.2);
  border-color: var(--terracotta);
  color: var(--terracotta);
}

/* Submit Button */
.submit-btn {
  grid-column: 2;
  grid-row: 4;
  width: 100%;
  padding: 0;
  background: linear-gradient(135deg, #b83e28 0%, #D14D32 50%, #FCD34D 100%);
  border: none;
  border-radius: 8px;
  color: #000;
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  cursor: pointer;
  transition: all 0.3s;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.submit-btn:hover {
  box-shadow: 0 0 20px var(--terracotta-glow);
  transform: translateY(-1px);
}

.stripe-note {
  grid-column: 2;
  grid-row: 5;
  text-align: center;
  font-size: 11px;
  color: var(--text-secondary);
  margin: 0;
}

/* Error Message */
.error-message {
  background: rgba(239, 68, 68, 0.15);
  border: 2px solid #EF4444;
  border-radius: 8px;
  padding: 16px;
  color: #EF4444;
  font-size: 14px;
  text-align: center;
}

/* Loading Overlay */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 100;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(209, 77, 50, 0.2);
  border-top-color: var(--terracotta);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-overlay p {
  color: var(--text-primary);
  font-size: 14px;
}

/* Divider */
.divider {
  display: none;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--text-secondary);
  opacity: 0.3;
}

.divider span {
  padding: 0 16px;
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 1.5px;
  font-weight: 700;
}

.crypto-btn {
  grid-column: 2;
  grid-row: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0;
  background: linear-gradient(135deg, #9945FF 0%, #14F195 100%);
  border: none;
  border-radius: 8px;
  color: #000;
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
  height: 52px;
}

.crypto-btn:hover {
  box-shadow: 0 0 20px rgba(153, 69, 255, 0.4);
  transform: translateY(-1px);
}

.crypto-note {
  grid-column: 2;
  grid-row: 7;
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  margin: 0;
}

/* Back Link */
.back-link {
  text-align: center;
  margin-top: 16px;
}

.back-link a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s;
}

.back-link a:hover {
  color: var(--terracotta);
}

/* Thank You Modal */
.thanks-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.thanks-content {
  background: var(--bg-card);
  border: 2px solid var(--terracotta);
  border-radius: 16px;
  padding: 48px 64px;
  text-align: center;
  box-shadow: 0 0 40px var(--terracotta-glow), 0 0 80px rgba(209, 77, 50, 0.2);
  animation: glowPulse 2s ease-in-out infinite;
}

.thanks-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 16px;
}

.thanks-content h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 32px;
  font-weight: 900;
  color: var(--terracotta);
  margin-bottom: 8px;
}

.thanks-content p {
  font-size: 16px;
  color: var(--text-secondary);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 40px var(--terracotta-glow), 0 0 80px rgba(209, 77, 50, 0.2); }
  50% { box-shadow: 0 0 60px var(--terracotta-glow), 0 0 100px rgba(209, 77, 50, 0.3); }
}

.thanks-modal.fade-out {
  animation: fadeOut 0.5s ease forwards;
}

/* Responsive */
@media (max-width: 900px) {
  .main-nav {
    flex-direction: column;
    gap: 16px;
  }

  .nav-links {
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
  }
}

/* Revert to single column on tablets */
@media (max-width: 768px) {
  .support-card {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 24px;
  }

  h1,
  .subtitle,
  .amount-label,
  .suggested-amounts,
  .custom-amount,
  .frequency-toggle,
  .submit-btn,
  .stripe-note,
  .crypto-btn,
  .crypto-note {
    grid-column: 1;
    grid-row: auto;
  }
}

@media (max-width: 600px) {
  /* Container full-width on mobile (remove wasted horizontal margins) */
  .container {
    padding: 32px 16px 40px; /* Reduce from 32px 32px 40px */
  }

  /* Support card padding reduction */
  .support-card {
    padding: 24px 20px; /* Reduce from 32px 24px */
  }

  h1 {
    font-size: 28px;
  }

  .suggested-amounts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .amount-pill {
    padding: 14px;
    font-size: 18px;
  }

  /* Thanks modal mobile scaling */
  .thanks-content {
    padding: 32px 24px; /* Reduce from 48px 64px */
    border-radius: 12px; /* Reduce from 16px */
  }

  .thanks-content h2 {
    font-size: 24px; /* Reduce from 32px */
  }

  .thanks-content p {
    font-size: 14px; /* Reduce from 16px */
  }

  .thanks-icon {
    width: 48px;
    height: 48px;
  }
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
