/* Firebase Auth Modal Styles */
.auth-modal {
  position: fixed;
  inset: 0;
  background: rgba(44, 58, 71, 0.9);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
}

.auth-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.auth-card {
  background: var(--paper);
  width: 90%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 40px 100px rgba(0,0,0,0.3);
  position: relative;
  border: 1px solid var(--border);
  animation: modalScale 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.auth-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  transition: 0.2s;
  z-index: 10;
}

.auth-close:hover {
  color: var(--ink);
}

.auth-card::-webkit-scrollbar {
  width: 6px;
}
.auth-card::-webkit-scrollbar-track {
  background: transparent;
}
.auth-card::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
  border-radius: 10px;
}
.auth-card::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.2);
}

@keyframes modalScale {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-logo {
  font-size: 24px;
  margin-bottom: 12px;
}

.auth-card h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 8px;
}

.auth-card p {
  font-size: 14px;
  color: var(--muted);
  font-weight: 300;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-field label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
}

.auth-input {
  background: white;
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: 0.2s;
}

.auth-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(184, 144, 107, 0.1);
}

.auth-btn {
  height: 52px;
  background: var(--ink);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: 10px;
}

#googleLoginBtn {
  text-transform: none;
  font-size: 13px;
  font-weight: 500;
}

.auth-btn:hover {
  background: var(--accent);
  color: var(--ink);
  transform: translateY(-2px);
}

.auth-switch {
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
  color: var(--muted);
}

.auth-switch a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  margin-left: 4px;
  cursor: pointer;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--muted);
  cursor: pointer;
  line-height:1;
}

.login-status-btn {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  background: rgba(184, 144, 107, 0.08);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 100px;
  cursor: pointer;
  transition: 0.2s;
}

.login-status-btn:hover {
  border-color: var(--accent);
  color: var(--ink);
  background: var(--warm);
}

.user-profile-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--accent);
  color: var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  min-width: 180px;
  margin-top: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  overflow: hidden;
  display: none;
  z-index: 1000;
}

.user-dropdown.active {
  display: block;
}

.dropdown-item {
  padding: 12px 16px;
  font-size: 12px;
  color: var(--ink);
  cursor: pointer;
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dropdown-item:hover {
  background: var(--warm);
}

.dropdown-item.logout {
  border-top: 1px solid var(--border);
  color: var(--danger);
}

/* ── CLOUD DASHBOARD MODAL ── */
.cloud-modal {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(15, 20, 28, 0.85); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
}
.cloud-modal-content {
  background: #FDFBF7; width: 90%; max-width: 680px;
  border: 1px solid #E2D9CF; padding: 24px 32px;
  max-height: 80vh; display: flex; flex-direction: column;
}
.cm-header {
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 2px solid #E2D9CF; padding-bottom: 16px; margin-bottom: 16px;
}
.cm-header h2 { font-size: 1.2rem; color: #1C2330; margin: 0; }
.cm-close {
  background: none; border: none; font-size: 24px; color: #7A8694; cursor: pointer;
  line-height: 1; padding: 0; margin-top: -4px;
}
.cm-close:hover { color: #A8440A; }
.cm-body {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
  padding-right: 8px;
}
.loader, .empty-state {
  text-align: center; color: #7A8694; font-size: 0.9rem; margin-top: 20px;
}
.cm-card {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px; background: #fff; border: 1px solid #E2D9CF; transition: 0.2s;
}
.cm-card:hover { border-color: #B8906B; }
.cm-info { display: flex; flex-direction: column; gap: 4px; }
.cm-title { font-size: 0.95rem; font-weight: 700; margin: 0; color: #1C2330; }
.cm-date { font-size: 0.75rem; color: #7A8694; }
.cm-badge { 
  display: inline-block; font-size: 0.65rem; background: #2A7A6A; color: white;
  padding: 2px 6px; font-weight: 700; letter-spacing: 1px; width: max-content; margin-top: 4px;
}
.cm-actions { display: flex; gap: 8px; }
.cm-btn {
  font-family: inherit; font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; border: none; padding: 8px 12px; cursor: pointer; transition: 0.15s;
}
.cm-load { background: #B8906B; color: #1C2330; }
.cm-load:hover { background: #1C2330; color: white; }
.cm-pub { background: transparent; border: 1px solid #E2D9CF; color: #7A8694; }
.cm-pub:hover { border-color: #1C2330; color: #1C2330; }
.cm-del { background: transparent; color: #A8440A; border: 1px solid transparent; }
.cm-del:hover { background: rgba(168, 68, 10, 0.1); border-color: rgba(168, 68, 10, 0.2); }
