/* updown.website — custom styles (extend Bootstrap here) */

/* ── Layout: zoom-out friendly ────────────────────────────────────── */
html { min-width: 320px; }
body { min-height: 100vh; display: flex; flex-direction: column; }
main.container { flex: 1; }

/* Navbar & footer stretch full-width at all zoom levels */
.navbar { width: 100%; z-index: 1050; position: relative; }
footer.site-footer {
  width: 100%;
  background: var(--bs-body-bg);
  border-top: var(--bs-border-width) solid var(--bs-border-color) !important;
}
footer.site-footer small { white-space: nowrap; font-size: 0.78rem; }

/* At very wide viewports (zoomed out), keep content readable */
@media (min-width: 1800px) {
  .container { max-width: 1600px; }
}

/* ── Glassmorphism: frosted cards over floating domains ───────────── */
.glass-card,
.zerog-page .card {
  background: rgba(24, 27, 35, 0.65) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
}
.zerog-page .card .card-footer {
  background: rgba(30, 33, 48, 0.5) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.zerog-page .card .card-header {
  background: rgba(30, 33, 48, 0.6) !important;
}
/* Navbar on zerog pages */
.zerog-page .navbar {
  background: rgba(33, 37, 41, 0.7) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
/* Footer on zerog pages */
.zerog-page footer.site-footer {
  background: rgba(15, 17, 23, 0.7) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
/* Input/search bar */
.zerog-page .input-group .form-control,
.zerog-page .input-group .input-group-text {
  background: rgba(24, 27, 35, 0.6) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ── Auto-style allauth form inputs ──────────────────────────────
   allauth renders bare <input>/<select>/<textarea> without classes.
   These rules apply Bootstrap form-control styling globally within
   card forms so every auth page looks consistent.                   */

.card input[type="text"],
.card input[type="email"],
.card input[type="password"],
.card input[type="url"],
.card input[type="number"],
.card input[type="tel"],
.card input[type="search"],
.card select,
.card textarea {
  display: block;
  width: 100%;
  padding: .375rem .75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  appearance: none;
  color: var(--bs-body-color);
  background-color: var(--bs-body-bg);
  background-clip: padding-box;
  border: var(--bs-border-width) solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.card input[type="text"]:focus,
.card input[type="email"]:focus,
.card input[type="password"]:focus,
.card input[type="url"]:focus,
.card input[type="number"]:focus,
.card input[type="tel"]:focus,
.card input[type="search"]:focus,
.card select:focus,
.card textarea:focus {
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
}

/* Checkbox — styled inline with label */
.check-inline {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.check-inline input[type="checkbox"] {
  width: 1.15em;
  height: 1.15em;
  margin: 0;
  flex-shrink: 0;
  appearance: auto;
}
.check-inline label {
  margin: 0;
  font-size: .9rem;
  cursor: pointer;
}

/* Hidden inputs should stay hidden */
.card input[type="hidden"] {
  display: none !important;
}

/* ── SSO / Social Login Buttons ──────────────────────────────────── */

.btn-sso {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .6rem 1rem;
  font-size: .95rem;
  font-weight: 500;
  border-radius: var(--bs-border-radius);
  transition: all .15s ease-in-out;
  text-decoration: none;
}

.btn-sso-google {
  background-color: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
}
.btn-sso-google:hover,
.btn-sso-google:focus {
  background-color: #f7f8f8;
  color: #3c4043;
  border-color: #c6c9cc;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

.btn-sso-microsoft {
  background-color: #2f2f2f;
  color: #fff;
  border: 1px solid #505050;
}
.btn-sso-microsoft:hover,
.btn-sso-microsoft:focus {
  background-color: #3a3a3a;
  color: #fff;
  border-color: #666;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.btn-sso-saml {
  background-color: #1a5276;
  color: #fff;
  border: 1px solid #2e86c1;
}
.btn-sso-saml:hover,
.btn-sso-saml:focus {
  background-color: #21618c;
  color: #fff;
  border-color: #3498db;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

/* ── Auth Divider ("or") ─────────────────────────────────────────── */

.auth-divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: 1.25rem 0;
  color: var(--bs-secondary-color);
  font-size: .85rem;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--bs-border-color);
}

/* ── Mobile / Responsive ─────────────────────────────────────────── */

/* Scrollable nav tabs on narrow screens */
.nav-tabs-mobile {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-tabs-mobile::-webkit-scrollbar { display: none; }
.nav-tabs-mobile .nav-link { white-space: nowrap; }

/* Sticky tabs on mobile — icon-only, evenly spaced */
@media (max-width: 767.98px) {
  .nav-tabs-mobile {
    position: sticky;
    top: 0;
    z-index: 1020;
    background: var(--bs-body-bg);
    border-bottom: 1px solid var(--bs-border-color);
    padding-top: .25rem;
    margin-left: -.75rem;
    margin-right: -.75rem;
    padding-left: 0;
    padding-right: 0;
    flex-wrap: nowrap;
    justify-content: center;
  }
  .nav-tabs-mobile .nav-item {
    flex: 1 1 0;
    text-align: center;
  }
  .nav-tabs-mobile .nav-link {
    padding: .5rem .25rem;
    font-size: 1.1rem;
    width: 100%;
  }
}

@media (max-width: 767.98px) {
  /* Prevent horizontal scrollbar — clip on body only (html clip breaks sticky) */
  body { overflow-x: clip; }
  main.container, main.container-fluid { max-width: 100vw; }

  /* Tighter container padding */
  .container { padding-left: .75rem; padding-right: .75rem; }

  /* Smaller headings */
  h1, .h1 { font-size: 1.5rem; }
  h2, .h2 { font-size: 1.25rem; }
  h3, .h3 { font-size: 1.1rem; }

  /* Stat cards: allow wrapping, smaller min-width */
  .stat-card-row { gap: .5rem !important; flex-wrap: wrap !important; }
  .stat-card-row .card { min-width: 0 !important; flex: 1 1 calc(50% - .5rem); max-width: calc(50% - .25rem); }
  .stat-card-row .card .h4 { font-size: 1.1rem; }

  /* Chart containers: slightly shorter on mobile */
  .chart-container-sm { height: 120px !important; }
  .chart-container-md { height: 140px !important; }

  /* Cards: allow horizontal scroll for wide content */
  .card { max-width: 100%; }
  .card-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Tables: compact on mobile — let table-responsive handle overflow */
  .card-body > table,
  .card-body > .table,
  .table-responsive > table { font-size: .78rem; }
  .table th, .table td { white-space: nowrap; }
  .table td .text-break { word-break: break-all; white-space: normal; }

  /* Code blocks: wrap long URLs (but not inside tables — those scroll) */
  code, .badge-code { word-break: break-all !important; white-space: pre-wrap !important; font-size: .68rem; }
  .table code { word-break: normal !important; white-space: nowrap !important; }

  /* Two-column .row inside cards → stack on mobile */
  .card .row.g-0 > .col-md-6 { flex: 0 0 100%; max-width: 100%; }

  /* Security header value column: don't set a wide max-width */
  .table .text-truncate { max-width: 45vw !important; overflow: hidden; text-overflow: ellipsis; }

  /* Badge embed table: hide HTML column, show only Markdown */
  .badge-embed-table th:nth-child(3),
  .badge-embed-table td:nth-child(3) { display: none; }
  .badge-embed-table th:first-child { width: 50px !important; }
  .badge-embed-table code { font-size: .6rem; }

  /* Grid layout: single column, prevent children from overflowing */
  #site-layout { min-width: 0; }
  #site-layout > * { min-width: 0; }

  /* Footer chat: cap height on mobile */
  #fc-panel { max-height: 50vh !important; }

  /* Badge embed table: stack on mobile */
  .badge-embed-table th,
  .badge-embed-table td { font-size: .7rem; padding: .25rem !important; }

  /* Uptime bar slightly taller for touch */
  .uptime-bar { height: 12px; }

  /* Navbar brand smaller */
  .navbar-brand { font-size: .95rem; }

  /* Pre blocks: prevent overflow */
  pre { white-space: pre-wrap; word-break: break-all; max-width: 100%; }
}

/* ── Passkey button on login ─────────────────────────────────────── */

.btn-passkey {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .5rem 1rem;
  font-size: .9rem;
  background-color: transparent;
  color: var(--bs-body-color);
  border: 1px dashed var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  text-decoration: none;
  transition: all .15s ease-in-out;
}
.btn-passkey:hover,
.btn-passkey:focus {
  background-color: var(--bs-tertiary-bg);
  color: var(--bs-body-color);
  border-style: solid;
}
