/* drive-onboarding.css
 * Premium dark-glass modal that matches the rest of Grafo's modals.
 * Loaded after polish-final.css so it overrides any previous .modal
 * defaults. Also styles the small sync badge in the topbar.
 */

#drive-onboarding-modal {
  position: fixed;
  inset: 0;
  z-index: 12500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
#drive-onboarding-modal.hidden { display: none !important; }

#drive-onboarding-modal .modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 9, 12, 0.65);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
}

.drive-onboarding-card {
  position: relative;
  z-index: 1;
  width: min(540px, calc(100vw - 32px));
  border-radius: 18px;
  padding: 24px 24px 20px;
  background: rgba(20, 22, 28, 0.85);
  color: var(--text-1, #f5f5f7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.55),
    0 6px 18px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: dobIn 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
[data-theme="light"] .drive-onboarding-card {
  background: rgba(255, 255, 255, 0.96);
  color: #0a0a0a;
  border-color: rgba(15, 18, 28, 0.12);
}

@keyframes dobIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.drive-onboarding-card .dob-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 28px;
  background: linear-gradient(180deg, rgba(96, 165, 250, 0.20), rgba(96, 165, 250, 0.05));
  border: 1px solid rgba(96, 165, 250, 0.32);
  margin-bottom: 14px;
}

.drive-onboarding-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: -0.01em;
  font-weight: 600;
}

.drive-onboarding-card .dob-body {
  margin: 0 0 14px;
  line-height: 1.55;
  color: var(--text-2, rgba(245, 245, 247, 0.78));
  font-size: 14px;
}

.drive-onboarding-card .dob-privacy {
  margin: 0 0 18px;
  font-size: 12.5px;
  color: var(--text-3, rgba(245, 245, 247, 0.55));
  display: flex;
  align-items: center;
  gap: 6px;
}
.drive-onboarding-card .dob-privacy::before {
  content: "🔒";
  font-size: 13px;
}

.drive-onboarding-card .dob-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.drive-onboarding-card .dob-actions .btn {
  padding: 9px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-1, #f5f5f7);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: background 120ms ease, transform 120ms ease;
}
.drive-onboarding-card .dob-actions .btn:hover { background: rgba(255, 255, 255, 0.12); }
.drive-onboarding-card .dob-actions .btn:active { transform: scale(0.98); }
.drive-onboarding-card .dob-actions .btn.btn-primary {
  background: #fff;
  color: #0a0a0a;
  border-color: #fff;
}
.drive-onboarding-card .dob-actions .btn.btn-primary:hover {
  background: rgba(255, 255, 255, 0.92);
}
.drive-onboarding-card .dob-actions .btn.btn-ghost {
  background: transparent;
  color: var(--text-2, rgba(245, 245, 247, 0.66));
}
.drive-onboarding-card .dob-actions .btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.drive-onboarding-card .dob-msg {
  margin-top: 12px;
  min-height: 18px;
  font-size: 12.5px;
}
.drive-onboarding-card .dob-msg.error { color: #ff8b8b; }
.drive-onboarding-card .dob-msg.pending { color: var(--text-2, rgba(245, 245, 247, 0.62)); }

@media (max-width: 600px) {
  #drive-onboarding-modal { padding: 12px; }
  .drive-onboarding-card { padding: 18px 18px 16px; }
  .drive-onboarding-card .dob-actions { flex-direction: column; align-items: stretch; }
  .drive-onboarding-card .dob-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .drive-onboarding-card { animation: none !important; }
}

/* ── Small sync badge in the topbar ───────────────────────────────── */
.drive-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--border, rgba(255, 255, 255, 0.14));
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-2, rgba(245, 245, 247, 0.74));
  cursor: pointer;
  user-select: none;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
  /* Never grow past a compact width or push the action buttons. */
  flex: 0 0 auto;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  margin-right: 4px;
}
.drive-sync-badge:hover { background: rgba(255, 255, 255, 0.12); color: var(--text-1, #f5f5f7); }
.drive-sync-badge .dsb-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drive-sync-badge .dsb-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.5);
}
.drive-sync-badge[data-state="saved"]        .dsb-dot { background: #7ee787; }
.drive-sync-badge[data-state="syncing"]      .dsb-dot { background: #ffb86b; animation: dsbPulse 1.2s ease-in-out infinite; }
.drive-sync-badge[data-state="not-connected"] .dsb-dot { background: rgba(255, 255, 255, 0.45); }
.drive-sync-badge[data-state="needs-reconnect"] .dsb-dot { background: #ffd166; }
.drive-sync-badge[data-state="local-saved"]  .dsb-dot { background: rgba(96, 165, 250, 0.7); }
.drive-sync-badge[data-state="offline"]      .dsb-dot { background: #f5a86b; }
.drive-sync-badge[data-state="error"]        .dsb-dot { background: #ff8b8b; }
.drive-sync-badge[data-state="conflict"]     .dsb-dot { background: #ffd166; }

@keyframes dsbPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.85); }
}

/* On narrow viewports hide the text label — show only the coloured dot
   so the badge never competes for space with share / star / more. */
@media (max-width: 720px) {
  .drive-sync-badge {
    padding: 6px;
    max-width: none;
  }
  .drive-sync-badge .dsb-label { display: none; }
}
