/* AgentFund Protocol - Styles */
/* Modern, vibrant design system */

:root {
  /* Colors */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #10b981;
  --accent: #f59e0b;

  /* Chain colors */
  --stacks-color: #5546ff;
  --casper-color: #ff4d4d;
  --base-color: #0052ff;

  /* Backgrounds */
  --bg-dark: #0f0f1a;
  --bg-card: #1a1a2e;
  --bg-card-hover: #252540;
  --bg-gradient: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 100%);

  /* Text */
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;

  /* Borders */
  --border-color: rgba(255, 255, 255, 0.1);
  --border-glow: rgba(99, 102, 241, 0.5);

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);

  /* Spacing */
  --container-max: 1200px;
  --section-padding: 80px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

.app {
  min-height: 100vh;
  background: var(--bg-gradient);
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  background: rgba(15, 15, 26, 0.8);
  border-bottom: 1px solid var(--border-color);
}

.header-content {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.5rem;
}

.logo-icon {
  font-size: 1.8rem;
  animation: pulse 2s infinite;
}

.logo-image {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
  background: transparent;
  transform: scale(1.4);
  /* Zoom in to fit the circular part only */
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.spin {
  animation: spin 1s linear infinite;
}

/* Input wrapper for currency display */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper input {
  flex: 1;
  padding-right: 60px;
}

.input-currency {
  position: absolute;
  right: 16px;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 600;
}

.nav {
  display: flex;
  gap: 32px;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}

.connect-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.connect-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* Hero Section */
.hero {
  padding: 160px 24px 100px;
  max-width: var(--container-max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-badge {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 20px;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 50%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 500px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.stat-card {
  background: var(--bg-card);
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  transition: all 0.3s;
}

.stat-card:hover {
  border-color: var(--primary);
  transform: translateY(-4px);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Hero Visual - Chain Orbs */
.hero-visual {
  position: relative;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chain-orb {
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  animation: orbit 10s linear infinite;
  box-shadow: var(--shadow-card);
}

.chain-orb.stacks {
  background: linear-gradient(135deg, var(--stacks-color), #4433ff);
  top: 50px;
  animation-delay: 0s;
}

.chain-orb.casper {
  background: linear-gradient(135deg, var(--casper-color), #ff7777);
  bottom: 50px;
  left: 50px;
  animation-delay: -3.3s;
}

.chain-orb.base {
  background: linear-gradient(135deg, var(--base-color), #3377ff);
  bottom: 50px;
  right: 50px;
  animation-delay: -6.6s;
}

.center-orb {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  box-shadow: var(--shadow-glow);
  animation: pulse 3s infinite;
}

@keyframes orbit {
  0% {
    transform: rotate(0deg) translateX(120px) rotate(0deg);
  }

  100% {
    transform: rotate(360deg) translateX(120px) rotate(-360deg);
  }
}

/* Sections */
.projects-section,
.matching-section,
.agents-section {
  padding: var(--section-padding) 24px;
  max-width: var(--container-max);
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--text-secondary);
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.project-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid var(--border-color);
  transition: all 0.3s;
  cursor: pointer;
}

.project-card:hover {
  border-color: var(--primary);
  transform: translateY(-8px);
  box-shadow: var(--shadow-glow);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.project-icon {
  font-size: 2.5rem;
}

.project-chain {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.project-chain.stacks {
  background: rgba(85, 70, 255, 0.2);
  color: var(--stacks-color);
}

.project-chain.casper {
  background: rgba(255, 77, 77, 0.2);
  color: var(--casper-color);
}

.project-chain.base {
  background: rgba(0, 82, 255, 0.2);
  color: var(--base-color);
}

.project-name {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.project-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.project-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.project-stat {
  text-align: center;
}

.project-stat-value {
  font-weight: 600;
  font-size: 1rem;
}

.project-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.project-progress {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 16px;
}

.project-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 4px;
  transition: width 0.5s;
}

.project-donate-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.project-donate-btn:hover {
  background: var(--primary-dark);
}

/* Matching Section */
.matching-formula {
  max-width: 600px;
  margin: 0 auto 40px;
}

.formula-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 32px;
  text-align: center;
  border: 1px solid var(--border-color);
}

.formula {
  font-family: monospace;
  font-size: 1.5rem;
  color: var(--primary-light);
  margin-bottom: 12px;
}

.formula-desc {
  color: var(--text-secondary);
}

.matching-chart {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.match-bar {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
  border: 1px solid var(--border-color);
}

.match-bar-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.match-bar-name {
  font-weight: 600;
}

.match-bar-value {
  color: var(--secondary);
  font-weight: 600;
}

.match-bar-visual {
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
}

.match-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary), var(--accent));
  border-radius: 6px;
}

/* Agents Feed */
.agents-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.agent-activity {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.agent-icon {
  font-size: 2rem;
}

.agent-info {
  flex: 1;
}

.agent-name {
  font-weight: 600;
  margin-bottom: 2px;
}

.agent-action {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.agent-amount {
  font-weight: 600;
  color: var(--secondary);
}

.agent-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(8px);
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 32px;
  width: 100%;
  max-width: 450px;
  border: 1px solid var(--border-color);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-title {
  font-size: 1.5rem;
  margin-bottom: 24px;
}

.chain-selector {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.chain-btn {
  flex: 1;
  padding: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.chain-btn:hover,
.chain-btn.active {
  border-color: var(--primary);
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.1);
}

.amount-input {
  margin-bottom: 20px;
}

.amount-input label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.amount-input input {
  width: 100%;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 1.25rem;
  outline: none;
}

.amount-input input:focus {
  border-color: var(--primary);
}

.impact-preview {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  text-align: center;
}

.impact-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.impact-value {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--secondary);
}

.donate-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.donate-btn:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-glow);
}

/* Footer */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 40px 24px;
}

.footer-content {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-logo {
  font-weight: 600;
  font-size: 1.125rem;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-chains {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.chain-tag {
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 120px 24px 60px;
    text-align: center;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    margin: 0 auto 40px;
  }

  .hero-visual {
    display: none;
  }

  .nav {
    display: none;
  }

  .section-title {
    font-size: 2rem;
  }
}