/* ═══════════════════════════════════════════════════════════════
   GRINDLIST — FIREBASE AUTH CSS
   firebase-auth.css  — ADD THIS AS A SEPARATE FILE
   Link it in index.html AFTER style.css
   ═══════════════════════════════════════════════════════════════ */

/* ─── AUTH MODAL OVERLAY ──────────────────────────────── */
.gl-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(4, 4, 12, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: gl-bg-in 0.5s ease forwards;
}
@keyframes gl-bg-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.gl-modal-overlay.gl-modal-hiding {
  animation: gl-bg-out 0.4s ease forwards;
}
@keyframes gl-bg-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ─── MODAL CARD ──────────────────────────────────────── */
.gl-modal-card {
  position: relative;
  width: min(420px, 100%);
  background: linear-gradient(145deg, rgba(13,13,26,0.98), rgba(7,7,20,0.99));
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 32px;
  padding: 44px 36px 36px;
  text-align: center;
  overflow: hidden;
  box-shadow:
    0 40px 120px rgba(0,0,0,0.7),
    0 0 0 1px rgba(168,85,247,0.12),
    inset 0 1px 0 rgba(255,255,255,0.06);
  animation: gl-card-in 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes gl-card-in {
  from { opacity: 0; transform: scale(0.82) translateY(40px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.gl-modal-overlay.gl-modal-hiding .gl-modal-card {
  animation: gl-card-out 0.35s cubic-bezier(0.4,0,1,1) forwards;
}
@keyframes gl-card-out {
  from { opacity: 1; transform: scale(1) translateY(0); }
  to   { opacity: 0; transform: scale(0.9) translateY(24px); }
}

/* ─── BACKGROUND ORBS ──────────────────────────────────── */
.gl-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(60px);
  animation: gl-orb-float 6s ease-in-out infinite alternate;
}
.gl-orb-1 {
  width: 200px; height: 200px;
  background: rgba(168, 85, 247, 0.25);
  top: -60px; left: -60px;
  animation-duration: 7s;
}
.gl-orb-2 {
  width: 160px; height: 160px;
  background: rgba(236, 72, 153, 0.2);
  bottom: -40px; right: -40px;
  animation-duration: 5s;
  animation-delay: -2s;
}
.gl-orb-3 {
  width: 120px; height: 120px;
  background: rgba(6, 182, 212, 0.15);
  top: 50%; right: -30px;
  animation-duration: 9s;
  animation-delay: -4s;
}
@keyframes gl-orb-float {
  from { transform: scale(1) translate(0,0); }
  to   { transform: scale(1.3) translate(15px, 10px); }
}

/* ─── SKIP BUTTON ──────────────────────────────────────── */
.gl-skip-btn {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.4);
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}
.gl-skip-btn:hover {
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.25);
  transform: scale(1.1);
}

/* ─── LOGO AREA ────────────────────────────────────────── */
.gl-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}
.gl-app-icon {
  width: 52px; height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(168,85,247,0.3), rgba(236,72,153,0.3));
  border: 1px solid rgba(168,85,247,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  box-shadow: 0 8px 32px rgba(168,85,247,0.3);
  animation: gl-icon-pulse 3s ease-in-out infinite;
}
@keyframes gl-icon-pulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(168,85,247,0.3); }
  50%       { box-shadow: 0 8px 48px rgba(168,85,247,0.55); }
}
.gl-plus {
  font-size: 22px;
  font-weight: 300;
  color: rgba(255,255,255,0.3);
  line-height: 1;
}
.gl-google-logo {
  width: 52px; height: 52px;
  filter: drop-shadow(0 4px 16px rgba(66,133,244,0.4));
  border-radius: 50%;
  background: white;
  padding: 8px;
  box-shadow: 0 8px 32px rgba(66,133,244,0.3);
  animation: gl-google-bounce 3s ease-in-out infinite;
  animation-delay: 0.5s;
}
@keyframes gl-google-bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-4px); }
}

/* ─── HEADLINE ─────────────────────────────────────────── */
.gl-headline {
  font-family: 'Syne', sans-serif;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 30%, rgba(168,85,247,0.9) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
}
.gl-sub {
  font-size: 13.5px;
  color: rgba(240,240,255,0.55);
  line-height: 1.6;
  margin-bottom: 24px;
  position: relative;
  z-index: 1;
}

/* ─── FEATURE PILLS ─────────────────────────────────────── */
.gl-features {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}
.gl-feature-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 99px;
  background: rgba(168,85,247,0.1);
  border: 1px solid rgba(168,85,247,0.25);
  font-size: 11px;
  font-weight: 600;
  color: rgba(240,240,255,0.75);
  animation: gl-pill-in 0.5s cubic-bezier(0.34,1.56,0.64,1) backwards;
}
.gl-feature-pill:nth-child(1) { animation-delay: 0.2s; }
.gl-feature-pill:nth-child(2) { animation-delay: 0.3s; }
.gl-feature-pill:nth-child(3) { animation-delay: 0.4s; }
@keyframes gl-pill-in {
  from { opacity: 0; transform: scale(0.8) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.gl-fp-icon { font-size: 14px; }

/* ─── GOOGLE SIGN-IN BUTTON ──────────────────────────── */
.gl-signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 15px 24px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  background: white;
  color: #1f1f1f;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Syne', sans-serif;
  letter-spacing: 0.2px;
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow:
    0 4px 24px rgba(0,0,0,0.3),
    0 1px 3px rgba(0,0,0,0.2);
  position: relative;
  z-index: 1;
  overflow: hidden;
  animation: gl-btn-in 0.6s cubic-bezier(0.34,1.56,0.64,1) 0.35s backwards;
}
@keyframes gl-btn-in {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.gl-signin-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #f8f9ff, #f0f4ff);
  opacity: 0;
  transition: opacity 0.2s;
}
.gl-signin-btn:hover {
  transform: scale(1.03) translateY(-2px);
  box-shadow:
    0 8px 40px rgba(66,133,244,0.35),
    0 4px 12px rgba(0,0,0,0.2);
}
.gl-signin-btn:hover::before { opacity: 1; }
.gl-signin-btn:active { transform: scale(0.98); }
.gl-btn-logo {
  width: 22px; height: 22px;
  position: relative; z-index: 1;
  flex-shrink: 0;
}
.gl-signin-btn span {
  position: relative; z-index: 1;
}

/* ─── LOCAL NOTE ──────────────────────────────────────── */
.gl-local-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 12px;
  color: rgba(240,240,255,0.35);
  position: relative;
  z-index: 1;
}
.gl-local-btn {
  background: none;
  border: none;
  color: rgba(168,85,247,0.7);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  transition: color 0.2s;
  padding: 0;
}
.gl-local-btn:hover { color: var(--purple); }

/* ─── PRIVACY NOTE ────────────────────────────────────── */
.gl-privacy {
  margin-top: 12px;
  font-size: 11px;
  color: rgba(240,240,255,0.28);
  position: relative;
  z-index: 1;
}

/* ─── TOP BAR AUTH AREA ──────────────────────────────── */
.gl-auth-area {
  display: flex;
  align-items: center;
}

/* "Sign in" button (when not logged in) */
.gl-topbar-signin {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 99px;
  border: 1px solid rgba(66,133,244,0.4);
  background: rgba(66,133,244,0.1);
  color: rgba(240,240,255,0.8);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
  font-family: 'Syne', sans-serif;
  white-space: nowrap;
}
.gl-topbar-signin:hover {
  background: rgba(66,133,244,0.2);
  border-color: rgba(66,133,244,0.7);
  transform: scale(1.04);
  box-shadow: 0 0 16px rgba(66,133,244,0.3);
}

/* User chip (when logged in) */
.gl-user-chip {
  position: relative;
  cursor: pointer;
}
.gl-user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(66,133,244,0.3), rgba(168,85,247,0.3));
  border: 2px solid rgba(66,133,244,0.5);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  overflow: hidden;
  transition: all 0.2s;
  box-shadow: 0 0 0 0 rgba(66,133,244,0);
}
.gl-user-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.gl-user-avatar:hover {
  border-color: rgba(66,133,244,0.9);
  box-shadow: 0 0 16px rgba(66,133,244,0.4);
  transform: scale(1.08);
}

/* User dropdown */
.gl-user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 240px;
  background: rgba(13,13,26,0.97);
  border: 1px solid rgba(168,85,247,0.3);
  border-radius: 18px;
  backdrop-filter: blur(30px);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(168,85,247,0.08);
  animation: gl-dd-in 0.3s cubic-bezier(0.34,1.56,0.64,1);
  transform-origin: top right;
  z-index: 9999;
}
@keyframes gl-dd-in {
  from { opacity: 0; transform: scale(0.88) translateY(-10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.gl-ud-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.gl-ud-photo {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid rgba(66,133,244,0.4);
}
.gl-ud-name {
  font-family: 'Syne', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: rgba(240,240,255,0.95);
}
.gl-ud-email {
  font-size: 10px;
  color: rgba(240,240,255,0.4);
  margin-top: 2px;
  font-family: 'Space Mono', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}
.gl-ud-sync-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  font-size: 12px;
}
.gl-ud-sync-label { color: rgba(240,240,255,0.5); }
.gl-ud-sync-status {
  color: #34d399;
  font-weight: 700;
  font-size: 11px;
  background: rgba(52,211,153,0.1);
  border: 1px solid rgba(52,211,153,0.3);
  border-radius: 99px;
  padding: 2px 8px;
}
.gl-ud-signout {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  color: rgba(239,68,68,0.8);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  font-family: 'Syne', sans-serif;
}
.gl-ud-signout:hover {
  background: rgba(239,68,68,0.1);
  color: #ef4444;
}

/* ─── SYNC INDICATOR ──────────────────────────────────── */
.gl-sync-indicator {
  position: fixed;
  top: 70px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 99px;
  background: rgba(13,13,26,0.92);
  border: 1px solid rgba(168,85,247,0.3);
  backdrop-filter: blur(20px);
  font-size: 12px;
  font-weight: 600;
  color: rgba(240,240,255,0.7);
  z-index: 9990;
  animation: gl-sync-slide 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes gl-sync-slide {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}
.gl-sync-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(168,85,247,0.3);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: gl-spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes gl-spin { to { transform: rotate(360deg); } }

/* ─── SYNC PING ───────────────────────────────────────── */
.gl-sync-ping {
  position: fixed;
  bottom: calc(var(--nav-h, 72px) + 80px);
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 16px;
  border-radius: 99px;
  background: rgba(52,211,153,0.15);
  border: 1px solid rgba(52,211,153,0.35);
  color: #34d399;
  font-size: 12px;
  font-weight: 700;
  z-index: 9000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.gl-sync-ping.gl-sync-ping-visible {
  opacity: 1;
  animation: gl-ping-float 2s ease forwards;
}
@keyframes gl-ping-float {
  0%   { opacity: 0; transform: translateX(-50%) translateY(10px); }
  15%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* ─── PROFILE CLOUD BADGE ──────────────────────────────── */
.gl-profile-cloud {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}
.gl-cloud-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 99px;
  background: rgba(52,211,153,0.12);
  border: 1px solid rgba(52,211,153,0.3);
  font-size: 12px;
  font-weight: 600;
  color: #34d399;
}

/* ─── LIGHT MODE ──────────────────────────────────────── */
.light-mode .gl-modal-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.97), rgba(248,247,255,0.99));
  border-color: rgba(168,85,247,0.25);
  box-shadow: 0 40px 120px rgba(0,0,0,0.2), 0 0 0 1px rgba(168,85,247,0.1);
}
.light-mode .gl-headline {
  background: linear-gradient(135deg, #1a1a2e 30%, #a855f7 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.light-mode .gl-sub { color: rgba(26,26,46,0.55); }
.light-mode .gl-feature-pill { color: rgba(26,26,46,0.7); }
.light-mode .gl-local-note { color: rgba(26,26,46,0.4); }
.light-mode .gl-privacy { color: rgba(26,26,46,0.3); }
.light-mode .gl-user-dropdown { background: rgba(255,255,255,0.97); }
.light-mode .gl-ud-name { color: rgba(26,26,46,0.95); }
.light-mode .gl-sync-indicator { background: rgba(255,255,255,0.95); color: rgba(26,26,46,0.7); }

/* ─── MOBILE ──────────────────────────────────────────── */
@media (max-width: 400px) {
  .gl-modal-card { padding: 36px 24px 28px; border-radius: 24px; }
  .gl-headline { font-size: 24px; }
  .gl-features { gap: 6px; }
  .gl-feature-pill { font-size: 10px; padding: 5px 10px; }
}