/* =========================================================
   Concrete Calculator Web (Lite Demo)
   styles.css

   Goals:
   - Match the Flutter HomeScreen vibe:
     - Banner at top
     - Dark tab bar
     - Light grey content background
     - White rounded cards with clean spacing
     - Locked features look clickable but show a lock
   ========================================================= */

/* -----------------------------
   Design tokens
------------------------------ */
:root {
  --bg-app: #f2f2f2;          /* light grey content area */
  --bg-tabs: #111111;         /* dark tab bar */
  --bg-card: #ffffff;         /* white cards */
  --text: #111111;
  --text-muted: #666666;
  --border: #d8d8d8;

  --shadow: 0 2px 10px rgba(0, 0, 0, 0.08);

  --radius-lg: 16px;
  --radius-md: 12px;

  --pad-page: 14px;
  --pad-card: 14px;

  --btn-h: 44px;
}

/* -----------------------------
   Base / Reset
------------------------------ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: #000; /* helps the banner edge feel like the app header */
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

/* Remove default button look but keep accessibility */
button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(30, 144, 255, 0.5);
  outline-offset: 2px;
}

/* -----------------------------
   App shell
------------------------------ */
.app-shell {
  min-height: 100vh;
  background: var(--bg-app);
}

/* -----------------------------
   Header / Branding
------------------------------ */
.brand-header {
  background: #000;
  width: 100%;
}

.brand-banner {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: cover;
}

.brand-banner-fallback {
  padding: 22px var(--pad-page);
  color: #fff;
}

.fallback-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.fallback-subtitle {
  margin-top: 4px;
  font-size: 14px;
  opacity: 0.8;
}

/* -----------------------------
   Top tabs
------------------------------ */
.top-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--bg-tabs);
}

.tab-btn {
  height: 52px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.2px;
  border-bottom: 3px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab-btn:hover {
  color: #fff;
}

.tab-btn.is-active {
  color: #fff;
  border-bottom-color: #fff;
}

.tab-btn.is-locked {
  color: rgba(255, 255, 255, 0.65);
}

.lock-dot {
  font-size: 14px;
  opacity: 0.9;
}

/* -----------------------------
   Content area
------------------------------ */
.content-area {
  padding: var(--pad-page);
  max-width: 860px; /* keeps it tidy on desktop */
  margin: 0 auto;
}

.panel-title {
  font-weight: 900;
  font-size: 18px;
  margin: 10px 2px 12px;
}

.panel-note {
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0 2px 14px;
}

/* Tab panels */
.tab-panel {
  display: none;
}

.tab-panel.is-visible {
  display: block;
}

/* -----------------------------
   Cards list (HomeScreen-style)
------------------------------ */
.cards-list {
  display: grid;
  gap: 12px;
}

.feature-card {
  width: 100%;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--pad-card);
  display: grid;
  grid-template-columns: 56px 1fr 28px;
  gap: 12px;
  align-items: center;
}

.feature-card:hover {
  transform: translateY(-1px);
}

.feature-card:active {
  transform: translateY(0px);
}

.feature-card.is-locked {
  opacity: 0.92;
}

/* Selected calculator card (when you click Slab/Circle) */
.feature-card.is-selected {
  border-color: #111;
}

.card-left {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: #f7f7f7;
  border: 1px solid #ececec;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.card-mid {
  min-width: 0;
}

.card-title {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.1px;
}

.card-subtitle {
  margin-top: 3px;
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.card-chevron {
  font-size: 22px;
  color: rgba(0, 0, 0, 0.35);
}

.lock-badge {
  font-size: 16px;
}

/* -----------------------------
   Calculator panel
------------------------------ */
.calculator-panel {
  margin-top: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 14px;
}

.calculator-mount {
  margin-top: 10px;
  border-radius: var(--radius-md);
  padding: 12px;
  background: #fafafa;
  border: 1px dashed #d7d7d7;
  min-height: 90px;
}

/* =========================================================
   Calculator UI (shared styles used by JS calculators)
   ========================================================= */

.ccw-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid #d8d8d8;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
}

.ccw-input::placeholder {
  color: rgba(0, 0, 0, 0.35);
  font-weight: 600;
}

/* Grey results pill like the app results section */
.ccw-results-pill {
  margin-top: 12px;
  background: #d3d3d3;
  border-radius: 24px;
  padding: 14px;
}

/* -----------------------------
   Locked tab panels
------------------------------ */
.locked-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px;
}

/* -----------------------------
   Settings
------------------------------ */
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}

.settings-card.is-locked {
  opacity: 0.92;
  cursor: pointer;
}

/* Adds spacing between stacked settings rows (Input Units + Output Volume) */
.settings-row-spaced {
  margin-top: 12px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.settings-title {
  font-size: 16px;
  font-weight: 900;
}

.settings-subtitle {
  margin-top: 3px;
  font-size: 13px;
  color: var(--text-muted);
}

.settings-hint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Units toggle pills */
.units-toggle {
  display: inline-flex;
  gap: 8px;
  background: #f3f3f3;
  border: 1px solid #e5e5e5;
  border-radius: 999px;
  padding: 6px;
}

.toggle-pill {
  position: relative;
  border-radius: 999px;
  overflow: hidden;
}

.toggle-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-pill span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.60);
}

.toggle-pill input:checked + span {
  background: #111;
  color: #fff;
}

/* -----------------------------
   Buttons
------------------------------ */
.primary-btn,
.secondary-btn {
  height: var(--btn-h);
  padding: 0 14px;
  border-radius: 12px;
  font-weight: 900;
  font-size: 14px;
}

.primary-btn {
  background: #111;
  color: #fff;
}

.primary-btn:hover {
  filter: brightness(1.05);
}

.secondary-btn {
  background: #f0f0f0;
  color: #111;
  border: 1px solid #e2e2e2;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #f2f2f2;
  border: 1px solid #e2e2e2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* -----------------------------
   Modal
------------------------------ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 50;
}

.modal-overlay[aria-hidden="true"] {
  display: none;
}

.modal {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.modal-header {
  padding: 14px 14px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #eee;
}

.modal-title {
  font-weight: 950;
  font-size: 16px;
}

.modal-body {
  padding: 12px 14px;
}

.modal-feature {
  font-weight: 950;
  margin-bottom: 6px;
}

.modal-text {
  margin: 8px 0;
  color: #222;
  line-height: 1.35;
}

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

.modal-footer {
  padding: 12px 14px 14px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid #eee;
}

/* -----------------------------
   Responsive tweaks
------------------------------ */
@media (max-width: 520px) {
  .feature-card {
    grid-template-columns: 50px 1fr 24px;
  }

  .card-left {
    width: 50px;
    height: 50px;
  }

  .card-icon {
    width: 42px;
    height: 42px;
  }

  .tab-btn {
    font-size: 13px;
  }

  .units-toggle {
    gap: 6px;
    padding: 5px;
  }

  .toggle-pill span {
    height: 32px;
    padding: 0 10px;
    font-size: 12.5px;
  }
}
