/* ===== Theme tokens (UPDATED) ===== */
:root {
  --bg: #fbfcfd;
  --surface: rgba(255,255,255,0.66);
  --muted-surface: rgba(247,250,253,0.65);
  --accent: #2563eb;        /* homepage-blue */
  --accent-2: #1e40af;
  --muted: #667085;
  --text: #0b1220;
  --glass-border: rgba(15,23,42,0.06);
  --card-shadow: 0 10px 30px rgba(15,23,42,0.06);
  --soft-shadow: 0 6px 20px rgba(15,23,42,0.04);
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --container-w: 1200px;
  --glass-blur: 10px;
  --elevate: translateY(-6px);
}

/* ===== Base Reset & Layout (UPDATED) ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Poppins', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: linear-gradient(180deg, #f7f9fb 0%, var(--bg) 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.45;
  padding: 28px 18px;
  /* Original body flex properties are removed in favor of the new main-container margin */
}

/* Replaced #container / .dashboard-container with new structure */
.main-container {
  width: 100%;
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* center content area for smaller dashboards */
.logo-and-tagline {
  text-align: center;
  margin-bottom: 6px;
}

/* logo (UPDATED) */
.logo {
  width: 80px;
  height: 80px;
  border-radius: 14px;
  display: inline-block;
  object-fit: cover;
  box-shadow: 0 8px 30px rgba(37,99,235,0.09);
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  /* Original logo styles are overwritten */
}

/* tagline typography */
.tagline {
  margin-top: 8px;
  color: var(--muted);
  font-weight: 500;
  font-size: 1rem;
}

/* dashboard title */
.dashboard-title {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin: 8px 0 18px;
}

/* ===== Horizontal Scrolling Grid (UPDATED) ===== */
.business-grid {
  display: flex; /* Change from grid to flex */
  flex-direction: row;
  gap: 20px;
  width: 100%;
  overflow-x: auto; /* Enable horizontal scroll */
  padding: 20px 10px; /* Add padding so shadows aren't clipped */
  scroll-snap-type: x mandatory; /* Makes cards 'snap' into place */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Hide scrollbar but keep functionality (Optional) */
.business-grid::-webkit-scrollbar {
  height: 6px;
}
.business-grid::-webkit-scrollbar-thumb {
  background: rgba(37, 99, 235, 0.2);
  border-radius: 10px;
}

/* card base: Adjusted for Horizontal Layout */
.business-card {
  flex: 0 0 300px; /* Do not shrink, do not grow, stay 300px wide */
  scroll-snap-align: start; /* Alignment for the snap */
  
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255,255,255,0.7), rgba(250,250,251,0.74));
  border: 1px solid var(--glass-border);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(var(--glass-blur));
  transition: transform .18s cubic-bezier(.2,.9,.3,1), box-shadow .18s ease;
  cursor: pointer;
  min-height: 220px; /* Increased slightly for better proportions */
}

/* If there are only a few cards, center them instead of left-aligning */
.business-grid:has(> :nth-child(1):last-child),
.business-grid:has(> :nth-child(2):last-child) {
  justify-content: center;
}



/* hover / focus — subtle lift */
.business-card:hover,
.business-card:focus-within {
  transform: var(--elevate);
  box-shadow: 0 18px 40px rgba(14,18,28,0.10);
  border-color: rgba(37,99,235,0.08);
  z-index: 2;
  outline: none;
}

/* status badge */
.status-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
  letter-spacing: 0.4px;
  background: rgba(255,255,255,0.5);
  color: var(--muted);
  border: 1px solid rgba(12,18,35,0.04);
  backdrop-filter: blur(6px);
}
.auth-container{
  display:none;
}
/* live state */
.status-live {
  background: linear-gradient(180deg, rgba(226,246,236,1), rgba(226,246,236,0.8));
  color: #0b9b46;
  border: 1px solid rgba(40,160,80,0.12);
}

/* content inside card */
.card-content h3 {
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.14;
  font-weight: 700;
}

.card-content p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0;
}

/* card actions — align and style CTA */
.card-actions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  width: 100%;
}

/* link style: homepage blue pill */
.card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(37,99,235,0.12);
  transition: transform .14s ease, box-shadow .14s ease, opacity .14s ease;
}

.card-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(37,99,235,0.16);
  opacity: 0.98;
}

/* secondary link (light) */
.card-link.muted,
.card-link.secondary {
  background: transparent;
  border: 1px solid rgba(37,99,235,0.10);
  color: var(--accent);
  box-shadow: none;
}

/* ===== Primary Launch CTA (big button) (UPDATED) ===== */
.launch-button {
  width: 100%;
  max-width: 420px;
  padding: 16px 22px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #fff;
  border: none;
  border-radius: 12px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.2px;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(37,99,235,0.14);
  transition: transform .14s ease, box-shadow .14s ease;
  margin: 14px auto 0; /* Adjusted margin to fit new layout flow */
}

/* keep hover / active subtle */
.launch-button:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 48px rgba(37,99,235,0.18);
}
.launch-button:active {
  transform: translateY(-1px);
}

/* General Modal Reset/Centering */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.9); /* Lighter background like the UI */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    font-family: 'Google Sans', Roboto, sans-serif;
}

.modal-content {
    background: transparent;
    width: 100%;
    max-width: 600px;
    padding: 20px;
    position: relative;
    text-align: center;
    border: none;
    box-shadow: none;
}

/* Close Button Position */
.close-button {
    position: absolute;
    top: 0px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #5f6368;
}

/* The "Build your ideas..." Header */
.gemini-heading {
    font-size: 44px;
    font-weight: 400;
    color: #1f1f1f;
    margin-bottom: 40px;
    line-height: 1.2;
}

/* The Main Container Box */
.gemini-box {
    background: #fff;
    border-radius: 28px;
    /* The subtle blueish border */
    border: 1px solid #dce5f3; 
    /* The soft shadow */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); 
    padding: 16px 20px 10px 20px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.gemini-box:focus-within {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    border-color: #c0d4f1;
}

/* Input Area */
.input-area textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: none;
    font-size: 18px;
    font-family: inherit;
    color: #1f1f1f;
    min-height: 60px; /* Adjust based on preference */
    background: transparent;
}

.input-area textarea::placeholder {
    color: #5f6368;
}

/* Toolbar Layout */
.gemini-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Icons */
.icon-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444746;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: #f0f4f9;
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

.settings-btn {
    border: 1px solid #e0e3e7; /* Visual circle border for settings */
    width: 40px;
    height: 40px;
}

.sparkle-btn svg {
    width: 24px;
    height: 24px;
}

/* Build Button */
.build-btn {
    background: #fff; /* White bg */
    border: 1px solid #e0e3e7;
    border-radius: 20px;
    padding: 10px 24px;
    font-size: 16px;
    color: #9aa0a6; /* Disabled look color initially */
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.2s;
    margin-left: 8px;
}

.build-btn:hover {
    background: #f8f9fa;
    color: #1f1f1f;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Optional: Make button look active if user types */
#prompt:valid ~ .gemini-toolbar .build-btn {
    background: #0b57d0; /* Google Blue */
    color: white;
    border-color: #0b57d0;
}

/* ===== Loading overlay / iframe (UPDATED) ===== */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(247,250,255,0.6), rgba(250,250,251,0.7));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  padding: 20px;
}

#loading-overlay iframe,
#loader-iframe {
  width: 100%;
  max-width: 900px;
  height: calc(100vh - 60px);
  border-radius: 20px;
  border: none;
  box-shadow: 0 18px 60px rgba(10,14,28,0.18);
}

/* ===== Small utilities (muted text, spacing) (RETAINED) ===== */
.muted {
  color: var(--muted);
}
.spaced {
  margin-top: 12px;
}

/* ===== Accessibility focus rings (RETAINED) ===== */
a:focus, button:focus, input:focus, textarea:focus {
  outline: 3px solid rgba(37,99,235,0.12);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ===== Footer (RETAINED/ADJUSTED) ===== */
#site-footer {
  width: 100%;
  overflow-x: hidden;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  background: #fff;
  padding: 24px;
  box-shadow: 0 -4px 20px rgba(15,23,42,0.04);
  margin-top: auto;
  border-top: 1px solid var(--glass-border);
}
#site-footer * {
  max-width: 100%;
}

.buy-token-btn {
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  background: #222;
  color: white;
  font-weight: 600;
  cursor: pointer;
  margin-left: 10px;
}

.buy-token-btn:hover {
  background: #000;
}

/* ===== Responsive adjustments (UPDATED) ===== */
@media (max-width: 1060px) {
  .main-container {
    padding: 18px;
  }
  .modal-content {
    max-width: 680px;
    padding: 22px;
  }
}

@media (max-width: 820px) {
  body {
    padding: 18px;
  }
  .dashboard-title {
    font-size: 1.9rem;
  }
  .business-card {
    padding: 18px;
    min-height: 150px;
  }
  .card-content h3 {
    font-size: 1.08rem;
  }
  #prompt_container h2 {
    font-size: 1.28rem;
  }
  .launch-button {
    max-width: 100%;
    padding: 14px;
  }
}

@media (max-width: 420px) {
  .dashboard-title {
    font-size: 1.6rem;
    margin-bottom: 10px;
  }
  .logo {
    width: 64px;
    height: 64px;
    border-radius: 12px;
  }
  .business-card {
    padding: 14px;
    border-radius: 12px;
    flex: 0 0 85%; /* Shows 85% of one card and a peek of the next one */
  }
  .card-actions {
    flex-direction: column;
    gap: 8px;
  }
  .card-link {
    width: 100%;
    justify-content: center;
  }
  .launch-button {
    width: 100%;
  }
}

/* ===== Minor polish: small animation for badge pop (RETAINED) ===== */
@keyframes pop {
  0% {
    transform: scale(.92);
    opacity: .6
  }
  60% {
    transform: scale(1.04);
    opacity: 1
  }
  100% {
    transform: scale(1);
    opacity: 1
  }
}
.status-badge {
  animation: pop .45s cubic-bezier(.2,.9,.3,1) both;
}
