/* =====================================================
   CAPSULESOS RESPONSIVE DESIGN SYSTEM
   Scales from mobile (< 640px) → tablet (640-1024px) →
   desktop (1024-1440px) → large desktop (1440px+)

   Uses CSS clamp() for fluid scaling where appropriate.
   Maintains black-glass theme throughout all breakpoints.
   ===================================================== */

/* ── HEADER & NAVIGATION SCALING ────────────────────── */

/* Mobile header (< 640px) */
header {
  padding: 6px 16px;
  height: 44px;
}

header button {
  font-size: 1.2rem;
  padding: 4px 6px;
}

header img {
  height: 22px;
}

/* Tablet header (640px+) */
@media (min-width: 640px) {
  header {
    padding: 8px 20px;
    height: 48px;
  }

  header button {
    font-size: 1.3rem;
    padding: 6px 8px;
  }

  header img {
    height: 26px;
  }
}

/* Desktop header (1024px+) */
@media (min-width: 1024px) {
  header {
    padding: 10px 24px;
    height: 52px;
  }

  header button {
    font-size: 1.4rem;
    padding: 8px 10px;
  }

  header img {
    height: 30px;
  }
}

/* Large desktop header (1440px+) */
@media (min-width: 1440px) {
  header {
    padding: 12px 32px;
    height: 56px;
  }

  header button {
    font-size: 1.5rem;
  }

  header img {
    height: 32px;
  }
}

/* ── BREADCRUMB BAR ────────────────────────────────── */

/* Mobile breadcrumb */
[style*="position: sticky"][style*="top: 44px"],
[style*="position: sticky"][style*="top: 48px"],
[style*="position: sticky"][style*="top: 52px"],
[style*="position: sticky"][style*="top: 56px"] {
  padding: 4px 16px;
  font-size: 0.65rem;
}

[style*="position: sticky"] button {
  font-size: 0.65rem;
  padding: 6px 0;
}

/* Tablet breadcrumb */
@media (min-width: 640px) {
  [style*="position: sticky"][style*="top: 44px"],
  [style*="position: sticky"][style*="top: 48px"],
  [style*="position: sticky"][style*="top: 52px"],
  [style*="position: sticky"][style*="top: 56px"] {
    padding: 6px 20px;
    font-size: 0.75rem;
  }
}

/* Desktop breadcrumb */
@media (min-width: 1024px) {
  [style*="position: sticky"][style*="top: 44px"],
  [style*="position: sticky"][style*="top: 48px"],
  [style*="position: sticky"][style*="top: 52px"],
  [style*="position: sticky"][style*="top: 56px"] {
    padding: 8px 24px;
    font-size: 0.85rem;
  }
}

/* ── HOME PAGE LAYOUT ────────────────────────────────– */

/* Mobile home page */
[style*="paddingTop: 60px"] {
  padding-top: 60px;
  padding-bottom: 40px;
  padding-left: 16px;
  padding-right: 16px;
  gap: 12px;
}

[style*="gap: 32"] {
  gap: 20px;
}

/* Home page title scaling (0.9rem mobile) */
@media (min-width: 640px) {
  [style*="fontSize: \"0.9rem\""] {
    font-size: 1.1rem !important;
  }

  /* Scale up home subtitle */
  [style*="fontSize: \"0.5rem\""] {
    font-size: 0.65rem !important;
  }

  /* Increase gap between module sections */
  [style*="gap: 32"] {
    gap: 28px;
  }

  /* More padding on home */
  [style*="paddingTop: 60px"] {
    padding-top: 80px;
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (min-width: 1024px) {
  /* Larger home title */
  [style*="fontSize: \"0.9rem\""] {
    font-size: 1.4rem !important;
  }

  /* Larger home subtitle */
  [style*="fontSize: \"0.5rem\""] {
    font-size: 0.8rem !important;
  }

  /* Wide spacing on desktop */
  [style*="gap: 32"] {
    gap: 40px;
  }

  /* Extra padding */
  [style*="paddingTop: 60px"] {
    padding-top: 100px;
    padding-left: 24px;
    padding-right: 24px;
  }
}

@media (min-width: 1440px) {
  [style*="fontSize: \"0.9rem\""] {
    font-size: 1.6rem !important;
  }

  [style*="fontSize: \"0.5rem\""] {
    font-size: 0.9rem !important;
  }

  [style*="gap: 32"] {
    gap: 48px;
  }

  [style*="paddingTop: 60px"] {
    padding-top: 120px;
    padding-left: 32px;
    padding-right: 32px;
  }
}

/* ── APP ICON SCALING ────────────────────────────────– */

/* Mobile app icons (56x56) */
[style*="width: 56"][style*="height: 56"] {
  width: 56px !important;
  height: 56px !important;
  border-radius: 14px;
}

[style*="width: 56"] ~ * [style*="fontSize: \"1.6rem\""] {
  font-size: 1.6rem !important;
}

[style*="width: 56"] ~ * [style*="fontSize: 10"] {
  font-size: 10px !important;
}

/* Tablet app icons */
@media (min-width: 640px) {
  [style*="width: 56"][style*="height: 56"] {
    width: 64px !important;
    height: 64px !important;
    border-radius: 16px;
  }

  [style*="width: 56"] ~ * [style*="fontSize: \"1.6rem\""] {
    font-size: 1.8rem !important;
  }

  [style*="width: 56"] ~ * [style*="fontSize: 10"] {
    font-size: 11px !important;
  }
}

/* Desktop app icons */
@media (min-width: 1024px) {
  [style*="width: 56"][style*="height: 56"] {
    width: 120px !important;
    height: 120px !important;
    border-radius: 20px;
  }

  [style*="width: 56"] ~ * [style*="fontSize: \"1.6rem\""] {
    font-size: 2.8rem !important;
  }

  [style*="width: 56"] ~ * [style*="fontSize: 10"] {
    font-size: 16px !important;
  }
}

/* Large desktop app icons */
@media (min-width: 1440px) {
  [style*="width: 56"][style*="height: 56"] {
    width: 140px !important;
    height: 140px !important;
    border-radius: 24px;
  }

  [style*="width: 56"] ~ * [style*="fontSize: \"1.6rem\""] {
    font-size: 3.2rem !important;
  }

  [style*="width: 56"] ~ * [style*="fontSize: 10"] {
    font-size: 18px !important;
  }
}

/* ── STEP LABEL SCALING ────────────────────────────── */

/* Step labels on app icons */
[style*="fontSize: 11"][style*="fontWeight: 800"] {
  font-size: 11px !important;
}

@media (min-width: 640px) {
  [style*="fontSize: 11"][style*="fontWeight: 800"] {
    font-size: 12px !important;
  }
}

@media (min-width: 1024px) {
  [style*="fontSize: 11"][style*="fontWeight: 800"] {
    font-size: 13px !important;
  }
}

@media (min-width: 1440px) {
  [style*="fontSize: 11"][style*="fontWeight: 800"] {
    font-size: 14px !important;
  }
}

/* ── MODULE SECTION LABELS ──────────────────────────– */

/* "SELECT MODULE" / section labels */
[style*="fontSize: 11"][style*="letterSpacing: \"1.5px\""],
[style*="fontSize: 13"][style*="letterSpacing: \"1.5px\""] {
  font-size: clamp(11px, 1.2vw, 16px) !important;
}

/* "STEP X" label under icons */
[style*="fontSize: 11"][style*="letterSpacing: \"0.5px\""] {
  font-size: clamp(11px, 1vw, 14px) !important;
}

/* ── MODAL SCALING ──────────────────────────────────– */

/* Brand picker modal (mobile 90%, max 400px) */
[style*="width: \"90%\""][style*="maxWidth: 400"] {
  width: 90% !important;
  max-width: 400px !important;
  border-radius: 16px;
}

@media (min-width: 640px) {
  [style*="width: \"90%\""][style*="maxWidth: 400"] {
    width: 90% !important;
    max-width: 500px !important;
    border-radius: 18px;
  }
}

@media (min-width: 1024px) {
  [style*="width: \"90%\""][style*="maxWidth: 400"] {
    width: 85% !important;
    max-width: 600px !important;
    border-radius: 20px;
  }
}

@media (min-width: 1440px) {
  [style*="width: \"90%\""][style*="maxWidth: 400"] {
    width: 80% !important;
    max-width: 700px !important;
    border-radius: 24px;
  }
}

/* Modal padding */
[style*="maxWidth: 400"][style*="padding: \"24px 20px\""] {
  padding: 24px 20px !important;
}

@media (min-width: 640px) {
  [style*="maxWidth: 400"][style*="padding: \"24px 20px\""] {
    padding: 28px 24px !important;
  }
}

@media (min-width: 1024px) {
  [style*="maxWidth: 400"][style*="padding: \"24px 20px\""] {
    padding: 32px 28px !important;
  }
}

/* Modal labels and text */
[style*="fontSize: 14"][style*="fontWeight: 700"][style*="letterSpacing: \"1px\""] {
  font-size: clamp(14px, 1.5vw, 18px) !important;
}

[style*="fontSize: 11"][style*="color: \"rgba(255,255,255,0.4)\""] {
  font-size: clamp(11px, 1vw, 14px) !important;
}

/* Modal button scaling */
[style*="maxWidth: 400"] button {
  font-size: clamp(12px, 1vw, 15px) !important;
  padding: clamp(10px, 1vw, 14px) clamp(16px, 2vw, 20px) !important;
  min-height: clamp(40px, 8vw, 48px) !important;
}

/* ── AGENT CHAT SCALING ─────────────────────────────– */

/* Agent chat container */
[style*="maxWidth: 360"] {
  max-width: clamp(360px, 90vw, 600px) !important;
}

@media (min-width: 1024px) {
  [style*="maxWidth: 360"] {
    max-width: clamp(400px, 80vw, 700px) !important;
  }
}

/* ── DROPDOWN MENU SCALING ──────────────────────────– */

/* Gear dropdown */
[style*="minWidth: 180"] {
  min-width: 180px !important;
}

@media (min-width: 640px) {
  [style*="minWidth: 180"] {
    min-width: 200px !important;
  }
}

@media (min-width: 1024px) {
  [style*="minWidth: 180"] {
    min-width: 220px !important;
  }
}

/* Hamburger menu */
[style*="minWidth: 220"] {
  min-width: 220px !important;
}

@media (min-width: 640px) {
  [style*="minWidth: 220"] {
    min-width: 240px !important;
  }
}

@media (min-width: 1024px) {
  [style*="minWidth: 220"] {
    min-width: 260px !important;
  }
}

/* Dropdown link scaling */
[style*="fontSize: \"0.72rem\""] {
  font-size: clamp(0.72rem, 1.2vw, 0.9rem) !important;
  padding: clamp(8px, 1.2vw, 12px) clamp(16px, 2vw, 24px) !important;
}

/* ── GRID LAYOUT SCALING ────────────────────────────– */

/* 3-column grid (app icons) - mobile */
[style*="gridTemplateColumns: \"repeat(3, 1fr)\""] {
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 10px !important;
}

@media (min-width: 640px) {
  [style*="gridTemplateColumns: \"repeat(3, 1fr)\""] {
    gap: 14px !important;
  }
}

@media (min-width: 1024px) {
  [style*="gridTemplateColumns: \"repeat(3, 1fr)\""] {
    gap: 16px !important;
  }
}

@media (min-width: 1440px) {
  [style*="gridTemplateColumns: \"repeat(3, 1fr)\""] {
    gap: 20px !important;
  }
}

/* ── AGENT CHAT BUTTON SCALING ──────────────────────– */

/* "CONTINUE TO CONTENT" button */
button[style*="background: \"#d4af37\""],
button[style*="background: #d4af37"] {
  font-size: clamp(12px, 1.2vw, 15px) !important;
  padding: clamp(8px, 1vw, 12px) clamp(16px, 2vw, 28px) !important;
  min-height: clamp(40px, 8vw, 48px) !important;
}

/* ── BACK BUTTON SCALING ────────────────────────────– */

[style*="fontSize: \"0.65rem\""][style*="color: \"#d4af37\""] {
  font-size: clamp(0.65rem, 1vw, 0.85rem) !important;
  padding: clamp(4px, 1vw, 8px) 0 !important;
}

/* ── MAIN CONTENT PADDING ────────────────────────── */

main {
  padding: clamp(12px, 2vw, 24px) !important;
}

/* Ensure main content is centered and constrained */
main > div {
  max-width: clamp(360px, 95vw, 1400px) !important;
  margin: 0 auto !important;
}

@media (min-width: 1024px) {
  main > div {
    max-width: clamp(960px, 90vw, 1320px) !important;
  }
}

@media (min-width: 1440px) {
  main > div {
    max-width: 1500px !important;
  }
}

/* ── TEXT SCALING WITH CLAMP ────────────────────────– */

/* Scale select module label */
[style*="fontSize: 11"][style*="fontWeight: 700"][style*="letterSpacing: \"1.5px\""][style*="marginBottom: 24"] {
  font-size: clamp(11px, 1.2vw, 15px) !important;
  margin-bottom: clamp(16px, 3vw, 28px) !important;
}

/* Scale "OTHER" label */
[style*="fontSize: 10"][style*="fontWeight: 700"][style*="letterSpacing: \"1.5px\""][style*="marginBottom: 16"] {
  font-size: clamp(10px, 1.1vw, 14px) !important;
  margin-bottom: clamp(12px, 2.5vw, 20px) !important;
}

/* ── GLASS MORPHISM ADJUSTMENTS ────────────────────– */

/* Modal and dropdown border radius scaling */
[style*="borderRadius: 12"] {
  border-radius: clamp(12px, 1.5vw, 18px) !important;
}

[style*="borderRadius: 16"] {
  border-radius: clamp(16px, 2vw, 24px) !important;
}

/* ── DIVIDER SCALING ────────────────────────────────– */

/* Divider between "STEPS" and "OTHER" sections */
[style*="width: 80"][style*="height: 1"][style*="margin: \"20px 0 16px\""] {
  width: clamp(60px, 15vw, 100px) !important;
  margin: clamp(16px, 3vw, 28px) 0 !important;
}

/* ── TOUCH TARGETS ──────────────────────────────────– */

/* Ensure all buttons meet 44px minimum on mobile, scale up on desktop */
button, a.btn, .btn {
  min-height: clamp(40px, 8vw, 52px) !important;
  min-width: clamp(40px, 8vw, 52px) !important;
}

input, select, textarea {
  min-height: clamp(36px, 8vw, 48px) !important;
}

/* ── RESPONSIVE UTILITIES ────────────────────────────– */

/* Hide/show elements responsively if needed */
.show-mobile { display: block; }
.show-tablet { display: none; }
.show-desktop { display: none; }

@media (min-width: 640px) {
  .show-mobile { display: none; }
  .show-tablet { display: block; }
}

@media (min-width: 1024px) {
  .show-tablet { display: none; }
  .show-desktop { display: block; }
}
