/* app.css - Stablecoin DAO Genesis Mint */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg-main: #FFF7E0;
  --bg-card: #F5F5F5;
  --bg-section: #E8E8E8;
  --bg-surface: rgba(0,0,0,0.03);
  --bg-surface-hover: rgba(0,0,0,0.06);
  --text-main: #111111;
  --text-secondary: #333333;
  --text-muted: #A1A1A1;
  --accent-green: #20C05D;
  --accent-green-dark: #107A00;
  --accent-green-glow: rgba(32, 192, 93, 0.15);
  --accent-gold: #FFD700;
  --accent-gold-hover: #FFCC00;
  --accent-gold-glow: rgba(255, 215, 0, 0.15);
  --green: #20C05D;
  --orange: #FFD700;
  --red: #e74c3c;
  --radius: 16px;
  --radius-lg: 20px;
  --shadow: 0 4px 20px rgba(0,0,0,0.06);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-light: #E0E0E0;
  --border-card: #E8E8E8;
}

@property --border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  padding-bottom: 90px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body::before {
  content: '';
  position: fixed; top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at 30% 20%, rgba(32, 192, 93, 0.02) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 60%, rgba(255, 215, 0, 0.02) 0%, transparent 50%);
  z-index: 0; pointer-events: none;
}

.container { max-width: 500px; margin: 0 auto; padding: 12px 16px; position: relative; z-index: 1; }

/* ========== HEADER ========== */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 247, 224, 0.92);
  backdrop-filter: blur(20px);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border-light);
}
.header button {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 10px;
  transition: all var(--transition);
}
.header button:active { background: var(--bg-surface-hover); transform: scale(0.95); }
.header-spacer { width: 40px; }
.header h1 {
  font-size: 17px; font-weight: 700; flex: 1; text-align: center;
  letter-spacing: -0.3px;
  color: var(--text-main);
}

/* ========== WALLET BAR ========== */
.wallet-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  position: sticky; top: 53px; z-index: 99;
}
.wallet-bar .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.wallet-bar .dot.connected { background: var(--accent-green); box-shadow: 0 0 8px var(--accent-green-glow); }
.wallet-bar .dot.disconnected { background: var(--text-muted); }
.wallet-bar span { flex: 1; word-break: break-all; font-weight: 500; color: var(--text-secondary); }
.wallet-bar button {
  background: #000000;
  color: #FFFFFF;
  border: none;
  border-radius: 20px;
  padding: 8px 16px; font-size: 13px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: all var(--transition);
}
.wallet-bar button:hover {
  background: var(--accent-gold-hover);
  color: #000000;
}
.wallet-bar button:active { transform: scale(0.95); }
.wallet-bar button.disconnect {
  background: var(--bg-section);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}
.wallet-bar button.disconnect:hover {
  background: var(--border-light);
}

/* ========== STATUS FILTER ========== */
.status-filter {
  display: flex; gap: 6px; padding: 14px 0 8px; overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none;
}
.status-filter::-webkit-scrollbar { display: none; }
.status-filter button {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 8px 18px;
  font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: all var(--transition);
}
.status-filter button.active {
  background: var(--accent-green);
  color: #FFFFFF;
  border-color: var(--accent-green);
  font-weight: 700;
  box-shadow: 0 2px 12px var(--accent-green-glow);
}

/* ========== CAMPAIGN CARD ========== */
.campaign-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-sm);
}
.campaign-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: conic-gradient(from var(--border-angle), transparent 40%, var(--accent-green) 60%, var(--accent-gold) 80%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: borderSpin 8s linear infinite;
  opacity: 0.15;
  pointer-events: none;
}
.campaign-card:active { transform: scale(0.985); background: var(--bg-section); }
.campaign-card:hover::before { opacity: 0.35; }
.campaign-card .title {
  font-size: 17px; font-weight: 700; margin-bottom: 8px;
  letter-spacing: -0.3px;
  color: var(--text-main);
}
.campaign-card .meta {
  font-size: 12px; color: var(--text-secondary);
  display: flex; justify-content: space-between; margin-bottom: 10px; font-weight: 500;
}

/* ========== CAMPAIGN STATUS BLOCKS ========== */
.campaign-upcoming-block {
  margin: 12px 0;
  text-align: center;
  padding: 12px;
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.15);
  border-radius: 16px;
}
.campaign-upcoming-block .date {
  font-size: 28px;
  font-weight: 800;
  color: #000000;
}
.campaign-upcoming-block .time {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.campaign-completed-block {
  margin: 12px 0;
  text-align: center;
  padding: 12px;
  background: rgba(32, 192, 93, 0.06);
  border: 1px solid rgba(32, 192, 93, 0.12);
  border-radius: 16px;
}
.campaign-completed-block .icon-text {
  font-size: 26px;
  font-weight: 800;
  color: var(--accent-green);
}
.campaign-completed-block .sub-text {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.campaign-paused-tag {
  color: #B8860B;
  font-size: 12px;
  margin-top: 6px;
}

/* ========== PROGRESS BAR ========== */
.progress-bar-outer {
  height: 8px;
  background: var(--bg-section);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 10px;
}
.progress-bar-inner {
  height: 100%; border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(90deg, var(--accent-green), var(--accent-gold));
}
.progress-bar-inner.completed { background: var(--accent-green); }

.campaign-card .stats { display: flex; justify-content: space-between; font-size: 12px; }
.campaign-card .stats .amount { font-weight: 700; font-size: 14px; color: var(--accent-green); }
.campaign-card .stats .right { text-align: right; }

/* ========== STATS LABELS (shared) ========== */
.stats .label,
.progress-summary .label {
  color: var(--text-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ========== STATUS BADGE ========== */
.status-badge {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.status-badge.status-active { background: rgba(32, 192, 93, 0.12); color: var(--accent-green); }
.status-badge.status-successful { background: rgba(255, 215, 0, 0.15); color: #B8860B; }
.status-badge.status-upcoming { background: rgba(255, 215, 0, 0.1); color: #B8860B; }
.status-badge.status-expired { background: rgba(231, 76, 60, 0.1); color: var(--red); }
.status-badge.status-failed { background: rgba(231, 76, 60, 0.1); color: var(--red); }
.status-badge.status-emergency { background: rgba(255, 215, 0, 0.1); color: #B8860B; }

/* ========== DETAIL SECTIONS ========== */
.detail-section {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}
.detail-section.centered { text-align: center; padding: 16px; }
.detail-section h3 {
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600;
}
.detail-section .phase-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}
.detail-section .description-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.detail-row {
  display: flex; justify-content: space-between;
  padding: 8px 0; font-size: 14px;
  border-bottom: 1px solid var(--border-light);
}
.detail-row:last-child { border-bottom: none; }
.detail-row .label { color: var(--text-secondary); font-weight: 500; }
.detail-row .value { font-weight: 600; text-align: right; word-break: break-all; color: var(--text-main); }
.detail-row .value.green { color: var(--accent-green); }
.detail-row .value.orange { color: #B8860B; }
.detail-row .value.red { color: var(--red); }

/* ========== PROGRESS SUMMARY ========== */
.progress-summary {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}
.progress-summary .amount { font-size: 22px; font-weight: 800; color: var(--text-main); }
.progress-summary .right { text-align: right; }

/* ========== AMOUNT INPUT ========== */
.amount-input-group { display: flex; gap: 8px; margin-top: 4px; }
.amount-input-group input {
  flex: 1; background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px; color: var(--text-main);
  font-size: 16px; font-weight: 500;
  outline: none; transition: all var(--transition);
}
.amount-input-group input:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 0 3px var(--accent-green-glow);
}
.amount-input-group button {
  background: var(--accent-green);
  color: #FFFFFF; border: none;
  border-radius: 10px;
  padding: 14px 22px; font-size: 15px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: all var(--transition);
}
.amount-input-group button:hover {
  background: var(--accent-green-dark);
}
.amount-input-group button:active { transform: scale(0.95); opacity: 0.9; }
.amount-input-group button:disabled { opacity: 0.4; cursor: not-allowed; }

.amount-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ========== ACTION BUTTON ========== */
.action-btn {
  width: 100%;
  background: var(--accent-green);
  color: #FFFFFF; border: none; border-radius: var(--radius);
  padding: 16px; font-size: 16px; font-weight: 700;
  cursor: pointer; margin-top: 4px;
  transition: all var(--transition);
  box-shadow: 0 4px 16px var(--accent-green-glow);
}
.action-btn:hover {
  background: var(--accent-green-dark);
}
.action-btn:active { transform: scale(0.97); opacity: 0.9; }
.action-btn.secondary {
  background: var(--bg-section);
  border: 1px solid var(--border-light);
  box-shadow: none;
  color: var(--text-secondary);
}
.action-btn.secondary:hover {
  background: var(--border-light);
  color: var(--text-main);
}
.action-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ========== STATE MESSAGES ========== */
.state-message {
  text-align: center;
  padding: 16px;
}
.state-message .warning-text {
  color: #B8860B;
  font-weight: 600;
}
.state-message .error-text {
  color: var(--red);
  font-weight: 600;
}

.connect-prompt {
  color: var(--text-muted);
  text-align: center;
}

/* ========== VESTING TIMELINE ========== */
.timeline { position: relative; padding: 8px 0; margin: 8px 0; }
.timeline-track {
  height: 10px;
  background: var(--bg-section);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  margin-bottom: 8px;
}
.timeline-cliff {
  height: 100%;
  position: absolute;
  left: 0;
  background: var(--accent-green);
  border-radius: 5px 0 0 5px;
}
.timeline-linear {
  height: 100%;
  position: absolute;
  background: linear-gradient(90deg, var(--accent-green) 0%, var(--accent-gold) 100%);
}
.timeline-now {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 18px;
  background: #000000;
  border-radius: 1px;
  z-index: 2;
  box-shadow: 0 0 6px rgba(0,0,0,0.2);
}
.timeline-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-muted);
}

.vesting-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.vesting-stat-item {
  background: var(--bg-section);
  border-radius: 8px; padding: 10px;
}
.vesting-stat-item .stat-value { font-size: 18px; font-weight: 700; color: var(--text-main); }
.vesting-stat-item .stat-value.orange { color: #B8860B; }
.vesting-stat-item .stat-value.green { color: var(--accent-green); }
.vesting-stat-item .stat-label { font-size: 10px; color: var(--text-muted); }

.vesting-fully-vested {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ========== WHITELIST WARN ========== */
.whitelist-warn {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 10px;
  padding: 12px 16px; margin: 10px 0;
  font-size: 13px; color: #B8860B; text-align: center; font-weight: 500;
}

/* ========== ERROR TOAST ========== */
.error-toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: #FFF5F5; color: var(--red); padding: 12px 24px;
  border-radius: 30px; font-size: 14px; font-weight: 600;
  z-index: 200; max-width: 90%; text-align: center; display: none;
  border: 1px solid rgba(231, 76, 60, 0.2);
  box-shadow: var(--shadow);
}

/* ========== LOADING ========== */
.loading { text-align: center; padding: 60px 20px; }
.loading .spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border-light);
  border-top: 3px solid var(--accent-green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 16px;
}
.loading p { color: var(--text-muted); font-size: 13px; }

/* ========== EMPTY STATE ========== */
.empty-state { text-align: center; padding: 80px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 64px; margin-bottom: 16px; opacity: 0.4; }

/* ========== SPLASH ========== */
#splash {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: #FFF7E0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  transition: opacity 0.8s ease;
}
#splash .splash-logo {
  width: 120px;
  height: auto;
  margin-bottom: 24px;
}
#splash h1 {
  font-size: 32px;
  font-weight: 800;
  color: #000000;
  margin-bottom: 8px;
}
#splash p {
  color: #333333;
  font-size: 16px;
  margin-bottom: 32px;
  font-weight: 500;
}
#splash button {
  background: #000000;
  border: none;
  padding: 14px 48px;
  border-radius: 40px;
  color: #FFFFFF;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}
#splash button:hover {
  background: var(--accent-gold-hover);
  color: #000000;
}
#splash button:active { transform: scale(0.95); }

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 2px; }
::selection { background: var(--accent-green); color: #FFFFFF; }

/* ========== ANIMATIONS ========== */
@keyframes borderSpin {
  from { --border-angle: 0deg; }
  to { --border-angle: 360deg; }
}

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