/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #64748b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-light: #334155;
  --text: #f1f5f9;
  --text-dim: #cbd5e1;
  --border: #475569;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Prevent horizontal scrolling/clipping on mobile */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Ensure media/canvases/tables scale within viewport */
img, canvas, table {
  max-width: 100%;
}
canvas {
  height: auto !important;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
  border-bottom: 2px solid var(--border);
}

/* Brand area (logo + title) */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  background: #0b1220;
  object-fit: contain;
  border: 1px solid var(--border);
}

header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-dim);
  font-size: 1.1rem;
}

/* Card */
.card {
  background: var(--surface);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
}

.card h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.card-header h2 {
  margin: 0;
}

/* Portfolio Cards */
.portfolio-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

.portfolio-label {
  display: block;
  color: var(--text-dim);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 1rem;
}

.portfolio-value {
  display: block;
  font-size: 3rem;
  font-weight: 700;
  color: var(--success);
}

.income-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.income-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.income-label {
  color: var(--text-dim);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.income-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--success);
}

.income-actual {
  color: var(--text-dim);
  font-size: 0.875rem;
  font-weight: 400;
}

.rates-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.rates-title {
  color: var(--text-dim);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.rates-source {
  color: var(--text-dim);
  font-size: 0.875rem;
}

.stablecoin-prices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  font-size: 0.875rem;
}

.stablecoin-price {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stablecoin-symbol {
  font-weight: 600;
  color: var(--text);
  font-size: 0.875rem;
}

.stablecoin-value {
  font-family: 'Courier New', monospace;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
  font-size: 0.875rem;
}

.stablecoin-value:hover {
  color: var(--primary);
  text-decoration: underline;
}

.summary-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.updated-time {
  color: var(--text-dim);
  font-size: 0.875rem;
}

/* Form */
.form-group {
  display: flex;
  gap: 1rem;
}

.form-group input {
  flex: 1;
  padding: 0.875rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  font-family: 'Courier New', monospace;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group input::placeholder {
  color: var(--secondary);
}

.form-help {
  color: var(--text-dim);
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* Buttons */
.btn {
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--surface-light);
  color: var(--text);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--border);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
  transform: translateY(-1px);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

/* Status messages */
.status-message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  display: none;
}

.status-message.success {
  display: block;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}

.status-message.error {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.status-message.info {
  display: block;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid var(--primary);
  color: var(--primary);
}

/* Wallets List */
.wallets-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.wallet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.wallet-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.wallet-checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.wallet-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  flex: 1;
}

.wallet-name {
  font-weight: 600;
  color: var(--text);
}

.wallet-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.wallet-address {
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  color: var(--text);
  overflow-wrap: anywhere;
}

.wallet-meta {
  color: var(--text-dim);
  font-size: 0.75rem;
}

/* Positions Table */
.positions-table {
  overflow-x: auto;
}

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

thead {
  background: var(--bg);
  border-bottom: 2px solid var(--border);
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-dim);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  /* Allow long tokens to wrap instead of forcing horizontal scroll */
  overflow-wrap: anywhere;
  word-break: break-word;
}

tbody tr {
  transition: all 0.3s ease;
}

tbody tr:hover {
  background: var(--surface-light);
}

/* APY warning styles - pink to red gradient based on how low APY is */
tbody tr.apy-warning {
  position: relative;
}

/* Light pink border for APY just below 4% */
tbody tr.apy-warning-9,
tbody tr.apy-warning-10 {
  border-left: 3px solid rgba(236, 72, 153, 0.5);
  background: rgba(236, 72, 153, 0.05);
}

/* Medium pink for APY around 2-3% */
tbody tr.apy-warning-5,
tbody tr.apy-warning-6,
tbody tr.apy-warning-7,
tbody tr.apy-warning-8 {
  border-left: 3px solid rgba(236, 72, 153, 0.7);
  background: rgba(236, 72, 153, 0.08);
}

/* Dark pink/red for APY around 1-2% */
tbody tr.apy-warning-3,
tbody tr.apy-warning-4 {
  border-left: 3px solid rgba(239, 68, 68, 0.8);
  background: rgba(239, 68, 68, 0.1);
}

/* Full red for APY below 1% */
tbody tr.apy-warning-0,
tbody tr.apy-warning-1,
tbody tr.apy-warning-2 {
  border-left: 3px solid #ef4444;
  background: rgba(239, 68, 68, 0.12);
  animation: pulse-warning 2s ease-in-out infinite;
}

@keyframes pulse-warning {
  0%, 100% {
    border-left-color: #ef4444;
  }
  50% {
    border-left-color: #dc2626;
  }
}

/* Make hover state respect the warning border */
tbody tr.apy-warning:hover {
  background: var(--surface-light);
}

.position-name {
  font-weight: 600;
  color: var(--text);
}

.position-asset {
  color: var(--text-dim);
  font-size: 0.875rem;
}

.apy-value {
  font-weight: 600;
  color: var(--success);
  /* Keep APY values on one line (avoid splitting % to new line) */
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.apy-neutral {
  color: var(--text-dim);
  /* Same no-wrap behavior for neutral APY cells */
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.amount {
  font-family: 'Courier New', monospace;
  /* Keep currency values on a single line (avoid breaking on mobile) */
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

/* Empty state */
.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 2rem;
  font-style: italic;
}

/* Income context section */
.income-context-card {
  margin-top: 1.5rem;
}

.income-context {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.6;
}

.income-context strong {
  color: var(--success);
}

.income-context .disclaimer {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-dim);
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-dim);
  font-size: 0.875rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

/* Loading state */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Clickable items */
.clickable {
  cursor: pointer;
  transition: all 0.2s;
}

.clickable:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

/* Discovery Progress */
.discovery-progress {
  margin-top: 2rem;
  padding: 2rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: left;
}

.discovery-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
}

.discovery-header h3 {
  margin: 1rem 0 0.5rem 0;
  font-size: 1.25rem;
}

.discovery-status {
  color: var(--text-dim);
  font-size: 0.875rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--surface-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.discovered-positions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
}

.position-discovery-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.position-discovery-item .check-icon {
  width: 24px;
  height: 24px;
  margin-right: 1rem;
  color: var(--success);
  font-size: 1.5rem;
  flex-shrink: 0;
}

.position-discovery-details {
  flex: 1;
}

.position-discovery-name {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.position-discovery-meta {
  font-size: 0.875rem;
  color: var(--text-dim);
}

.position-discovery-value {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: var(--success);
  font-size: 1.125rem;
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}

.modal-content {
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  max-width: 1000px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 2rem;
  overflow-y: auto;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  header h1 {
    font-size: 1.75rem;
  }

  .income-grid {
    grid-template-columns: 1fr;
  }

  .stablecoin-prices {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-group {
    flex-direction: column;
  }

  table {
    font-size: 0.875rem;
    table-layout: fixed; /* Prevent columns from expanding off-screen */
  }

  th, td {
    padding: 0.75rem 0.5rem;
  }

  .modal {
    padding: 1rem;
  }

  .modal-content {
    max-height: 85vh;
  }

  .modal-header, .modal-body {
    padding: 1rem;
  }

  /* Card padding reduction on mobile */
  .card {
    padding: 1.25rem;
  }

  /* Card headers stack vertically on mobile */
  .card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .card-header h2 {
    font-size: 1.25rem;
  }

  .card-header .btn {
    width: 100%;
  }

  /* Wallet items mobile layout */
  .wallet-item {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .wallet-line {
    flex-wrap: wrap;
  }

  .wallet-label {
    flex-wrap: wrap;
    min-width: 0; /* Allow flex item to shrink */
  }

  .wallet-name, .wallet-address, .wallet-meta {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }

  .wallet-address {
    overflow-wrap: normal;
    word-break: normal;
  }

  .wallet-actions {
    width: 100%;
    justify-content: stretch;
  }

  .wallet-actions button {
    flex: 1;
  }
}

/* Mobile-first table simplification: hide less critical columns to avoid horizontal scroll */
@media (max-width: 768px) {
  /* Columns: 1 Position, 2 Value, 3 APY, 4 7d APY, 5 30d APY, 6 Est. Daily, 7 Est. Monthly, 8 Last Updated */
  .positions-table th:nth-child(4),
  .positions-table td:nth-child(4),
  .positions-table th:nth-child(5),
  .positions-table td:nth-child(5),
  .positions-table th:nth-child(7),
  .positions-table td:nth-child(7),
  .positions-table th:nth-child(8),
  .positions-table td:nth-child(8) {
    display: none;
  }

  /* Allow button text to wrap to prevent overflow */
  .btn {
    white-space: normal;
  }

  /* Let long names wrap within their cell */
  .position-name,
  .position-asset {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* Authentication Screen */
.auth-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--bg) 0%, #1e3a5f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.auth-container {
  width: 100%;
  max-width: 450px;
  padding: 2rem;
}

.auth-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 3rem 2.5rem;
  border: 1px solid var(--border);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.auth-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.auth-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  margin-bottom: 1.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  background: #0b1220;
  object-fit: contain;
  border: 1px solid var(--border);
}

.auth-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-subtitle {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin: 0;
}

.auth-form {
  margin-top: 2rem;
}

.auth-form h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  text-align: center;
  color: var(--text);
}

.auth-form .form-group {
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.auth-form label {
  color: var(--text-dim);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.auth-form input {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.btn-block {
  width: 100%;
  margin-top: 0.5rem;
}

.auth-message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  text-align: center;
  display: none;
}

.auth-message.success {
  display: block;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}

.auth-message.error {
  display: block;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
}

.auth-message.info {
  display: block;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid var(--primary);
  color: var(--primary);
}

.auth-info {
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.auth-info p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.875rem;
  line-height: 1.5;
}

.auth-footer {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

.auth-footer p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.auth-footer a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* User Menu in Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.username {
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  .auth-container {
    padding: 1rem;
  }

  .auth-card {
    padding: 2rem 1.5rem;
  }

  header {
    flex-direction: column;
    gap: 1rem;
  }

  .user-menu {
    width: 100%;
    justify-content: space-between;
  }
}

/* Notification Settings Page Styles */
.form-section {
  margin-bottom: 2.5rem;
}

.form-section h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.settings-group {
  margin-left: 1.5rem;
  margin-top: 1rem;
  padding-left: 1rem;
  border-left: 2px solid var(--border);
}

.settings-group .form-group {
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  align-items: stretch;
}

.settings-group .form-group label {
  margin-bottom: 0.5rem;
}

.settings-group .form-group input,
.settings-group .form-group select {
  width: 100%;
  max-width: 400px;
}

.settings-group .form-help {
  margin-top: 0.25rem;
  max-width: 400px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

.form-group select {
  padding: 0.875rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group label {
  display: block;
  color: var(--text-dim);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-actions {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.notifications-table {
  width: 100%;
  margin-top: 1rem;
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-depeg {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.badge-apy_drop {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.severity {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.severity-min {
  background: rgba(71, 85, 105, 0.2);
  color: var(--text-dim);
}

.severity-low {
  background: rgba(100, 116, 139, 0.2);
  color: var(--secondary);
}

.severity-default {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
}

.severity-high {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.severity-urgent {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

/* Topic highlight animation when a new ntfy topic is created */
@keyframes topic-flash-outline {
  0% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.45); }
  50% { box-shadow: 0 0 0 10px rgba(99, 102, 241, 0.0); }
  100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.0); }
}

#ntfyTopicBox.topic-flash {
  animation: topic-flash-outline 1.1s ease-out 3;
  border: 1px solid var(--primary);
}

/* ============================================
   LANDING PAGE STYLES
   ============================================ */

/* Landing Page Body */
.landing-page {
  background: var(--bg);
  overflow-x: hidden;
}

/* Site Header Component */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(15, 23, 42, 0.9);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-logo {
  display: flex;
  align-items: center;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
  transition: opacity 0.2s;
}

.logo-link:hover {
  opacity: 0.8;
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: contain;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-text {
  background: transparent;
  color: var(--text);
  padding: 0.75rem 1.25rem;
}

.btn-text:hover {
  background: var(--surface-light);
}

.header-user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.icon-link {
  display: inline-flex;
  align-items: center;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.icon-link:hover {
  color: var(--text);
}

/* Hero Section */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.hero-left {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin: 0;
}

.hero-image-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.hero-image {
  width: 100%;
  max-width: 400px;
  height: auto;
}

.hero-right {
  display: flex;
  flex-direction: column;
  min-height: 560px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--success);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  width: fit-content;
  margin-bottom: 1.5rem;
}

.hero-heading {
  font-size: 3.5rem;
  font-weight: 700;
  margin: 0;
  background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-dim);
  margin: 0 0 2rem 0;
}

.hero-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1rem;
}

.hero-input {
  width: 100%;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  transition: border-color 0.2s;
}

.hero-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.hero-input::placeholder {
  color: var(--secondary);
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover:not(:disabled) {
  background: var(--primary);
  color: white;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: auto;
}

.hero-footer {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.guest-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text);
  text-decoration: none;
  font-size: 1.125rem;
  font-weight: 500;
  padding: 1rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  transition: all 0.2s;
}

.guest-link:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.guest-link svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

/* Features Section */
.features {
  max-width: 1200px;
  margin: 6rem auto;
  padding: 0 2rem;
}

.features-header {
  text-align: center;
  margin-bottom: 4rem;
}

.features-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.text-green {
  color: var(--success);
}

.features-subtitle {
  font-size: 1.125rem;
  color: var(--text-dim);
  margin: 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  margin-bottom: 1.5rem;
}

.feature-icon-discovery {
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary);
}

.feature-icon-apy {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.feature-icon-alerts {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

.feature-icon-privacy {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.feature-description {
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0;
}

/* Auth Modal */
.auth-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.auth-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
}

.auth-modal-content {
  position: relative;
  z-index: 2001;
  width: 100%;
  max-width: 450px;
  margin: 2rem;
  animation: slideUp 0.3s ease-out;
}

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

.auth-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--surface-light);
  border: none;
  color: var(--text-dim);
  font-size: 2rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
  z-index: 10;
}

.auth-modal-close:hover {
  background: var(--border);
  color: var(--text);
}

/* Responsive Design */
@media (max-width: 992px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-heading {
    font-size: 2.75rem;
  }

  .hero-left {
    order: 1;
  }

  .hero-right {
    order: 2;
    min-height: auto;
  }

  .features-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 768px) {
  .header-content {
    padding: 1rem;
  }

  .logo-text {
    font-size: 1.25rem;
  }

  .header-actions {
    gap: 0.5rem;
  }

  .btn-text {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
  }

  .btn-primary {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
  }

  .hero {
    padding: 2rem 1rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-heading {
    font-size: 2.25rem;
  }

  .hero-subtitle {
    font-size: 1.125rem;
  }

  .hero-cta {
    flex-direction: column;
    width: 100%;
    margin-top: 2rem;
  }

  .hero-cta .btn {
    width: 100%;
  }

  .features {
    margin: 4rem auto;
  }

  .features-title {
    font-size: 2rem;
  }

  .features-subtitle {
    font-size: 1rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .auth-modal-content {
    margin: 1rem;
  }
}

/* Landing Page Footer */
.landing-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 3rem 2rem;
  margin-top: 6rem;
}

.landing-footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.landing-footer-text {
  color: var(--text-dim);
  font-size: 0.875rem;
  margin: 0;
}

.landing-footer-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.landing-footer-links a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.landing-footer-links a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.footer-separator {
  color: var(--border);
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-social-link:hover {
  color: var(--primary);
  text-decoration: none;
}

.footer-social-link svg {
  width: 24px;
  height: 24px;
}

/* Legal Pages Styling */
.legal-header {
  margin-bottom: 3rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}

.back-link {
  display: inline-block;
  color: var(--primary);
  text-decoration: none;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

.legal-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.updated-date {
  color: var(--text-dim);
  font-size: 0.875rem;
  margin: 0;
}

.legal-content {
  line-height: 1.8;
  color: var(--text);
}

.legal-content section {
  margin-bottom: 2.5rem;
}

.legal-content h2 {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.legal-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

.legal-content p {
  margin-bottom: 1rem;
  color: var(--text);
}

.legal-content ul {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

.legal-content li {
  margin-bottom: 0.5rem;
  color: var(--text);
}

.legal-content strong {
  color: var(--text);
  font-weight: 600;
}

.legal-content a {
  color: var(--primary);
  text-decoration: underline;
  transition: color 0.2s;
}

.legal-content a:hover {
  color: var(--primary-dark);
}

@media (max-width: 768px) {
  .landing-footer {
    padding: 2rem 1rem;
    margin-top: 4rem;
  }

  .landing-footer-links {
    flex-direction: column;
    gap: 0.5rem;
  }

  .footer-separator {
    display: none;
  }

  .legal-header h1 {
    font-size: 2rem;
  }

  .legal-content h2 {
    font-size: 1.5rem;
  }

  .legal-content h3 {
    font-size: 1.125rem;
  }
}
