/* style-tools.css */

/* ============================= */
/* Custom Fonts */
/* ============================= */

@font-face {
  font-family: "Montserrat";
  src: url("../fonts/montserrat-regular-webfont.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Quicksand";
  src: url("../fonts/quicksand-regular-webfont.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ============================= */
/* Base Styles (original) */
/* ============================= */

:root {
  --bg: #0f1724;
  --card: #0b1220;
  --muted: #9aa4b2;
  --accent: #06b6d4;
  --highlight: #7c3aed;
  --glass: rgba(255, 255, 255, 0.03);
  --radius: 14px;
  --maxw: 900px;
  /* font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, Arial;
  color-scheme: dark; */
  font-family: "Montserrat", "Quicksand", Inter, ui-sans-serif, system-ui,
    -apple-system, "Segoe UI", Roboto, Arial;
  color-scheme: dark;
}

body {
  font-family: "Quicksand", Inter, sans-serif;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Montserrat", Inter, sans-serif;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  background: linear-gradient(180deg, #060b12, #070c14);
  color: #e6eef6;
  padding: 24px;
  display: block; /* fix: allow scrolling on mobile */
  min-height: 100%;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    rgba(11, 16, 24, 0.9),
    rgba(8, 12, 18, 0.9)
  );
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.6);
  padding: 24px;
  box-sizing: border-box;
  margin: 0 auto;
}

header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.logo {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--highlight));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #022;
  font-size: 20px;
  cursor: pointer;
  text-decoration: none;
}

h1 {
  margin: 0;
  font-size: 20px;
}

p.lead {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

nav {
  margin-top: 16px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

nav a {
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 14px;
  font-weight: 600;
  transition: 0.3s;
  text-decoration: none;
}

nav a:hover {
  background: linear-gradient(90deg, var(--accent), var(--highlight));
  color: #022;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 18px;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.6);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(2, 6, 23, 0.8);
}

.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.form-row .col {
  flex: 1;
}

label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  background: var(--glass);
  color: inherit;
  font-size: 15px;
  outline: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(90deg, var(--accent), var(--highlight));
  border: none;
  color: #022;
  padding: 10px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  transition: 0.3s;
}

.btn:hover {
  background: linear-gradient(90deg, var(--highlight), var(--accent));
}

.btn.secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.results {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
  width: 100%;
  justify-content: center;
}

.stat {
  flex: 1;
  min-width: 160px;
  background: var(--card);
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(2, 6, 23, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.6);
}

.stat .num {
  font-size: 20px;
  font-weight: 700;
  margin-top: 6px;
}

.stat .lbl {
  font-size: 12px;
  color: var(--muted);
}

.small {
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.ad-placeholder {
  background: linear-gradient(
    120deg,
    rgba(6, 182, 212, 0.05),
    rgba(124, 58, 237, 0.05)
  );
  border: 1px dashed rgba(255, 255, 255, 0.08);
  padding: 16px;
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.ad-small {
  padding: 8px;
}

footer {
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

footer img {
  width: 28px;
  height: 28px;
  vertical-align: middle;
  margin-right: 4px;
}

footer {
  background: rgba(11, 18, 32, 0.6);
  padding: 12px 18px;
  border-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
  margin-top: 40px;
  width: 100%;
}
footer img {
  width: 24px;
  height: 24px;
  vertical-align: middle;
  margin-right: 4px;
}

/* ============================= */
/* Consent Banner (restored + safe tweaks) */
/* ============================= */

#consent-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: #0b1220;
  color: #e6eef6;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.6);
  display: none;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  z-index: 9999;
  font-size: 14px;
  transition: transform 0.4s ease, opacity 0.4s ease;
  /* safety: never grow so tall it covers everything on tiny screens */
  max-height: 40vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* add spacing between text and actions */
#consent-banner > *:not(button):not(a) {
  margin-bottom: 12px; /* breathing room under message */
}

/* group buttons & link neatly */
#consent-banner button,
#consent-banner a {
  margin-top: 6px; /* small spacing from text */
}

/* Optional for mobile screens */
@media (max-width: 600px) {
  #consent-banner > *:not(button):not(a) {
    margin-bottom: 8px;
  }
}

/* visible / hide helpers (keeps your original API) */
#consent-banner.show {
  display: flex;
}
#consent-banner.hide {
  transform: translateY(120%);
  opacity: 0;
}

/* buttons (restored original gradient + styles) */
#consent-banner button {
  background: linear-gradient(90deg, #06b6d4, #7c3aed);
  border: none;
  color: #022;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.3s;
  margin-left: 12px;
}

/* hover flip (keeps your original hover behavior) */
#consent-banner button:hover {
  background: linear-gradient(90deg, #7c3aed, #06b6d4);
}

/* explicit IDs (match your HTML ids to avoid surprises) */
#accept-consent {
  /* your primary accept button */
  /* identical to the generic button above but explicit here for clarity */
  background: linear-gradient(90deg, #06b6d4, #7c3aed);
  color: #022;
}
#accept-consent:hover {
  background: linear-gradient(90deg, #7c3aed, #06b6d4);
}

/* decline button style (matches the inline style you used previously) */
#decline-consent {
  background: #444;
  color: #e6eef6;
  border: none;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.2s;
  margin-left: 8px;
}
#decline-consent:hover {
  background: rgba(255, 255, 255, 0.04);
}

/* link inside the banner */
#consent-banner a {
  color: #06b6d4;
  text-decoration: underline;
  margin-left: 10px;
}

/* small accessibility improvement: visible focus */
#consent-banner button:focus {
  outline: 3px solid rgba(6, 182, 212, 0.16);
  outline-offset: 2px;
}

/* keep your cookie-banner helpers intact */
.cookie-banner {
  opacity: 1;
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
  visibility: visible;
}
.cookie-banner.hide {
  opacity: 0;
  visibility: hidden;
}

/* responsive: stack actions on narrow screens but keep bottom offset */
@media (max-width: 600px) {
  #consent-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
    padding: 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    max-height: 45vh;
  }
  /* ensure buttons align right on mobile */
  #consent-banner > div {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
  }
  /* reduce left margin so buttons fit */
  #consent-banner button {
    margin-left: 0;
  }
}

/* ============================= */
/* Form Input Spacing & Containment Fix */
/* ============================= */

.card form {
  display: flex;
  flex-direction: column;
  gap: 16px; /* adds breathing room between inputs */
  width: 100%;
}

.card form label {
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--muted);
}

.card form input,
.card form select,
.card form textarea {
  width: 100%;
  box-sizing: border-box; /* prevents overflow bleeding */
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #e6eef6;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* subtle hover + focus for polish */
.card form input:focus,
.card form select:focus,
.card form textarea:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.3);
}

/* desktop-specific breathing room */
@media (min-width: 992px) {
  .card form {
    gap: 20px; /* even more spacing on large screens */
  }
  .card {
    padding: 24px; /* extra padding so inputs never touch card edges */
  }
}

/* ============================= */
/* Responsive Media Queries */
/* ============================= */

/* Medium tablets & small laptops (≤1024px) */
@media (max-width: 1024px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: wrap;
    text-align: left;
  }
  header .logo {
    flex-shrink: 0;
  }
  header h1 {
    font-size: clamp(16px, 3vw, 22px);
  }
  header p.lead {
    font-size: clamp(12px, 2.5vw, 14px);
  }
  nav {
    margin-top: 8px;
  }
}

/* Small devices (≤768px) */
@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .sidebar {
    order: 2;
  }
  .form-row {
    flex-direction: column;
    gap: 10px;
  }
  .results {
    flex-direction: column;
    align-items: stretch;
  }
  .stat {
    width: 100%;
    min-width: unset;
  }
  footer {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
}

/* Ultra-small phones (≤480px) */
@media (max-width: 480px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }
  header .logo {
    width: 48px;
    height: 48px;
    font-size: 18px;
  }
  nav {
    flex-direction: row; /* keep side by side */
    flex-wrap: wrap; /* wrap neatly */
    justify-content: center;
    gap: 8px;
    width: 100%;
  }
  nav a {
    flex: 0 1 auto;
    font-size: 13px;
    padding: 8px 10px;
    width: auto;
    white-space: nowrap;
  }
  .form-row {
    flex-direction: column;
    gap: 8px;
  }
  .results {
    flex-direction: column;
    align-items: stretch;
  }
  .stat {
    width: 100%;
  }
  footer {
    flex-direction: column;
    text-align: center;
    gap: 6px;
  }
}

/* Large/Extra-large desktops (≥1400px) */
@media (min-width: 1400px) {
  header {
    flex-wrap: nowrap;
    gap: 20px;
  }
  header h1 {
    font-size: clamp(22px, 2vw, 32px);
    white-space: normal;
    line-height: 1.3;
  }
}

/* Extra-wide desktops (≥1600px) */
@media (min-width: 1600px) {
  .container {
    max-width: 1400px;
    padding: 32px;
  }
}
