/* ============================================
   Capstack - Components Stylesheet
   Modals, Cards, Tags, Badges
   ============================================ */

/* ============================================
   Modal Base
   ============================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-elevated);
  overflow: hidden;
  transform: scale(0.95);
  transition: all 0.3s ease;
}

.modal-overlay.open .modal {
  transform: scale(1);
}

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

.modal-close {
  padding: 8px;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.modal-close:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.modal-body {
  padding: 24px;
}

.modal-body.scrollable {
  max-height: 60vh;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-primary);
  background: var(--bg-primary);
}

.modal-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.logo-sm {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.125rem;
  font-weight: 700;
}

/* ============================================
   Auth Modal
   ============================================ */

.modal-auth {
  max-width: 420px;
}

.auth-tabs {
  display: flex;
  padding: 8px;
  background: var(--bg-primary);
  gap: 4px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.auth-tab.active {
  background: var(--bg-secondary);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.auth-tab:hover:not(.active) {
  color: var(--text-secondary);
}

/* User Type Selection */
.user-type-select {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
}

.type-btn:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.type-btn.active[data-type="founder"] {
  border-color: var(--money-green);
  background: var(--money-green-glow);
}

.type-btn.active[data-type="investor"] {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.type-btn svg {
  width: 24px;
  height: 24px;
  color: var(--text-muted);
}

.type-btn.active[data-type="founder"] svg {
  color: var(--money-green);
}

.type-btn.active[data-type="investor"] svg {
  color: #3b82f6;
}

.type-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.type-desc {
  font-size: 0.625rem;
  color: var(--text-muted);
}

/* Auth Form */
.auth-form {
  margin-top: 20px;
}

.auth-error {
  padding: 10px 12px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: #ef4444;
  margin-bottom: 16px;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.auth-switch a {
  color: var(--money-green);
  font-weight: 500;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* ============================================
   Google Picker Modal
   ============================================ */

.modal-google {
  max-width: 380px;
  background: white;
  color: #1f2937;
}

.google-header {
  padding: 32px 24px;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
}

.google-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  color: #4b5563;
}

.google-brand .google-icon {
  width: 24px;
  height: 24px;
}

.google-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
}

.google-header p {
  font-size: 0.875rem;
  color: #6b7280;
}

.google-accounts {
  padding: 8px 0;
}

.google-account {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  width: 100%;
  text-align: left;
  transition: background 0.2s ease;
}

.google-account:hover {
  background: #f9fafb;
}

.account-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.account-name {
  font-weight: 500;
  color: #111827;
}

.account-email {
  font-size: 0.875rem;
  color: #6b7280;
}

.google-add {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  width: 100%;
  border-top: 1px solid #e5e7eb;
  transition: background 0.2s ease;
}

.google-add:hover {
  background: #f9fafb;
}

.add-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: #9ca3af;
}

.google-add span {
  font-weight: 500;
  color: #2563eb;
}

.google-footer {
  padding: 16px 24px;
  background: #f9fafb;
  display: flex;
  justify-content: flex-end;
}

/* ============================================
   Onboarding Modal
   ============================================ */

.modal-onboarding {
  max-width: 520px;
}

.onboarding-header {
  position: relative;
  padding: 32px;
  background: linear-gradient(135deg, var(--bg-primary) 0%, #1a2a1a 100%);
  overflow: hidden;
}

.onboarding-header::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 160px;
  height: 160px;
  background: var(--money-green-glow);
  border-radius: 50%;
  filter: blur(60px);
}

.step-dots {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.step-dot {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.step-dot.active {
  background: var(--money-green);
}

.step-dot.current {
  width: 32px;
}

.step-dot:not(.current) {
  width: 16px;
}

.onboarding-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  position: relative;
}

.onboarding-header p {
  color: var(--text-muted);
  position: relative;
}

.progress-bar {
  margin-top: 24px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--money-green);
  border-radius: 2px;
  transition: width 0.5s ease;
}

.onboarding-body {
  padding: 24px 32px;
  max-height: 50vh;
  overflow-y: auto;
}

.onboarding-footer {
  display: flex;
  justify-content: space-between;
  padding: 16px 32px;
  border-top: 1px solid var(--border-primary);
}

/* Feature Cards in Onboarding */
.feature-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
}

.feature-icon {
  width: 40px;
  height: 40px;
  background: var(--money-green-glow);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.feature-card h4 {
  font-weight: 500;
  margin-bottom: 4px;
}

.feature-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Selection Tags */
.selection-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selection-tag {
  padding: 10px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.selection-tag:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.selection-tag.selected {
  background: var(--money-green);
  color: var(--money-black);
  border-color: var(--money-green);
}

/* Stage Cards */
.stage-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  text-align: left;
  transition: all 0.2s ease;
}

.stage-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.stage-card.selected {
  border-color: var(--money-green);
  background: var(--money-green-glow);
}

.stage-icon {
  font-size: 1.5rem;
}

.stage-info {
  flex: 1;
}

.stage-info h4 {
  font-weight: 500;
  margin-bottom: 2px;
}

.stage-info p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.stage-check {
  width: 24px;
  height: 24px;
  background: var(--money-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--money-black);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.stage-card.selected .stage-check {
  opacity: 1;
}

/* ============================================
   Submit Opportunity Modal
   ============================================ */

.modal-submit {
  max-width: 640px;
}

.form-section {
  margin-bottom: 24px;
}

.section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.section-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-grid .full-width {
  grid-column: span 2;
}

.stage-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 8px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: 9999px;
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.tag:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.tag.selected {
  background: var(--money-green-glow);
  color: var(--money-green);
  border-color: var(--money-green);
}

.char-count {
  display: block;
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Eligibility List */
.eligibility-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.eligibility-toggle {
  display: flex;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-primary);
}

.eligibility-toggle button {
  padding: 8px 12px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.eligibility-toggle button.positive {
  background: var(--money-green-glow);
  color: var(--money-green);
}

.eligibility-toggle button.negative {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.eligibility-toggle button:not(.positive):not(.negative) {
  color: var(--text-muted);
}

.eligibility-row .input {
  flex: 1;
}

.eligibility-row .btn-icon {
  padding: 8px;
  color: var(--text-muted);
}

.eligibility-row .btn-icon:hover {
  color: #ef4444;
}

/* ============================================
   Reject Modal
   ============================================ */

.modal-reject {
  max-width: 420px;
}

.reject-reasons {
  margin-bottom: 16px;
}

.reject-reason {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  text-align: left;
  color: var(--text-secondary);
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.reject-reason:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.reject-reason.selected {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.5);
}

/* ============================================
   Cards
   ============================================ */

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  border-color: var(--border-green);
  box-shadow: var(--shadow-green-sm);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px;
  gap: 16px;
}

.card-logo {
  width: 56px;
  height: 56px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.card-info {
  flex: 1;
  min-width: 0;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-org {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.card-amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--money-green);
  flex-shrink: 0;
}

.card-body {
  padding: 0 20px 20px;
}

.card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 0 20px 20px;
}

/* ============================================
   Badges & Tags
   ============================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-sm);
}

.badge-green {
  background: var(--money-green-glow);
  color: var(--money-green-light);
  border: 1px solid var(--border-green);
}

.badge-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-red {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.tag-sm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-primary);
  border-radius: 9999px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.match-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: var(--money-green-glow);
  border: 1px solid var(--border-green);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--money-green);
  margin-left: auto;
}

/* Type Chips */
.type-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 500;
}

.type-chip.accelerator {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.type-chip.grant {
  background: rgba(245, 158, 11, 0.1);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.type-chip.vc {
  background: var(--money-green-glow);
  color: var(--money-green);
  border: 1px solid var(--border-green);
}

.type-chip.foundation {
  background: rgba(168, 85, 247, 0.1);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

/* ============================================
   Toast
   ============================================ */

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  z-index: 9999;
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  border-color: var(--money-green);
  background: rgba(0, 200, 83, 0.1);
}

.toast.error {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.toast-icon {
  font-size: 1.25rem;
}

/* ============================================
   Empty State
   ============================================ */

.empty-state {
  text-align: center;
  padding: 80px 24px;
}

.empty-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ============================================
   Animations
   ============================================ */

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

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

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 200, 83, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(0, 200, 83, 0); }
}

.animate-fade-in {
  animation: fadeIn 0.4s ease forwards;
}

.animate-slide-in {
  animation: slideIn 0.4s ease forwards;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

/* ============================================
   Pagination
   ============================================ */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
  padding: 16px 0;
  flex-wrap: wrap;
}

.pagination-btn {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination-btn:hover:not(.disabled):not(.active) {
  background: var(--bg-tertiary);
  border-color: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

.pagination-btn.active {
  background: var(--money-green);
  border-color: var(--money-green);
  color: var(--money-black);
  font-weight: 600;
}

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

.pagination-ellipsis {
  color: var(--text-muted);
  padding: 0 8px;
  font-size: 0.875rem;
}
