/* ============================================================
   Project Hub Studio Website — Theme Variables + Base Styles
   Uses CSS custom properties set by data-theme attribute.
   ============================================================ */

/* ---- Base body using theme vars ---- */
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: background 0.3s ease, color 0.3s ease;
}

/* ---- Glassmorphism ---- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

/* ---- Glow Effects ---- */
.glow-blue {
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.25), 0 0 60px rgba(99, 102, 241, 0.08);
}

.glow-red {
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.25), 0 0 60px rgba(239, 68, 68, 0.08);
}

/* ---- Password Strength Bar ---- */
.password-strength {
  height: 4px;
  border-radius: 2px;
  background: var(--glass-highlight);
  overflow: hidden;
  transition: width 0.4s ease;
}

.password-strength::after {
  content: "";
  display: block;
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s ease, background 0.4s ease;
}

.strength-weak::after { width: 25%; background: #ef4444; }
.strength-medium::after { width: 55%; background: #f59e0b; }
.strength-strong::after { width: 100%; background: #22c55e; }

/* ---- Auth Container ---- */
.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
}

/* ---- Input Field ---- */
.input-field {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-input, var(--text-primary));
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.input-field:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-field::placeholder { color: var(--text-muted); }
.input-field.error { border-color: rgba(239, 68, 68, 0.5); }
.input-field.error:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15); }

/* ---- Buttons ---- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  background: var(--accent-primary);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover { opacity: 0.9; box-shadow: 0 0 20px rgba(99, 102, 241, 0.3); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  background: var(--accent-danger);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.2s ease, box-shadow 0.2s ease;
}

.btn-danger:hover { opacity: 0.9; box-shadow: 0 0 20px rgba(239, 68, 68, 0.3); }
.btn-danger:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

/* ---- Sidebar ---- */
.sidebar-active {
  background: var(--sidebar-active-bg);
  border-left: 3px solid var(--sidebar-active-border);
  color: var(--text-primary);
}

/* ---- Tabs ---- */
.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
}

.tab-item {
  flex: 1;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.tab-item:hover { color: var(--text-primary); }
.tab-item.active {
  background: var(--bg-hover);
  color: var(--text-primary);
  font-weight: 600;
}

/* ---- Skeleton Loading ---- */
@keyframes skeleton-shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.04) 100%
  );
  background-size: 200px 100%;
  animation: skeleton-shimmer 1.5s infinite ease-in-out;
  border-radius: 8px;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  box-shadow: var(--shadow);
  animation: toast-slide-in 0.3s ease-out;
}

.toast-success { background: rgba(22, 163, 74, 0.9); }
.toast-error { background: rgba(220, 38, 38, 0.9); }
.toast-warning { background: rgba(217, 119, 6, 0.9); }
.toast-info { background: rgba(79, 70, 229, 0.9); }

@keyframes toast-slide-in {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ---- Tooltip ---- */
.tooltip { position: relative; }

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-primary);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.tooltip:hover::after { opacity: 1; }

/* ---- Theme Selector ---- */
.theme-selector-container {
  display: inline-flex;
  align-items: center;
}

.theme-dropdown {
  position: relative;
}

.theme-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.theme-trigger:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.theme-chevron {
  font-size: 10px;
  margin-left: 2px;
  transition: transform 0.2s ease;
}

.theme-dropdown.open .theme-chevron {
  transform: rotate(180deg);
}

.theme-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 99999;
  display: none;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

.theme-dropdown.open .theme-menu {
  display: block;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  text-align: left;
}

.theme-option:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.theme-option.theme-active {
  background: var(--sidebar-active-bg);
  color: var(--text-primary);
}

.theme-option-icon {
  width: 20px;
  text-align: center;
  font-size: 14px;
  color: inherit;
  flex-shrink: 0;
}

.theme-check {
  margin-left: auto;
  font-size: 11px;
  color: var(--accent-success, #22c55e);
}

.theme-trigger-label {
  display: none;
}

@media (min-width: 768px) {
  .theme-trigger-label {
    display: inline;
  }
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ---- Selection ---- */
::selection { background: rgba(99, 102, 241, 0.35); color: #ffffff; }
::-moz-selection { background: rgba(99, 102, 241, 0.35); color: #ffffff; }

/* ---- Brand gradient (uses its own colors) ---- */
.brand-gradient {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---- ProjectHub SSO button ---- */
.btn-projecthub {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.65rem 1rem;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 0.625rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}

.btn-projecthub:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.55);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  color: var(--text-primary);
  text-decoration: none;
}

.ph-icon-wrapper {
  width: 1.25rem;
  height: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  background: linear-gradient(135deg, #6366f1, #a78bfa);
  flex-shrink: 0;
  color: #fff;
}

/* ---- Auth provider buttons ---- */
.auth-providers {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.btn-provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: 0.625rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
}

.btn-provider:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
  color: var(--text-primary);
  text-decoration: none;
}

.btn-google:hover {
  border-color: rgba(234, 67, 53, 0.4);
  box-shadow: 0 0 0 3px rgba(234, 67, 53, 0.1);
}

.btn-metamask:hover {
  border-color: rgba(246, 133, 27, 0.4);
  box-shadow: 0 0 0 3px rgba(246, 133, 27, 0.1);
}

/* ---- Auth divider ---- */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

/* ---- Auth link ---- */
.auth-link {
  color: var(--text-link);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.2s;
}

.auth-link:hover {
  color: var(--text-link-hover);
  text-decoration: underline;
}

/* ---- Error message ---- */
.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
}

/* ---- Landing Page ---- */
.landing-content {
  animation: fade-in-up 0.4s ease-out;
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
}

.quick-link:hover {
  background: var(--bg-hover);
  border-color: var(--border-focus);
  color: var(--text-primary);
}

.quick-link i {
  width: 16px;
  text-align: center;
  flex-shrink: 0;
}

.feature-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  transition: all 0.15s ease;
}

.feature-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-hover);
}

.feature-card i {
  font-size: 16px;
  margin-top: 2px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.feature-card strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
}

.feature-card small {
  font-size: 11px;
}

.stat-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
}

.stat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

kbd {
  font-family: 'Outfit', monospace;
  padding: 0.125rem 0.375rem;
  border-radius: 0.25rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  font-size: 0.8rem;
}

/* ---- Spinner ---- */
.spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

@media (max-width: 768px) {
  .auth-left-panel { display: none; }
}

/* ---- Dashboard Sections ---- */
.section-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.data-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(12px);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}

.data-table tr:last-child td { border-bottom: none; }

.action-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.action-card:hover {
  border-color: var(--border-focus);
  background: var(--bg-hover);
}

.action-card span {
  color: var(--text-secondary);
  font-weight: 500;
}

.event-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success { background: rgba(34, 197, 94, 0.12); color: #4ade80; }
.badge-warning { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
.badge-info { background: rgba(99, 102, 241, 0.12); color: #818cf8; }

/* ---- Theme Editor Modal ---- */
.theme-editor-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.theme-editor-modal {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.theme-editor-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  gap: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.theme-editor-field:last-of-type {
  border-bottom: none;
}

.theme-editor-field input[type="color"] {
  width: 42px;
  height: 34px;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  cursor: pointer;
  padding: 2px;
  background: var(--bg-input);
}

.theme-editor-field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.theme-editor-field input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 0.25rem;
}

/* ---- Focus-visible accessibility ---- */
.btn-primary:focus-visible,
.btn-ghost:focus-visible,
.btn-danger:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

/* ── PH Multi-Account Picker ─────────────────────────────────────────── */
.ph-account-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.12s;
}
.ph-account-item:hover { background: var(--bg-secondary, rgba(255,255,255,0.06)); }
.ph-account-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.ph-account-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-account-remove {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 1rem; padding: 0 0.2rem;
  opacity: 0; transition: opacity 0.12s; line-height: 1;
}
.ph-account-item:hover .ph-account-remove { opacity: 1; }
.ph-account-remove:hover { color: var(--danger, #ef4444); }
.ph-account-divider {
  height: 1px;
  background: var(--border-color, #334155);
  margin: 0.25rem 0.4rem;
}
.ph-account-add:hover { background: rgba(99,102,241,0.12); }
