/* ABOUTME: Shared stylesheet loaded by all PlotMyDoc pages. */
/* ABOUTME: Design system variables, notifications, loading overlay, and responsive breakpoints. */

:root {
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-400: #60a5fa;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-900: #1e3a5f;
  --blue-950: #0f2137;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-600: #4b5563;
  --radius: 8px;
}

:focus-visible {
  outline: 2px solid var(--blue-500, #3b82f6);
  outline-offset: 2px;
}

/* Notification bar */

@keyframes slide-down {
  from {
    transform: translateX(-50%) translateY(-12px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

.notification {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  animation: slide-down 0.25s ease-out;
}

.notification-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.notification-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.notification-info {
  background: var(--blue-50);
  color: var(--blue-700);
  border: 1px solid var(--blue-200);
}

.notification-confirm {
  background: #fff;
  color: var(--slate-700);
  border: 1px solid var(--slate-200);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.notification-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: inherit;
  opacity: 0.5;
}

.notification-close:hover {
  opacity: 1;
}

.notification-action {
  font-weight: 700;
  text-decoration: underline;
  color: inherit;
}

/* Confirm buttons */

.confirm-buttons {
  display: inline-flex;
  gap: 8px;
  margin-left: 12px;
}

.confirm-yes {
  padding: 4px 12px;
  background: var(--blue-600);
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.confirm-no {
  padding: 4px 12px;
  background: transparent;
  color: var(--slate-500);
  border: 1px solid var(--slate-300);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

/* Loading overlay */

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 4px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--slate-200);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Auth UI */

.auth-signin {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
  background: #fff;
  border: 1px solid var(--slate-300);
  border-radius: var(--radius);
  text-decoration: none;
  transition: all 0.15s;
}

.auth-signin:hover {
  border-color: var(--blue-500);
  color: var(--blue-600);
}

.auth-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #6c63ff;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.auth-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-600);
}

.auth-logout {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-400);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s;
}

.auth-logout:hover {
  color: var(--slate-600);
  background: var(--slate-100);
}

/* Mobile banner (hidden by default) */

.mobile-banner {
  display: none;
}

/* Responsive */

@media (max-width: 768px) {
  main {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 1fr !important;
  }

  #sidebar {
    max-height: 40vh;
  }
}

@media (max-width: 480px) {
  .mobile-banner {
    display: block !important;
  }
}
