/*
 * MIGESTI OS — Panel Detach & Reattach System
 * Phase 99 — Bluebeam-style floating panels
 *
 * Architect: Matthew F. Inglima
 */

/* ── Detach Button ───────────────────────────────────────────────── */

.mig-detach-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm, 6px);
  background: transparent;
  color: var(--accent-gold, #E0C04A);
  font-size: 14px;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
  line-height: 1;
}

.mig-detach-btn:hover {
  opacity: 1;
  background: rgba(212, 168, 67, 0.12);
  box-shadow: 0 0 8px rgba(212, 168, 67, 0.3);
}

.mig-detach-btn:active {
  transform: scale(0.92);
}

/* Hide on mobile */
@media (max-width: 768px) {
  .mig-detach-btn { display: none; }
}

/* ── Placeholder (replaces panel when detached) ──────────────────── */

.mig-detach-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 120px;
  padding: var(--space-lg, 18px);
  background: var(--panel-bg, rgba(8, 10, 28, 0.82));
  border: 2px dashed rgba(212, 168, 67, 0.25);
  border-radius: var(--panel-radius, 12px);
  animation: mig-placeholder-pulse 3s ease-in-out infinite;
  text-align: center;
}

.mig-detach-placeholder__icon {
  font-size: 1.5rem;
  opacity: 0.6;
}

.mig-detach-placeholder__title {
  font-size: var(--text-sm, 0.813rem);
  font-weight: 700;
  color: var(--accent-gold, #E0C04A);
  letter-spacing: 0.05em;
}

.mig-detach-placeholder__text {
  font-size: 0.75rem;
  color: var(--text-muted, #64748B);
}

.mig-detach-placeholder__reattach {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  font-size: var(--text-sm, 0.813rem);
  font-weight: 600;
  font-family: var(--font-primary, 'Inter', sans-serif);
  color: var(--accent-gold, #E0C04A);
  background: rgba(212, 168, 67, 0.08);
  border: 1px solid rgba(212, 168, 67, 0.25);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mig-detach-placeholder__reattach:hover {
  background: rgba(212, 168, 67, 0.18);
  border-color: var(--accent-gold, #E0C04A);
}

@keyframes mig-placeholder-pulse {
  0%, 100% { border-color: rgba(212, 168, 67, 0.15); }
  50% { border-color: rgba(212, 168, 67, 0.4); }
}

/* ── Detached Window Shell ───────────────────────────────────────── */

body.mig-detached-window {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--surface-primary, #050b1a);
  color: var(--text-primary, #F8FAFC);
  font-family: var(--font-primary, 'Inter', sans-serif);
}

.mig-detached-header {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 12px;
  background: var(--nav-bg);
  border-bottom: 1px solid rgba(212, 168, 67, 0.15);
  -webkit-app-region: drag;
  user-select: none;
}

.mig-detached-logo {
  font-size: 11px;
  font-weight: 900;
  color: var(--accent-gold, #E0C04A);
  letter-spacing: 0.12em;
}

.mig-detached-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary, #C7D2FE);
  letter-spacing: 0.04em;
}

.mig-detached-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  -webkit-app-region: no-drag;
}

.mig-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green, #00F28C);
  box-shadow: 0 0 6px rgba(0, 242, 140, 0.5);
  animation: mig-live-pulse 2s ease-in-out infinite;
}

.mig-live-dot--warning {
  background: var(--accent-gold, #E0C04A);
  box-shadow: 0 0 6px rgba(224, 192, 74, 0.5);
}

.mig-live-dot--error {
  background: #ff5e5e;
  box-shadow: 0 0 6px rgba(255, 94, 94, 0.5);
  animation: none;
}

@keyframes mig-live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.mig-reattach-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-primary, 'Inter', sans-serif);
  color: var(--accent-gold, #E0C04A);
  background: transparent;
  border: 1px solid rgba(212, 168, 67, 0.25);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mig-reattach-btn:hover {
  background: rgba(212, 168, 67, 0.12);
  border-color: var(--accent-gold, #E0C04A);
}

.mig-detached-content {
  height: calc(100vh - 36px);
  overflow: auto;
}

/* ── Popup Blocked Message ───────────────────────────────────────── */

.mig-popup-blocked {
  position: fixed;
  bottom: var(--space-xl, 26px);
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 20px;
  background: rgba(255, 94, 94, 0.15);
  border: 1px solid rgba(255, 94, 94, 0.3);
  border-radius: var(--radius-sm, 6px);
  color: #ff5e5e;
  font-size: var(--text-sm, 0.813rem);
  font-weight: 600;
  z-index: 9999;
  animation: mig-fade-in 0.3s ease;
}

@keyframes mig-fade-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
