/* Device Drop UI (global) - uses marketing.css variables */

.device-drop-nav-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.device-drop-nav-btn:hover {
  background: var(--bg-glass-hover);
  border-color: var(--link-color);
  color: var(--link-color);
}

.device-drop-nav-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--error);
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-secondary);
}

.device-drop-tray {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 360px;
  max-height: min(70vh, 560px);
  overflow: hidden;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 10000;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.device-drop-toast-container {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10001;
  pointer-events: none;
}

.device-drop-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 380px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--bg-glass);
  backdrop-filter: blur(18px);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  transform: translateY(10px);
  opacity: 0;
  transition: all 0.2s ease;
}

.device-drop-toast.show {
  transform: translateY(0);
  opacity: 1;
}

.device-drop-toast .icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-md);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.device-drop-toast.success .icon { color: #10b981; }
.device-drop-toast.error .icon { color: #ef4444; }
.device-drop-toast.warning .icon { color: #f59e0b; }
.device-drop-toast.info .icon { color: var(--link-color); }

.device-drop-toast .msg {
  font-size: 0.9rem;
  line-height: 1.35;
}

.device-drop-toast .close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
}

.device-drop-toast .close:hover {
  border-color: var(--link-color);
  color: var(--link-color);
}

.device-drop-tray-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
}

.device-drop-tray-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
}

.device-drop-tab {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.device-drop-tab:hover {
  background: var(--bg-glass-hover);
  border-color: var(--link-color);
  color: var(--link-color);
}

.device-drop-tab.active {
  background: var(--gradient);
  border-color: transparent;
  color: white;
}

.device-drop-tray-title {
  font-weight: 700;
  color: var(--text-primary);
}

.device-drop-tray-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.device-drop-tray-close:hover {
  background: var(--bg-glass-hover);
  border-color: var(--link-color);
  color: var(--link-color);
}

.device-drop-tray-list {
  padding: 12px 14px;
  overflow: auto;
  max-height: calc(min(70vh, 560px) - 58px - 52px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.device-drop-list-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.device-drop-compose {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 12px;
}

.device-drop-compose-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.device-drop-compose-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.device-drop-compose-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
  margin-top: 6px;
}

.device-drop-compose-section-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.device-drop-select {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.device-drop-file {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.device-drop-select:focus {
  outline: none;
  border-color: var(--link-color);
  box-shadow: 0 0 0 3px rgba(42, 0, 229, 0.12);
}

.device-drop-compose-hint {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Dev-only helpers (shown only when DEV_MODE is enabled server-side) */
.device-drop-dev-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.device-drop-compose-options {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.device-drop-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.device-drop-opt input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.device-drop-select-sm {
  padding: 8px 10px;
  font-size: 0.85rem;
}

.device-drop-member-list {
  border: 1px solid var(--border-light);
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 8px;
  max-height: 220px;
  overflow: auto;
}

.device-drop-member-placeholder {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 6px;
}

.device-drop-member-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
}

.device-drop-member-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.device-drop-member-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.device-drop-member-label {
  flex: 1;
  min-width: 0;
  color: var(--text-primary);
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-drop-member-pill {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  color: var(--text-muted);
}

.device-drop-member-pill.online {
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--success, #10b981);
}

.device-drop-member-devices-toggle {
  border: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  flex: 0 0 auto;
}

.device-drop-member-devices-toggle:hover {
  background: rgba(255, 255, 255, 0.07);
}

.device-drop-member-devices {
  width: 100%;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.10);
  display: none;
}

.device-drop-member-devices.open {
  display: block;
}

.device-drop-member-devices-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  max-height: 160px;
  overflow: auto;
  padding-right: 4px;
}

@media (min-width: 640px) {
  .device-drop-member-devices-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.device-drop-device-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.12);
}

.device-drop-device-chip span {
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Members -> Devices stepper (to avoid dense inline expansions) */
.device-drop-members-stepper {
  width: 100%;
}

.device-drop-members-step-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.device-drop-members-step-title {
  flex: 1;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.device-drop-members-step-subtitle {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 6px 0 10px;
  line-height: 1.3;
}

.device-drop-members-back {
  flex: 0 0 auto;
}

.device-drop-members-identify {
  flex: 0 0 auto;
}

/* Device list uses same member-list container, but chips are a bit denser */
.device-drop-member-devices-list .device-drop-device-chip span {
  font-size: 0.8rem;
}

.device-drop-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 12px;
}

.device-drop-item-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.device-drop-item-meta {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 10px;
}

.device-drop-item-actions {
  display: flex;
  gap: 8px;
}

.device-drop-item-actions .btn {
  flex: 1;
  justify-content: center;
}

.device-drop-progress {
  margin: 10px 0 10px;
}

.device-drop-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-light);
}

.device-drop-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--gradient);
  transition: width 0.12s linear;
}

.device-drop-progress-text {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.device-drop-item-status {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.device-drop-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 10002;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: stretch;
  justify-content: stretch;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.device-drop-preview-overlay.show {
  display: flex;
}

.device-drop-preview-frame {
  width: 100%;
  height: 100%;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
}

.device-drop-preview-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.device-drop-preview-title {
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.device-drop-preview-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.device-drop-preview-body {
  flex: 1;
  min-height: 0;
  background: var(--bg-secondary);
}

.device-drop-preview-iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg-secondary);
}

@media (max-width: 480px) {
  .device-drop-tray {
    left: 12px;
    right: 12px;
    width: auto;
  }

  .device-drop-preview-actions .btn {
    flex: 1;
    justify-content: center;
  }
}


