/* Global Styles */
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #0b0d12;
  color: #f4f4f4;
  line-height: 1.6;
}

.container {
  width: 90%;
  max-width: 1100px;
  margin: auto;
  padding: 2rem 0;
}

h1, h2, h3 {
  color: #ffffff;
}

/* Header */
.header {
  background: linear-gradient(to right, #0b0d12, #151925);
  padding: 3rem 0;
}

/* Flex Layout for Logo + Heading */
.header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4rem;
  text-align: left;
  padding: 0 4rem;
}

.logo-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.heading-text {
  flex: 1;
}

.autody-logo {
  flex: 1;
  max-width: 400px;
  width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(93, 95, 239, 0.4));
  transition: transform 0.3s ease;
}

.autody-logo:hover {
  transform: scale(1.05);
}

.heading-text h1 {
  margin: 0;
  font-size: 3rem;
}

.heading-text p {
  margin-top: 0.75rem;
  font-size: 1.2rem;
  color: #ccc;
}

.header .cta-buttons {
  margin-top: 1.5rem;
}

.btn {
  background-color: #5d5fef;
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  margin-right: 1rem;
  transition: background-color 0.3s ease;
}

.btn:hover {
  background-color: #4345ce;
}

.btn.secondary {
  background-color: #2e2f3b;
  color: #ccc;
}

.btn.secondary:hover {
  background-color: #3b3d4e;
}

/* Responsive */
@media (max-width: 768px) {
  .header-flex {
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
    padding: 0 1.5rem;
  }

  .logo-heading {
    flex-direction: column-reverse;
    align-items: center;
    gap: 2rem;
  }

  .autody-logo {
    max-width: 220px;
    margin-bottom: 1rem;
  }

  .heading-text h1 {
    font-size: 2rem;
  }

  .heading-text p {
    font-size: 1rem;
  }
}

.auto-chart-container {
  background-color: #1c1f2b;
  padding: 2rem;
  border-radius: 12px;
  margin-top: 2rem;
}

.chart-container {
  width: 100%;
  height: 500px; /* Adjust height as needed */
}

#geckoterminal-embed {
  width: 100%;
  height: 100%;
  border: none;
}

/* Sections */
.about, .how-to-buy, .token-info {
  background-color: #12151c;
  padding: 3rem 0;
  border-top: 1px solid #1e212a;
}

.token-data p {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.status-boxes {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.status-item {
  flex: 1 1 30%;
  background-color: #1c1f2b;
  margin: 0.5rem;
  padding: 1rem;
  border-radius: 10px;
  text-align: center;
}

.chart-box {
  margin-top: 2rem;
  background-color: #1c1f2b;
  padding: 1rem;
  border-radius: 10px;
}

/* Buy Steps */
.how-to-buy ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.how-to-buy li {
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

/* Footer */
.footer {
  text-align: center;
  padding: 2rem 0;
  background-color: #0a0c10;
  border-top: 1px solid #1e212a;
  color: #777;
  font-size: 0.9rem;
}

/* Overlay background */
.popup-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  display: none; /* hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: opacity 0.3s ease;
}

/* Popup content box */
.popup-content {
  background: #fff;
  padding: 25px;
  border-radius: 12px;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  position: relative;
  animation: popupFadeIn 0.3s ease forwards;
}

/* Close button (X) */
.close-btn {
  position: absolute;
  top: 12px;
  right: 15px;
  font-size: 22px;
  font-weight: bold;
  color: #666;
  cursor: pointer;
}
.close-btn:hover {
  color: #000;
}

/* Buy Card Layout */
.buy-card h2 {
  font-size: 24px;   /* bigger */
  font-weight: 700;
  text-align: center; /* centered */
  margin-bottom: 10px;
  color: #111;
}

.buy-card p {
  font-size: 14px;
  color: #555;
  margin-bottom: 16px;
}

/* Input Groups */
.form-group {
  text-align: left;
  margin-bottom: 12px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: #333;
  display: block;
  margin-bottom: 4px;
}

.buy-card input {
  width: 95%;
  padding: 10px;
  font-size: 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fafafa;
  text-align: right;
}

/* Buttons */
.buy-card button {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  margin-top: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: none;
}

.wallet-btn {
  background: #f7f7f7;
  border: 1px solid #ddd;
  color: #333;
}
.wallet-btn:hover {
  background: #eee;
}

.buy-btn {
  background: #007bff;
  color: #fff;
}
.buy-btn:hover {
  background: #0056b3;
}

/* Secure Note */
.secure {
  font-size: 12px;
  color: #444;
  margin-top: 16px;
  line-height: 1.4;
  text-align: center; /* centralized */
}

/* Fade-in animation */
@keyframes popupFadeIn {
  from { transform: translateY(-30px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* Force dark text inside popup */
.popup-content, 
.popup-content h2,
.popup-content p,
.popup-content label,
.popup-content input,
.popup-content .secure {
  color: #111; /* or #000 for pure black */
}


/* Wallet Step Styles */
#wallet-step {
  text-align: center;
}

.wallet-title {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 8px;
  color: #111;
}

.wallet-sub {
  font-size: 14px;
  color: #444;
  margin-bottom: 20px;
}

.wallet-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wallet-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: background 0.2s ease, border 0.2s ease;
}

.wallet-option:hover {
  background: #f8f8f8;
  border-color: #bbb;
}

.wallet-option img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.gt-tabs{display:flex;gap:.5rem}
.gt-tab{background:#1c1f2b;border:1px solid #2a2f45;color:#ddd;padding:.4rem .7rem;border-radius:8px;cursor:pointer}
.gt-tab.active{background:#5d5fef;color:#fff;border-color:#5d5fef}
.gt-stats{display:grid;grid-template-columns:repeat(5,1fr);gap:.75rem;margin-top:.75rem}
.gt-card{background:#1c1f2b;border:1px solid #2a2f45;border-radius:10px;padding:.8rem}
.gt-k{font-size:.85rem;color:#9aa3b2;margin-bottom:.25rem}
.gt-v{font-weight:700}
@media (max-width:768px){.gt-stats{grid-template-columns:repeat(2,1fr)}}
.gt-tab{display:flex;flex-direction:column;align-items:center;gap:2px}
.gt-pct{font-size:.78rem;opacity:.85}
.gt-more{position:relative}
.gt-menu{position:absolute;right:0;top:110%;background:#1c1f2b;border:1px solid #2a2f45;border-radius:10px;padding:.25rem;min-width:88px;z-index:5}
.gt-menu-item{display:flex;justify-content:space-between;align-items:center;width:100%;padding:.35rem .5rem;border:none;background:transparent;color:#ddd;border-radius:8px;cursor:pointer}
.gt-menu-item:hover{background:#24283a}
.pct-pos{color:#2ecc71}
.pct-neg{color:#e74c3c}

/* =============================
   AUTODY — PREMIUM MOBILE UX
   ============================= */
@media (max-width: 768px) {

  /* ----------------
     SAFE AI-NOTCH PAD
  ------------------*/
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* ----------------
     HERO SECTION
  ------------------*/
  .header {
    padding-top: 2.5rem;
  }

  .heading-text h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
  }

  .heading-text p {
    font-size: 0.95rem;
    opacity: 0.85;
  }

  .autody-logo {
    max-width: 165px;
    margin-bottom: 10px;
  }

  /* ----------------
     HERO BUTTON UX
  ------------------*/
  .cta-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .cta-buttons .btn {
    width: 100%;
    padding: 0.85rem;
    font-size: 0.9rem;
    border-radius: 10px;
  }

  /* ----------------
     SCROLL SMOOTHNESS
  ------------------*/
  html {
    scroll-behavior: smooth;
  }

  /* ----------------
     CHART EMBED FIX
  ------------------*/
  .chart-container {
    height: 300px;
  }

  /* ----------------
     TEXT READABILITY
  ------------------*/
  p {
    font-size: 0.92rem;
    line-height: 1.6;
  }

  h2 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
  }

  /* ----------------
     STATS GRID CLEAN
  ------------------*/
  .gt-stats {
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }

  .gt-card {
    border-radius: 12px;
    padding: 0.75rem;
    background: linear-gradient(145deg, #1c1f2b, #181b26);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.03);
  }

  .gt-v {
    font-size: 0.95rem;
  }

  /* ----------------
     BUTTON INTERACTION
  ------------------*/
  .btn,
  .wallet-option,
  .buy-btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .btn:active {
    transform: scale(0.97);
    opacity: 0.85;
  }

  /* ----------------
     BUY AREA
  ------------------*/
  .how-to-buy .btn {
    width: 100%;
    margin-bottom: 0.8rem;
  }

  /* ----------------
     POPUP RESPONSIVE
  ------------------*/
  .popup-content {
    width: 92%;
    max-width: 360px;
    border-radius: 14px;
    animation: popupFadeIn .25s ease-out forwards;
  }

  .buy-card h2 {
    font-size: 20px;
  }

  /* ----------------
     WALLET LIST HITSIZE
  ------------------*/
  .wallet-option {
    padding: 14px;
    font-size: 15px;
    border-radius: 12px;
  }

  .wallet-option img {
    width: 26px;
    height: 26px;
  }

  /* ----------------
     FOOTER CLEAN
  ------------------*/
  .footer {
    font-size: 0.75rem;
    opacity: 0.75;
  }
}

/* ============================
   FIX OVERFLOWING WALLET ADDR
   ============================ */
@media (max-width: 768px) {

  .how-to-buy li {
    word-break: break-word;
    overflow-wrap: anywhere;
  }

  .how-to-buy {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

/* ============================
   FIX OVERLAPPING BUY BUTTONS
   ============================ */
@media (max-width: 768px) {

  .how-to-buy a.btn {
    display: block;
    width: 100%;
    margin: 0 0 0.75rem 0;
    text-align: center;
  }

  .how-to-buy a.btn:last-child {
    margin-bottom: 0;
  }

  /* Prevent strange overlap behavior */
  .how-to-buy {
    display: block;
  }
}

/* ==================================
   HARD FIX: MOBILE BUTTON OVERFLOW
   ================================== */
@media (max-width: 768px) {

  /* Prevent any sideways scrolling */
  body {
    overflow-x: hidden;
  }

  /* Ensure section never exceeds screen width */
  .how-to-buy,
  .how-to-buy .container {
    width: 100%;
    max-width: 100%;
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
  }

  /* Force buttons to stay inside the viewport */
  .how-to-buy a.btn {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 0 0.8rem 0;
    box-sizing: border-box;
    text-align: center;
  }

  /* Last button no extra spacing */
  .how-to-buy a.btn:last-child {
    margin-bottom: 0;
  }
}

