/* ═══════════════════════════════════════════════
   FIREBASE UI — Auth, Profiles, Post Management
   ═══════════════════════════════════════════════ */

/* ── Google Sign-In Button ──────────────────── */
.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 24px;
  background: #fff;
  color: #3c4043;
  border: 1px solid #dadce0;
  border-radius: 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
}
.google-btn:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}
.google-btn:active {
  transform: translateY(0);
}
.google-btn svg {
  flex-shrink: 0;
}

/* ── User Nav Area ──────────────────────────── */
.user-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 10px;
  transition: background 0.15s;
  position: relative;
}
.user-nav:hover {
  background: var(--surface2);
}
.user-nav-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-nav svg {
  color: var(--ink-muted);
  transition: transform 0.2s;
}
.user-nav.open svg {
  transform: rotate(180deg);
}

/* ── User Avatar in Nav ─────────────────────── */
.user-avatar-nav {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.user-avatar-nav-fallback {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--bg);
  background: var(--accent);
  flex-shrink: 0;
}

/* ── User Dropdown Menu ─────────────────────── */
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  min-width: 200px;
  padding: 6px 0;
  z-index: 500;
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
}
.user-dropdown.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.user-dropdown-header {
  padding: 12px 16px 10px;
  font-size: 12px;
  color: var(--ink-muted);
  font-family: 'DM Mono', monospace;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.user-dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  text-align: left;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.12s;
}
.user-dropdown-item:hover {
  background: var(--surface2);
}
.user-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}
.user-dropdown-signout {
  color: #dc2626;
}
.user-dropdown-signout:hover {
  background: rgba(220, 38, 38, 0.06);
}

/* ── Profile Avatar Edit ────────────────────── */
.profile-avatar-edit {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--surface2);
}
.profile-avatar-edit:hover .profile-avatar-overlay {
  opacity: 1;
}
.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  opacity: 0;
  transition: opacity 0.15s;
  border-radius: 50%;
}

/* ── Username Input ─────────────────────────── */
.username-input-wrap {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  transition: border-color 0.15s;
}
.username-input-wrap:focus-within {
  border-color: var(--accent);
}
.username-prefix {
  color: var(--ink-muted);
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  user-select: none;
}
.username-input-wrap input {
  border: none;
  background: none;
  padding: 10px 4px;
  font-size: 13px;
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', sans-serif;
  flex: 1;
  outline: none;
}
.username-status {
  font-size: 14px;
  min-width: 18px;
  text-align: center;
}

/* ── My Vibes Modal ─────────────────────────── */
.my-vibes-list {
  max-height: 400px;
  overflow-y: auto;
}
.my-vibes-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.my-vibes-row:last-child {
  border-bottom: none;
}
.my-vibes-row-info {
  flex: 1;
  min-width: 0;
}
.my-vibes-row-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.my-vibes-row-meta {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--ink-muted);
  font-family: 'DM Mono', monospace;
}
.my-vibes-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.my-vibes-row-actions button {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.12s;
}
.my-vibes-row-actions button:hover {
  background: var(--surface2);
}
.my-vibes-row-actions .delete-btn {
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.2);
}
.my-vibes-row-actions .delete-btn:hover {
  background: rgba(220, 38, 38, 0.08);
}
.my-vibes-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-muted);
  font-size: 14px;
}

/* ── Loading Skeleton Cards ─────────────────── */
.skeleton-card {
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}
.skeleton-card::before {
  content: '';
  display: block;
  padding-top: 100%;
}
.skeleton-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--surface2) 40%,
    var(--surface2) 60%,
    transparent 100%
  );
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
}
@keyframes skeleton-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── Community Card Preview (no custom HTML) ── */
.community-preview {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  position: relative;
}
.community-preview-title {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.5px;
  line-height: 1.3;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.community-preview-tag {
  margin-top: 10px;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  font-family: 'DM Mono', monospace;
  backdrop-filter: blur(4px);
}
.community-gradient-1 { background: linear-gradient(135deg, #667eea, #764ba2); }
.community-gradient-2 { background: linear-gradient(135deg, #f093fb, #f5576c); }
.community-gradient-3 { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.community-gradient-4 { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.community-gradient-5 { background: linear-gradient(135deg, #fa709a, #fee140); }
.community-gradient-6 { background: linear-gradient(135deg, #a18cd1, #fbc2eb); }
.community-gradient-7 { background: linear-gradient(135deg, #fccb90, #d57eeb); }
.community-gradient-8 { background: linear-gradient(135deg, #e0c3fc, #8ec5fc); }

/* ── Delete Confirmation Modal ──────────────── */
.delete-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 700;
}

/* ── Enhanced nav-right for dropdown context ── */
.nav-right {
  position: relative;
}

/* ── Responsive adjustments ─────────────────── */
@media (max-width: 640px) {
  .user-nav-name {
    display: none;
  }
  .user-dropdown {
    right: -8px;
    min-width: 180px;
  }
  .my-vibes-row {
    flex-wrap: wrap;
  }
  .my-vibes-row-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 6px;
  }
}
