/* ================================================================
   PLATFORM TOGGLE SYSTEM — ATLAS Multi-Platform POC
   ================================================================
   Usage: Include this CSS in any prototype, then add the platform
   toggle HTML + JS snippet. Content sections use data-platform
   attributes to show/hide per platform.
   ================================================================ */

/* ─── PLATFORM TOGGLE BAR ─── */
.platform-toggle {
  display: inline-flex;
  align-items: center;
  position: relative;
  height: 36px;
  padding: 3px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  gap: 0;
  margin: 0 auto var(--sp-md);
}
.platform-toggle-wrap {
  display: flex;
  justify-content: center;
}

.platform-btn {
  position: relative;
  z-index: 1;
  height: 30px;
  padding: 0 18px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.45);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: color 200ms ease;
  white-space: nowrap;
  user-select: none;
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.platform-btn i {
  font-size: 16px;
  transition: color 200ms ease;
}

/* Hover (non-active) */
.platform-btn:hover:not(.active) {
  color: rgba(255,255,255,0.7);
}

/* Active button — text only, indicator provides the glass background */
.platform-btn.active {
  color: var(--white);
  font-weight: 600;
}

/* Sliding glass indicator behind active button */
.platform-indicator {
  position: absolute;
  top: 3px;
  left: 3px; /* static anchor — JS moves via transform only */
  height: 30px;
  border-radius: 7px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 1px 3px rgba(0,0,0,0.3), inset 0 0 1px rgba(255,255,255,0.05);
  transition: transform 200ms cubic-bezier(0.445,0.05,0.55,0.95);
  pointer-events: none;
  z-index: 0;
}

/* Cure dot on platform button */
.platform-btn .cure-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  position: absolute;
  top: 6px;
  right: 8px;
}

.platform-btn .cure-dot.cured {
  background: var(--success);
  box-shadow: 0 0 4px rgba(72,187,120,0.5);
}

.platform-btn .cure-dot.uncured {
  background: var(--amber);
  box-shadow: 0 0 4px rgba(245,158,11,0.4);
}


/* ─── PLATFORM CONTENT VISIBILITY ─── */
/* Hide all platform-specific content by default */
.platform-content {
  display: none;
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Show content matching active platform */
.platform-content.visible {
  display: block;
  opacity: 1;
}

/* ─── TABLET FRAME ─── */
/* Landscape iPad — same shadow DNA as Frame D Clay, wider + less radius */
.tablet-frame {
  background: var(--lightPrimary);
  border: none;
  border-radius: 28px;
  box-shadow:
    0 4px 24px rgba(0,0,0,0.3),
    0 12px 48px rgba(0,0,0,0.2),
    inset 0 0 0 1px rgba(255,255,255,0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-width: 1180px;
  width: 100%;
  height: auto;
  min-height: 820px;
}

.tablet-frame .screen-content {
  flex: 1;
  background: var(--lightPrimary);
  overflow: hidden;
}

/* Tablet status bar — same pattern as phone but wider */
.tablet-frame .status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-sm) var(--sp-xl);
  font-size: var(--text-xs);
  font-weight: 600;
}

/* Tablet grid for phone-row equivalent */
.tablet-row {
  display: flex;
  gap: var(--sp-xxxl);
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: var(--sp-xxxxl);
  padding: 0 var(--sp-xxl);
}

.tablet-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-md);
}

.tablet-label {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--coolGray);
  text-align: center;
}

/* ─── BROWSER FRAME (Minimal — Traffic Dots + URL) ─── */
/* Minimal window style — Linear/Vercel aesthetic */
.browser-frame {
  background: var(--lightPrimary);
  border-radius: var(--radius-lg);
  border: none;
  box-shadow:
    0 4px 24px rgba(0,0,0,0.3),
    0 12px 48px rgba(0,0,0,0.2),
    inset 0 0 0 1px rgba(255,255,255,0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.browser-frame.w-1280 { max-width: 1280px; width: 100%; }
.browser-frame.w-1024 { max-width: 1024px; width: 100%; }
.browser-frame.w-960 { max-width: 960px; width: 100%; }
.browser-frame.w-800 { max-width: 800px; width: 100%; }
.browser-frame.w-600 { max-width: 600px; width: 100%; }

.browser-chrome {
  height: 36px;
  background: var(--browserChromeBg, #2a2a2a);
  display: flex;
  align-items: center;
  padding: 0 var(--sp-md);
  gap: var(--sp-sm);
  flex-shrink: 0;
  border-bottom: var(--borderThin) solid rgba(255,255,255,0.06);
}

.browser-dots {
  display: flex;
  gap: 6px;
}

.browser-dots span {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
}

.browser-dots span:nth-child(1) { background: var(--browserDotRed, #ff5f56); }
.browser-dots span:nth-child(2) { background: var(--browserDotAmber, #ffbd2e); }
.browser-dots span:nth-child(3) { background: var(--browserDotGreen, #27c93f); }

.browser-url {
  flex: 1;
  background: var(--browserUrlBg, #1a1a1a);
  border-radius: var(--radius-sm);
  padding: var(--sp-xs) var(--sp-md);
  font-size: var(--text-xs);
  color: var(--coolGray);
  margin-left: var(--sp-sm);
  font-family: 'SF Mono', 'Fira Code', monospace;
  border: var(--borderThin) solid rgba(255,255,255,0.06);
}

.browser-url .url-protocol {
  color: rgba(141,155,167,0.5);
}

.browser-url .url-domain {
  color: var(--coolGray);
}

.browser-content {
  flex: 1;
  background: var(--lightPrimary);
  overflow: hidden;
}

/* Browser grid for displaying browser frames */
.browser-row {
  display: flex;
  gap: var(--sp-xxxl);
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: var(--sp-xxxxl);
  padding: 0 var(--sp-xxl);
}

.browser-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-md);
}

.browser-label {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--coolGray);
  text-align: center;
}

/* ─── PHONE FRAME (Frame D Clay — Reference) ─── */
/* Included here for completeness so all 3 frames live in one system */
.phone-frame {
  background: var(--lightPrimary);
  border: none;
  border-radius: 40px;
  box-shadow:
    0 4px 24px rgba(0,0,0,0.3),
    0 12px 48px rgba(0,0,0,0.2),
    inset 0 0 0 1px rgba(255,255,255,0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 390px;
  height: 844px;
}

.phone-frame .screen-content {
  flex: 1;
  background: var(--lightPrimary);
  overflow: hidden;
}

/* Phone grid */
.phone-row {
  display: flex;
  gap: var(--sp-xxl);
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: var(--sp-xxxxl);
}

.phone-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-md);
}

.phone-label {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--coolGray);
  text-align: center;
}

/* ─── FRAME FAMILY COHESION ─── */
/* All three frames share:
   - background: var(--lightPrimary)
   - border: none
   - inset glow: inset 0 0 0 1px rgba(255,255,255,0.08)
   - shadow stack: 0 4px 24px + 0 12px 48px

   Only these change:
   - Phone:   border-radius: 40px  | 390×844
   - Tablet:  border-radius: 28px  | 1180×820 (landscape)
   - Browser: border-radius: 12px  | 1280×auto (+ chrome bar)
*/

/* ─── PLATFORM INDICATOR DOTS (for ATLAS index cards) ─── */
/* Three dots = three platforms = brand identity */
.platform-dots {
  display: flex;
  gap: var(--sp-xs);
  align-items: center;
}

.platform-dot {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.platform-dot i {
  font-size: 12px;
}

/* Cured — filled with role color */
.platform-dot.cured.contractor {
  background: var(--terracotta);
  color: var(--white);
}

.platform-dot.cured.poster {
  background: var(--deepBlue);
  color: var(--white);
}

.platform-dot.cured.shared {
  background: var(--success);
  color: var(--white);
}

.platform-dot.cured.admin {
  background: var(--adminPrimary);
  color: var(--white);
}

/* Built but uncured — outline only */
.platform-dot.uncured {
  background: transparent;
  border: var(--borderThick) solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.3);
}

/* Not built — dimmed */
.platform-dot.unbuilt {
  background: transparent;
  border: var(--borderThin) solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.1);
}

/* ─── FLOW STEP LINK RESET ─── */
/* Flow steps sometimes use <a> tags — inherit parent color, not browser blue */
.flow-step a { color: inherit; text-decoration: none; }
.flow-step a:hover { color: inherit; }

/* ─── WEB LAYOUT ─── */
.web-layout { display: flex; height: 100%; }
.web-sidebar {
  width: 240px; background: var(--charcoal); padding: 0;
  display: flex; flex-direction: column; flex-shrink: 0;
}
.web-sidebar-brand {
  padding: var(--sp-xl) var(--sp-lg);
  display: flex; align-items: center; gap: var(--sp-sm);
}
.web-sidebar-divider {
  height: 1px; background: rgba(255,255,255,0.06);
  margin: 0 var(--sp-lg);
}
.web-nav-section-label {
  font-size: var(--text-micro); font-weight: 700; color: rgba(255,255,255,0.3);
  text-transform: uppercase; letter-spacing: 1.5px;
  padding: var(--sp-lg) var(--sp-lg) var(--sp-sm);
}
.web-nav-item {
  display: flex; align-items: center; gap: var(--sp-md);
  padding: var(--sp-sm) var(--sp-lg); color: rgba(255,255,255,0.5);
  font-size: var(--text-sm); font-weight: 500; cursor: pointer;
  transition: all 0.2s; border-left: var(--borderAccent) solid transparent;
  margin: var(--sp-xxs) 0; position: relative;
}
.web-nav-item:hover { background: rgba(255,255,255,0.04); color: var(--white); }
.web-nav-item.active {
  background: rgba(255,255,255,0.08); color: var(--white);
  border-left-color: var(--white); font-weight: 700;
}
.web-nav-item i {
  font-size: var(--text-lg); width: 22px; text-align: center;
  color: rgba(255,255,255,0.5); transition: color 0.2s;
}
.web-nav-item:hover i, .web-nav-item.active i { color: var(--white); }
.web-nav-label { flex: 1; }
.web-nav-shortcut {
  font-size: var(--text-micro); font-weight: 500; color: rgba(255,255,255,0.2);
  font-family: 'SF Mono', 'Fira Code', monospace; letter-spacing: -0.5px;
  padding: 2px 5px; border-radius: var(--radius-sm);
  border: 1px solid rgba(255,255,255,0.06); background: rgba(255,255,255,0.03);
}
.web-sidebar-profile {
  padding: var(--sp-md) var(--sp-lg); margin: 0 var(--sp-sm);
  display: flex; align-items: center; gap: var(--sp-md);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}
.web-sidebar-avatar {
  width: 36px; height: 36px; border-radius: var(--radius-full);
  background: rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center;
  font-size: var(--text-sm); font-weight: 700; color: var(--white);
  flex-shrink: 0; position: relative;
}
.web-sidebar-avatar .online-dot {
  position: absolute; bottom: -1px; right: -1px;
  width: 10px; height: 10px; border-radius: var(--radius-full);
  background: var(--success); border: 2px solid var(--charcoal);
}
.web-sidebar-profile-info { flex: 1; min-width: 0; }
.web-sidebar-profile-name {
  font-size: var(--text-xs); font-weight: 700; color: var(--white);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.web-sidebar-profile-role {
  font-size: var(--text-micro); font-weight: 600; color: var(--white);
  text-transform: uppercase; letter-spacing: 0.5px; margin-top: 1px;
  background: rgba(255,255,255,0.15); padding: 1px 6px; border-radius: var(--radius-sm);
  display: inline-block;
}
.web-main { flex: 1; overflow-y: auto; padding: var(--sp-xxl); background: var(--lightPrimary); }
.web-header {
  display: flex; align-items: center; justify-content: space-between;
}
.web-header h2 { font-size: var(--text-xl); font-weight: 800; }
.web-header.terra-hdr { background: var(--terracotta); color: var(--white); }
.web-header.terra-hdr h2 { color: var(--white); }
.web-header.char-hdr { background: var(--charcoal); color: var(--white); }
.web-header.char-hdr h2 { color: var(--white); }
.web-header.admin-hdr { background: var(--adminPrimary); color: var(--white); }
.web-header.admin-hdr h2 { color: var(--white); }
.status-bar.on-terracotta { background: var(--terracotta); color: var(--white); }
.status-bar.on-adminPrimary { background: var(--adminPrimary); color: var(--white); }
.header-bar.adminPrimary-bg { background: var(--adminPrimary); color: var(--white); display: flex; align-items: center; padding: var(--sp-md) var(--sp-lg); gap: var(--sp-md); flex-shrink: 0; }

/* ─── FOUC PREVENTION (stored platform) ─── */
/* Covers tablet + web only. Mobile is the JS default; init() shows it on load.
   Intentional tradeoff: first paint is immediate rather than faded to prevent FOUC. */
html[data-stored-platform="tablet"] .platform-content[data-platform~="mobile"],
html[data-stored-platform="web"] .platform-content[data-platform~="mobile"],
html[data-stored-platform="tablet"] .platform-content[data-platform~="web"],
html[data-stored-platform="web"] .platform-content[data-platform~="tablet"] {
  display: none;
}
html[data-stored-platform="tablet"] .platform-content[data-platform~="tablet"],
html[data-stored-platform="web"] .platform-content[data-platform~="web"] {
  display: block;
  opacity: 1;
}
