/* ============================================
   FieldOps Guide — Mockup CSS
   Phone frame + in-app UI component mockups
   ============================================ */

/* ===== Phone Frame ===== */
.phone {
  position: relative;
  width: 320px;
  aspect-ratio: 9/19.5;
  background: #1a1a1a;
  border-radius: 42px;
  padding: 10px;
  box-shadow:
    0 0 0 2px #2a2a2a,
    0 30px 60px rgba(0, 0, 0, 0.6),
    0 10px 30px rgba(0, 0, 0, 0.4);
  margin: 0 auto;
  flex-shrink: 0;
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: var(--bg);
  border-radius: 32px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Status bar */
.phone-status-bar {
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 28px;
  flex-shrink: 0;
}

.phone-status-bar .time {
  font-weight: 700;
}

.phone-status-bar .icons {
  display: flex;
  gap: 4px;
  align-items: center;
}

/* Notch area (optional) */
.phone-notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 22px;
  background: #1a1a1a;
  border-radius: 0 0 12px 12px;
  z-index: 2;
}

/* ===== In-app components (for mockups) ===== */

/* App top bar */
.mk-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.mk-topbar-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.mk-topbar-title em {
  color: var(--accent2);
  font-style: normal;
}

.mk-topbar-actions {
  display: flex;
  gap: 6px;
}

.mk-icon-btn {
  width: 30px;
  height: 30px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 13px;
}

/* App body */
.mk-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Tab bar */
.mk-tabs {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.mk-tab {
  flex: 1;
  padding: 10px 8px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-hint);
  border-bottom: 2px solid transparent;
}

.mk-tab.active {
  color: var(--accent2);
  border-bottom-color: var(--accent2);
}

/* Operation/project card */
.mk-op-list {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.mk-op {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mk-op-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mk-op-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}

.mk-op-type {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--accent2);
  color: #000;
  font-weight: 700;
}

.mk-op-type.sar { background: #22c55e; }
.mk-op-type.recovery { background: #a855f7; color: #fff; }
.mk-op-type.tactical { background: #ef4444; color: #fff; }

.mk-op-meta {
  display: flex;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
}

.mk-op-meta .dot {
  width: 6px;
  height: 6px;
  background: var(--success);
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
  vertical-align: middle;
}

/* Bottom button */
.mk-bottom-btn {
  margin: 10px;
  padding: 12px;
  background: var(--accent2);
  border-radius: 8px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  letter-spacing: 0.03em;
}

/* Form fields */
.mk-form {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
}

.mk-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mk-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-hint);
}

.mk-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text);
  font-family: var(--font-body);
}

.mk-input.value {
  color: var(--text);
  font-weight: 500;
}

.mk-input-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

/* Pin type grid */
.mk-pin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.mk-pin-chip {
  aspect-ratio: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 600;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.1;
}

.mk-pin-chip.selected {
  border-color: var(--accent2);
  background: rgba(255, 107, 0, 0.1);
  color: var(--text);
}

.mk-pin-chip .emoji {
  font-size: 22px;
}

/* Toggle */
.mk-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.mk-toggle-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.mk-toggle {
  width: 38px;
  height: 22px;
  background: var(--surface3);
  border-radius: 11px;
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.mk-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.mk-toggle.on {
  background: var(--accent2);
}

.mk-toggle.on::after {
  transform: translateX(16px);
}

/* Section header */
.mk-section-header {
  padding: 12px 12px 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-hint);
}

/* Settings list */
.mk-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.mk-setting-row:first-child {
  border-top: 1px solid var(--border);
}

.mk-setting-label {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 12px;
  color: var(--text);
}

.mk-setting-value {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.mk-setting-arrow {
  color: var(--text-hint);
  font-size: 14px;
}

/* Map mockup */
.mk-map {
  flex: 1;
  background:
    linear-gradient(135deg,
      #1a3a1a 0%,
      #2d5a2d 25%,
      #3a6b3a 50%,
      #2d5a2d 75%,
      #1a3a1a 100%
    );
  position: relative;
  overflow: hidden;
}

.mk-map::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg, transparent, transparent 40px, rgba(0,0,0,0.1) 40px, rgba(0,0,0,0.1) 42px),
    repeating-linear-gradient(-45deg, transparent, transparent 30px, rgba(255,255,255,0.03) 30px, rgba(255,255,255,0.03) 31px);
  pointer-events: none;
}

.mk-map-pin {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.mk-map-pin span {
  transform: rotate(45deg);
}

.mk-map-pin.fire { background: #ef4444; }
.mk-map-pin.command { background: var(--accent2); }
.mk-map-pin.staging { background: #fbbf24; }
.mk-map-pin.asset { background: var(--accent); }
.mk-map-pin.hazard { background: #a855f7; }

/* Map floating controls */
.mk-map-controls {
  position: absolute;
  right: 10px;
  bottom: 60px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
}

.mk-map-btn {
  width: 36px;
  height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.mk-map-fab {
  position: absolute;
  right: 10px;
  bottom: 12px;
  width: 44px;
  height: 44px;
  background: var(--accent2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  z-index: 2;
}

.mk-map-layer-pill {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 5px 10px;
  background: rgba(10, 14, 19, 0.85);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 2;
}

/* Modal over map */
.mk-modal {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  z-index: 3;
}

.mk-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.mk-modal-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.mk-modal-close {
  color: var(--text-hint);
  font-size: 16px;
}

/* Role badge */
.mk-role {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 700;
}

.mk-role.admin { background: var(--accent2); color: #000; }
.mk-role.user { background: var(--accent); color: #fff; }
.mk-role.viewer { background: var(--surface3); color: var(--text-dim); }

/* Search bar */
.mk-search {
  margin: 10px;
  display: flex;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  align-items: center;
}

.mk-search-icon {
  color: var(--text-hint);
  font-size: 13px;
}

.mk-search-text {
  font-size: 12px;
  color: var(--text-dim);
  flex: 1;
}

/* Hint text inside mockups */
.mk-hint {
  padding: 10px 12px;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--text-hint);
  text-align: center;
  font-style: italic;
}

/* Chat bubble */
.mk-chat {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mk-bubble {
  max-width: 80%;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.4;
}

.mk-bubble.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 3px;
}

.mk-bubble.ai {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-bottom-left-radius: 3px;
}

/* ===== Mockup stage (wraps phone + callouts) ===== */
.stage {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: var(--space-xl) var(--space-md);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin: var(--space-xl) 0;
  min-height: 500px;

  /* grid background */
  background-image:
    radial-gradient(circle, rgba(30, 45, 64, 0.4) 1px, transparent 1px);
  background-size: 20px 20px;
}

.stage-wide {
  min-height: 640px;
  padding: var(--space-2xl) var(--space-lg);
}

/* Screenshot placeholder (for real maps) */
.screenshot-placeholder {
  width: 100%;
  aspect-ratio: 9/19.5;
  background: repeating-linear-gradient(
    45deg,
    var(--surface) 0,
    var(--surface) 10px,
    var(--surface2) 10px,
    var(--surface2) 20px
  );
  border: 2px dashed var(--border-hover);
  border-radius: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  text-align: center;
}

.screenshot-placeholder .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-hint);
}

.screenshot-placeholder .desc {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
  max-width: 200px;
}

/* Responsive */
@media (max-width: 640px) {
  .phone {
    width: min(280px, 90%);
  }

  .stage {
    padding: var(--space-lg) var(--space-sm);
  }
}
