html {
  height: -webkit-fill-available;
}

:root {
  --bg: #0b0b0a;
  --text: #fff;
  --muted: #b0b0b0;
  --gold: #e2b049;
  --card: #141414;
  --border: #2a2a2a;
  --ok: #2ea043;
  --bad: #d12f2f;
}

* { box-sizing: border-box; }




html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  min-width: 375px;
  /* REMOVE THESE PADDING LINES */
  /* padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left); */
  /* padding-right: env(safe-area-inset-right); padding-bottom: env(safe-area-inset-bottom); */
  overflow-x: hidden;
}

a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Find this rule in assets/styles.css */
.container { 
    width: 100%; 
    max-width: 1200px; 
    margin: 0 auto; 
    padding: 16px;
    /* Add default bottom padding for safe areas */
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
.logo-sm { width: 100px; height: 100px; object-fit: contain; }

/* IN: styles.css */

/* --- AND CHANGE THIS --- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  /* Modify the padding here */
  padding: 8px 16px;
  padding-top: calc(8px + env(safe-area-inset-top));
  padding-left: calc(16px + env(safe-area-inset-left));
  padding-right: calc(16px + env(safe-area-inset-right));
  /* End of modification */
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: rgba(11, 11, 10, 0.8);
  backdrop-filter: blur(8px); z-index: 10;
}

.topbar .brand-title { font-weight: 700; margin-left: 8px; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 8px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { color: var(--muted); font-size: 14px; }
input, select {
  width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 8px;
  background: #000; color: var(--text); transition: border-color 0.2s;
}
input:focus, select:focus { outline: none; border-color: var(--gold); }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: #222; color: var(--text); cursor: pointer; transition: filter 0.2s; white-space: nowrap;
}
.btn:hover { filter: brightness(1.2); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-outline { background: transparent; }
.btn-gold { background: var(--gold); color: #000; border-color: #a5851e; font-weight: 700; }
.btn-sm { padding: 6px 10px; font-size: 13px; font-weight: 500; }

/*
==============================================
  >>> PUBLIC PAGE STYLES START HERE <<<
==============================================
*/

/* --- Auth Pages (Login, Register) --- */
/* Find this rule in assets/styles.css */
.container.auth {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh; /* Use 100vh */
  padding: 20px; /* Reset padding */
  /* Re-apply specific bottom padding for this container */
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
}


.container.auth .brand {
  display: flex;
  flex-direction: column; 
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.container.auth .brand .logo {
  width: 100px;
  height: 100px;
}

.container.auth .brand h1 {
  font-size: 2rem;
  font-weight: 600;
  margin: 0;
}

.container.auth .card {
  width: 100%;
  max-width: 400px;
  padding: 24px;
}

.container.auth .card .field {
  margin-bottom: 16px;
}

.container.auth .card .btn {
  margin-top: 8px;
}

.container.auth > .muted.center {
  margin-top: 24px;
}

/* --- Public Index Page --- */
.brand.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 32px;
  text-align: center;
}

.brand.center .logo {
  width: 120px;
  height: 120px;
  margin-bottom: 16px;
}

.brand.center h1 {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 800;
}

/* Generic alert boxes for errors/messages */
.alert {
  width: 100%;
  max-width: 400px; /* Match the form card width */
  padding: 12px;
  margin-bottom: 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  text-align: center;
}
.alert-error {
  background-color: rgba(209, 47, 47, 0.2);
  border-color: var(--bad);
  color: #f7baba;
}
.alert-ok {
  background-color: rgba(46, 160, 67, 0.2);
  border-color: var(--ok);
  color: #b1e5bb;
}

/* Utility classes */
.w-100 {
  width: 100%;
}
.center {
  text-align: center;
}

/*
==============================================
  >>> PUBLIC PAGE STYLES END HERE <<<
==============================================
*/

.chip { padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; display: inline-block; }
.chip-ok { background: var(--ok); color: #fff; }
.chip-bad { background: var(--bad); color: #fff; }


/* NEW DESKTOP GRID LAYOUT */
.results-grid { display: none; } /* Hidden by default, shown on desktop */
.token-grid-row {
    padding: 8px; /* Tighter padding */
    border-bottom: 1px solid var(--border);
}
.token-grid-row:last-child { border-bottom: none; }
.grid-row-top, .grid-row-bottom { display: flex; align-items: center; gap: 16px; }
.grid-row-top { margin-bottom: 8px; }

.grid-token-info {
    display: flex;
    align-items: center;
    flex: 2;
    min-width: 200px;
}
.grid-stats-primary, .grid-stats-secondary { display: flex; flex: 3; gap: 16px; }
.grid-changes { flex: 2; }
.grid-pass {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
.grid-actions { margin-left: auto; }

.stat { display: flex; flex-direction: column; min-width: 90px; }
.stat .label { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.stat .value { font-size: 14px; font-weight: 600; }

.lp-stat {
    min-width: 90px;
    margin-left: 64px;
    text-align: left;
}

.token-cell { display: flex; align-items: center; gap: 12px; }
.token-icon { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--border); background-color: #1c1c1c; object-fit: cover; }
.token-name-group { display: flex; flex-direction: column; }
.token-name { font-weight: 600; font-size: 15px; }
.token-symbol { font-size: 12px; color: var(--muted); }

.price-changes-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; }
.price-change { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 4px; border-radius: 4px; background-color: rgba(40,40,40,0.7); }
.price-change-label { font-size: 9px; color: var(--muted); text-transform: uppercase; }
.price-change-value { font-size: 13px; font-weight: 600; }
.price-change-value.positive { color: var(--ok); }
.price-change-value.negative { color: var(--bad); }
.price-change-value.neutral { color: var(--muted); }

/* ===== NEW STYLES FOR LP INDICATOR ===== */
.lp-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 14px;
}
.lp-indicator svg {
    width: 16px;
    height: 16px;
}
.lp-indicator.is-locked {
    color: var(--ok);
}
.lp-indicator.is-unlocked {
    color: var(--bad);
}
.lp-indicator-neutral {
    color: var(--muted);
    font-weight: 600;
}
/* ===== END NEW STYLES ===== */


.flash-up { animation: flash-green 0.7s ease-out; }
.flash-down { animation: flash-red 0.7s ease-out; }
@keyframes flash-green { 0% { color: var(--ok); text-shadow: 0 0 5px var(--ok); } 100% { color: var(--text); text-shadow: none; } }
@keyframes flash-red { 0% { color: var(--bad); text-shadow: 0 0 5px var(--bad); } 100% { color: var(--text); text-shadow: none; } }

.loader-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px); z-index: 100; display: none; align-items: center; justify-content: center;}
.spinner { width: 50px; height: 50px; border: 5px solid var(--border); border-top-color: var(--gold); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Main page controls wrapper - reduced spacing */
.controls-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 0; /* Use padding instead of min-height */
  margin-bottom: 16px;
}


.control-group { display: flex; align-items: center; gap: 12px; }
.input-with-icon { position: relative; flex-grow: 1; }
.input-with-icon .input-icon { position: absolute; top: 50%; left: 14px; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); transition: color 0.2s; }
.input-with-icon input { padding-left: 44px; }
.input-with-icon:focus-within .input-icon { color: var(--gold); }
.scan-status { text-align: center; width: 100%; min-height: 1.2em; }
.filters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.filters-footer { display: flex; justify-content: flex-end; align-items: center; margin-top: 16px; gap: 12px; }

.btn-icon { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; background: none; border: 1px solid transparent; border-radius: 8px; color: var(--muted); cursor: pointer; transition: all 0.2s; }
.btn-icon:hover { color: var(--text); background: rgba(255, 255, 255, 0.1); }
.btn-icon svg { width: 20px; height: 20px; }
.btn-icon.is-saved, .btn-icon.is-copied { color: var(--gold); border-color: var(--gold); background-color: rgba(226, 176, 73, 0.1); }
.btn-icon:disabled { opacity: 0.5; cursor: not-allowed; filter: grayscale(1); }

/* MOBILE CARD LIST */
.card-list { display: block; }
.token-card { 
  border: 1px solid var(--border); 
  border-radius: 10px; 
  margin-bottom: 8px; /* Tighter margin */
  padding: 10px; 
  background: var(--card); 
}
.token-card.passed { border-left: 3px solid var(--ok); }
.token-card.failed { border-left: 3px solid var(--bad); }
.card-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.card-header-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.card-actions { display: flex; gap: 8px; }
.card-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; font-size: 12px; margin-bottom: 10px; }
.stat.full-width { grid-column: 1 / -1; }

@media (min-width: 1101px) {
  .card-list { display: none; }
  .results-grid { display: block; }
}

@media (max-width: 1100px) {
  .topbar .brand-title { display: none; }
  .topbar { background: var(--bg); backdrop-filter: none; }
  input, select, textarea, button { font-size: 16px; }
}

/* --- Burger Menu and Modal Styles --- */
.side-nav {
  height: 100%;
  width: 250px;
  position: fixed;
  z-index: 101;
  top: 0;
  left: -250px;
  background-color: var(--bg);
  overflow-x: hidden;
  transition: 0.3s ease-out;
  padding-top: calc(60px + env(safe-area-inset-top));
  border-right: 1px solid var(--border);
}


.side-nav a {
  padding: 12px 16px;
  text-decoration: none;
  font-size: 18px;
  color: var(--muted);
  display: block;
  transition: 0.2s;
}

.side-nav a:hover {
  color: var(--gold);
  background-color: rgba(255,255,255,0.05);
}

.side-nav .close-btn {
  position: absolute;
  top: calc(8px + env(safe-area-inset-top));
  right: 15px;
  font-size: 36px;
  margin-left: 50px;
}


.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.6);
  z-index: 100;
  display: none;
  transition: opacity 0.3s;
}

.modal {
  display: none;
  position: fixed;
  z-index: 102;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}
.modal.is-open {
  display: flex;
}

.modal-content {
  background-color: var(--card);
  margin: auto;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 90%;
  max-width: 600px;
  position: relative;
}
.modal-content h2 {
  margin-top: 0;
  margin-bottom: 20px;
}
.close-modal-btn {
  color: var(--muted);
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
}
.close-modal-btn:hover,
.close-modal-btn:focus {
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
#singleCaModal .input-group-ca {
  display: flex;
  gap: 12px;
  width: 100%;
}
#singleCaModal .input-with-icon {
  flex-grow: 1;
}

/* User page formatting */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}
.row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.card > .row:last-child {
    border-bottom: none;
}
.row .inline {
    display: flex;
    gap: 8px;
}
.tag {
    display: inline-block;
    padding: 2px 6px;
    font-size: 11px;
    background-color: var(--border);
    border-radius: 4px;
    text-transform: capitalize;
    vertical-align: middle;
    margin-left: 4px;
}
.small {
    font-size: 12px;
}


.card h2 {
  font-size: 18px;       /* Makes the font smaller (down from 24px) */
  margin-top: 0;         /* Removes the space above the heading */
  margin-bottom: 8px;   /* Reduces the space below the heading */
}


/* === WATCHLIST CONTROLS === */
.watchlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; /* Allows controls to stack on very small screens */
  gap: 16px;
  margin-bottom: 16px;
}

.watchlist-controls {
  display: flex;
  gap: 12px;
  flex-grow: 1; /* Allows this group to take available space */
  min-width: 250px; /* Helps with wrapping behavior */
}

.watchlist-controls input, 
.watchlist-controls select {
  flex: 1; /* Makes each control share the space */
  padding: 8px 12px;
  font-size: 14px;
}

/* Give the search bar more space if possible */
.watchlist-controls input {
  flex-grow: 2;
}


.pagination-controls {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}



/* === MODAL ADDITIONS === */

/* Makes the confirmation modal narrower */
.modal-content.confirm-modal {
  max-width: 400px;
}

/* Removes default top margin from the modal's h3 title */
.modal-content h3 {
  margin-top: 0;
}

/* Styles the 'Yes'/'No' button container */
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* MOBILE-SPECIFIC WATCHLIST CONTROLS */
@media (max-width: 480px) {
  .watchlist-controls {
    gap: 8px;
    flex-wrap: wrap; /* Ensure items can wrap */
  }

.watchlist-controls input, 
.watchlist-controls select {
  font-size: 13px;
  padding: 8px;
  height: 38px; /* This forces them to be the same height */
}

  
  /* Make the search input take the full top row */
  .watchlist-controls input[type="search"] {
    flex-basis: 100%;
  }
}

