/* =========================================================
   Ethereum Bliss – My Account page styles
   - Hover zoom for sections
   - Auth modal
   - Big counters
   - Weekly pie chart
   - Loan dashboard visuals
   ========================================================= */

.page-account .panel {
  transition:
    transform 0.2s ease-out,
    box-shadow 0.2s ease-out,
    border-color 0.2s ease-out;
}

.page-account .panel:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 16px 45px rgba(15, 23, 42, 0.9);
  border-color: rgba(129, 140, 248, 0.8);
}

/* Generic helper */
.hidden {
  display: none !important;
}

/* Topbar user text */
.topbar-user-line {
  font-size: 0.8rem;
  color: #e5e7eb;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

/* Hide the name completely – show email only */
.topbar-user-name {
  display: none;
}

.topbar-user-email {
  color: #9ca3af;
  font-weight: 500;
}

/* =================== Auth modal =================== */

.auth-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.98));
  z-index: 80;
  padding: 1.5rem;
}

.auth-backdrop.is-open {
  display: flex;
}

.modal-open {
  overflow: hidden;
}

.auth-modal {
  width: 100%;
  max-width: 460px;
  border-radius: 1.2rem;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: linear-gradient(150deg, rgba(15, 23, 42, 0.98), rgba(30, 64, 175, 0.82));
  box-shadow:
    0 20px 60px rgba(15, 23, 42, 0.9),
    0 0 0 1px rgba(129, 140, 248, 0.25);
  padding: 1.4rem 1.5rem;
  color: #e5e7eb;
}

.auth-modal-header h2 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  color: #f9fafb;
}

.auth-modal-header p {
  margin: 0;
  font-size: 0.8rem;
  color: #cbd5f5;
}

/* Tabs */
.auth-tabs {
  display: inline-flex;
  margin-top: 1rem;
  padding: 0.18rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
}

.auth-tab-btn {
  border: none;
  background: transparent;
  color: #cbd5f5;
  font-size: 0.78rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background-color 0.16s ease-out,
    color 0.16s ease-out,
    transform 0.12s ease-out;
}

.auth-tab-btn.active {
  background: radial-gradient(circle at top left, rgba(129, 140, 248, 0.9), rgba(37, 99, 235, 0.98));
  color: #0f172a;
  transform: translateY(-1px);
}

.auth-forms {
  margin-top: 1rem;
}

/* Forms inside modal */
.auth-form .form-row {
  margin-bottom: 0.7rem;
}

.auth-form label {
  display: block;
  font-size: 0.78rem;
  margin-bottom: 0.25rem;
  color: #e5e7eb;
}

.auth-form input {
  width: 100%;
  border-radius: 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: rgba(15, 23, 42, 0.95);
  color: #f9fafb;
  padding: 0.45rem 0.7rem;
  font-size: 0.8rem;
  outline: none;
  transition:
    border-color 0.16s ease-out,
    box-shadow 0.16s ease-out,
    background-color 0.16s ease-out;
}

.auth-form input::placeholder {
  color: #64748b;
}

.auth-form input:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.8);
  background: rgba(15, 23, 42, 0.98);
}

.password-field {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.password-field input {
  flex: 1;
}

.password-toggle {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.98);
  color: #e5e7eb;
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  transition:
    background-color 0.16s ease-out,
    color 0.16s ease-out,
    border-color 0.16s ease-out,
    transform 0.12s ease-out;
}

.password-toggle:hover {
  background: rgba(129, 140, 248, 0.95);
  color: #0f172a;
  border-color: rgba(129, 140, 248, 1);
  transform: translateY(-1px);
}

.auth-message {
  min-height: 1rem;
  font-size: 0.74rem;
  margin: 0.1rem 0 0.3rem;
}

.auth-message.error {
  color: #fca5a5;
}

.auth-message.success {
  color: #bbf7d0;
}

.auth-form .form-actions {
  margin-top: 0.2rem;
  display: flex;
  justify-content: flex-end;
}

/* =================== Big animated metrics =================== */

.metrics-panel .metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 0.6rem;
}

.metric-card {
  position: relative;
  border-radius: 1rem;
  padding: 0.75rem 0.9rem;
  background: radial-gradient(circle at top, rgba(30, 64, 175, 0.9), rgba(15, 23, 42, 1));
  border: 1px solid rgba(129, 140, 248, 0.65);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.9);
  cursor: default;
  transform-origin: center;
  transition:
    transform 0.18s ease-out,
    box-shadow 0.18s ease-out,
    border-color 0.18s ease-out;
}

.metric-card:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 1);
  border-color: rgba(251, 191, 36, 0.9);
}

.metric-number {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: baseline;
  gap: 0.15rem;
  color: #fbbf24;
}

.metric-plus {
  font-size: 1rem;
}

.metric-label {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: #e5e7eb;
}

/* =================== Weekly pie chart =================== */

.weekly-layout {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 1.1rem;
  align-items: center;
}

.weekly-pie-card {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.weekly-pie {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at center, #020617 45%, transparent 46%),
              conic-gradient(#1d4ed8 0 360deg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.7);
  position: relative;
  overflow: hidden;
  transition:
    transform 0.18s ease-out,
    box-shadow 0.18s ease-out,
    border-color 0.18s ease-out;
}

.weekly-pie:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 1);
  border-color: rgba(251, 191, 36, 0.9);
}

.weekly-pie-inner {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 1));
  border: 1px solid rgba(148, 163, 184, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.25rem;
  z-index: 1;
}

.weekly-total-label {
  font-size: 0.65rem;
  color: #e5e7eb;
}

.weekly-total-value {
  font-size: 0.8rem;
  font-weight: 600;
  color: #fbbf24;
}

.weekly-note {
  margin-top: 0.35rem;
  font-size: 0.7rem;
  color: #9ca3af;
}

.weekly-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 0.7rem;
}

.weekly-day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.55rem;
  border-radius: 0.65rem;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.4);
  font-size: 0.78rem;
  cursor: pointer;
  transition:
    transform 0.16s ease-out,
    box-shadow 0.16s ease-out,
    border-color 0.16s ease-out,
    background-color 0.16s ease-out;
}

.weekly-day:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.95);
  border-color: rgba(251, 191, 36, 0.9);
  background: radial-gradient(circle at top left, rgba(30, 64, 175, 0.9), rgba(15, 23, 42, 0.98));
}

.weekly-day-label {
  font-weight: 600;
  color: #e5e7eb;
}

.weekly-day-amount {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #cbd5f5;
}

/* Highlighted from JS */
.weekly-day.is-active {
  border-color: rgba(251, 191, 36, 1);
  background: radial-gradient(circle at top left, rgba(251, 191, 36, 0.22), rgba(15, 23, 42, 0.98));
}

/* =================== Notifications =================== */

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.notification-card {
  position: relative;
  border-radius: 0.9rem;
  padding: 0.65rem 0.85rem 0.65rem 1.9rem;
  background: radial-gradient(circle at top left, rgba(129, 140, 248, 0.18), rgba(15, 23, 42, 0.98));
  border: 1px solid rgba(129, 140, 248, 0.7);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.95);
  font-size: 0.8rem;
  transition:
    transform 0.16s ease-out,
    box-shadow 0.16s ease-out,
    border-color 0.16s ease-out,
    background-color 0.16s ease-out;
}

/* Emoji icon on each notification, without changing location in layout */
.notification-card::before {
  content: "🔔";
  position: absolute;
  left: 0.7rem;
  top: 0.75rem;
  font-size: 1rem;
}

.notification-card:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 20px 46px rgba(15, 23, 42, 1);
  border-color: rgba(251, 191, 36, 0.9);
  background: radial-gradient(circle at top left, rgba(251, 191, 36, 0.22), rgba(15, 23, 42, 0.98));
}

.notification-title {
  font-weight: 700;
  color: #f9fafb;
}

.notification-body {
  margin: 0.15rem 0;
  color: #e5e7eb;
}

.notification-meta {
  font-size: 0.7rem;
  color: #cbd5f5;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.notifications-empty {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: #9ca3af;
}

/* =================== Loan dashboard =================== */

.loan-dashboard-header {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}

.loan-toggle {
  display: inline-flex;
  background: rgba(15, 23, 42, 0.96);
  border-radius: 999px;
  padding: 0.15rem;
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.loan-toggle-btn {
  border: none;
  background: transparent;
  color: #cbd5f5;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-size: 0.78rem;
  cursor: pointer;
  transition:
    background-color 0.16s ease-out,
    color 0.16s ease-out,
    transform 0.12s ease-out;
}

.loan-toggle-btn.active {
  background: radial-gradient(circle at top left, rgba(129, 140, 248, 0.95), rgba(37, 99, 235, 1));
  color: #020617;
  transform: translateY(-1px);
}

.loan-dashboard-note {
  font-size: 0.78rem;
  color: #e5e7eb;
}

.loan-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 0.9rem;
  align-items: flex-start;
}

.hover-zoom {
  transition:
    transform 0.16s ease-out,
    box-shadow 0.16s ease-out,
    border-color 0.16s ease-out;
}

.hover-zoom:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.95);
  border-color: rgba(129, 140, 248, 0.9);
}

.loan-balance-card,
.loan-breakdown-card,
.loan-graphs-card,
.loan-action-card {
  border-radius: 0.9rem;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.55);
  padding: 0.7rem 0.85rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.9);
}

.loan-balance-label {
  font-size: 0.8rem;
  color: #e5e7eb;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.loan-balance-pill {
  font-size: 0.7rem;
  padding: 0.08rem 0.5rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.2);
  color: #bbf7d0;
}

.loan-balance-value {
  margin-top: 0.35rem;
  font-size: 2.5rem;
  font-weight: 700;
  color: #fbbf24;
}

.loan-balance-text {
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: #e5e7eb;
}

.loan-subtitle {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  color: #f9fafb;
}

/* Breakdown list */
.loan-breakdown-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: #e5e7eb;
}

.break-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.break-bar {
  margin-top: 0.18rem;
  width: 100%;
  height: 0.28rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 1);
  overflow: hidden;
}

.break-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #facc15, #fb923c);
  transition: width 0.3s ease-out;
}

/* Graphs */
.graph-row {
  margin-bottom: 0.5rem;
}

.graph-row:last-child {
  margin-bottom: 0;
}

.graph-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #e5e7eb;
  margin-bottom: 0.2rem;
}

.graph-bar {
  width: 100%;
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 1);
  overflow: hidden;
}

.graph-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #22c55e);
  transition: width 0.3s ease-out;
}

/* Actions */
.loan-actions-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 0.9rem;
}

.loan-form .form-row {
  margin-bottom: 0.6rem;
}

.loan-form label {
  display: block;
  font-size: 0.78rem;
  margin-bottom: 0.25rem;
  color: #e5e7eb;
}

.loan-form input {
  width: 100%;
  border-radius: 0.6rem;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.98);
  color: #f9fafb;
  padding: 0.42rem 0.65rem;
  font-size: 0.8rem;
  outline: none;
  transition:
    border-color 0.16s ease-out,
    box-shadow 0.16s ease-out;
}

.loan-form input::placeholder {
  color: #64748b;
}

.loan-form input:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.75);
}

.field-hint {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: #9ca3af;
}

.loan-form .form-actions {
  display: flex;
  justify-content: flex-end;
}

/* =================== Responsive =================== */

@media (max-width: 960px) {
  .metrics-panel .metrics-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .loan-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .loan-actions-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .weekly-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .weekly-legend {
    grid-template-columns: minmax(0, 1fr);
  }
}


@media (max-width: 640px) {
  .auth-modal {
    padding: 1.1rem 1.1rem;
  }

  .weekly-pie {
    width: 160px;
    height: 160px;
  }

  /* Topbar layout on mobile: email in the middle, nav button far right */
  .topbar-actions {
    display: grid;
    grid-template-columns: auto 1fr auto; /* [logout] [email] [nav] */
    align-items: center;
    column-gap: 0.5rem;
    width: 100%;
  }

  .topbar-user-line {
    display: flex;              /* keeps existing flex behaviour */
    justify-content: center;    /* centre text horizontally */
    text-align: center;
    white-space: nowrap;
    transform: none;            /* remove previous X-shift */
  }

  .topbar-user-email {
    display: inline-block;
    max-width: 70vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .topbar-menu {
    justify-self: end;          /* push nav toggle to the far right */
  }
}

