/* ============================================
   Capstack - Main Stylesheet
   Green & Black Money Theme
   ============================================ */

/* CSS Variables */
:root {
  /* Core Colors - Money Theme */
  --money-black: #0a0a0a;
  --money-black-light: #141414;
  --money-black-lighter: #1a1a1a;
  --money-green: #00c853;
  --money-green-dark: #00a344;
  --money-green-light: #69f0ae;
  --money-green-glow: rgba(0, 200, 83, 0.3);
  --money-gold: #ffd700;
  --money-gold-dark: #b8860b;
  
  /* Semantic Colors */
  --bg-primary: #0a0a0a;
  --bg-secondary: #141414;
  --bg-tertiary: #1a1a1a;
  --bg-elevated: #222222;
  
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.5);
  --text-disabled: rgba(255, 255, 255, 0.3);
  
  --border-primary: rgba(255, 255, 255, 0.1);
  --border-secondary: rgba(255, 255, 255, 0.06);
  --border-green: rgba(0, 200, 83, 0.3);
  
  /* Status Colors */
  --status-active: #00c853;
  --status-pending: #f59e0b;
  --status-rejected: #ef4444;
  --status-flagged: #f97316;
  
  /* Spacing */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* Shadows */
  --shadow-green: 0 0 30px rgba(0, 200, 83, 0.2);
  --shadow-green-sm: 0 0 15px rgba(0, 200, 83, 0.15);
  --shadow-dark: 0 4px 30px rgba(0, 0, 0, 0.5);
  --shadow-elevated: 0 8px 40px rgba(0, 0, 0, 0.6);
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

img {
  max-width: 100%;
  height: auto;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-primary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--money-green-dark);
}

/* Selection */
::selection {
  background: var(--money-green-glow);
  color: var(--text-primary);
}

/* Money Background Pattern */
.money-bg {
  background-image: 
    radial-gradient(circle at 20% 80%, rgba(0, 200, 83, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(0, 200, 83, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(255, 215, 0, 0.02) 0%, transparent 40%);
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Typography Utilities */
.text-green {
  color: var(--money-green);
}

.text-gold {
  color: var(--money-gold);
}

.text-muted {
  color: var(--text-muted);
}

.gradient-text {
  background: linear-gradient(135deg, var(--money-green) 0%, var(--money-green-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   Navigation
   ============================================ */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-primary);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

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

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--money-green) 0%, var(--money-green-dark) 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--money-black);
  font-weight: 700;
  font-size: 0.875rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

.nav-links a.admin-only {
  color: var(--money-green);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* User Menu */
.user-menu {
  position: relative;
}

.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.user-btn:hover {
  border-color: var(--border-green);
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--money-green-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--money-green);
}

.user-avatar.investor {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.user-avatar.admin {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 500;
  display: none;
}

@media (min-width: 640px) {
  .user-name {
    display: block;
  }
}

.user-btn .chevron {
  transition: transform 0.2s ease;
}

.user-menu.open .chevron {
  transform: rotate(180deg);
}

/* Dropdown */
.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  overflow: hidden;
}

.user-menu.open .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
  border-bottom: 1px solid var(--border-primary);
}

.dropdown-avatar {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--money-green-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--money-green);
  flex-shrink: 0;
}

.dropdown-avatar.investor {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.dropdown-avatar.admin {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.dropdown-header p:first-of-type {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding: 2px 8px;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-sm);
  background: var(--money-green-glow);
  color: var(--money-green);
}

.user-type.investor {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa;
}

.user-type.admin {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.dropdown-links {
  padding: 8px;
}

.dropdown-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.dropdown-links a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.dropdown-footer {
  padding: 8px;
  border-top: 1px solid var(--border-primary);
}

.dropdown-footer a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: #ef4444;
  transition: all 0.2s ease;
}

.dropdown-footer a:hover {
  background: rgba(239, 68, 68, 0.1);
}

/* Menu Toggle */
.menu-toggle {
  display: none;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--bg-primary);
  border-top: 1px solid var(--border-primary);
  padding: 16px 0;
  z-index: 999;
}

.mobile-menu.open {
  display: block;
}

.mobile-menu a {
  display: block;
  padding: 12px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.mobile-menu a:hover,
.mobile-menu a.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   Buttons
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--money-green) 0%, var(--money-green-dark) 100%);
  color: var(--money-black);
}

.btn-primary:hover {
  box-shadow: var(--shadow-green);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
}

.btn-secondary:hover {
  border-color: var(--money-green);
  color: var(--money-green);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-primary);
}

.btn-ghost:hover {
  border-color: var(--money-green);
  color: var(--money-green);
  background: var(--money-green-glow);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.5);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
}

.btn-investor {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.btn-investor:hover {
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3);
}

.btn-full {
  width: 100%;
}

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px;
  background: white;
  color: #1f2937;
  font-weight: 500;
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
}

.btn-google:hover {
  background: #f3f4f6;
}

.google-icon {
  width: 20px;
  height: 20px;
}

/* ============================================
   Forms
   ============================================ */

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.form-group label span {
  color: var(--text-muted);
  font-weight: 400;
}

.input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.input:focus {
  outline: none;
  border-color: var(--money-green);
  box-shadow: 0 0 0 3px var(--money-green-glow);
}

.input::placeholder {
  color: var(--text-muted);
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.4)' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
}

textarea.input {
  resize: vertical;
  min-height: 80px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.input-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.form-group:has(.input-icon) {
  position: relative;
}

.form-group:has(.input-icon) .input {
  padding-left: 40px;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-primary);
}

.divider span {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============================================
   Utility Classes
   ============================================ */

.hidden {
  display: none !important;
}

.w-full {
  width: 100%;
}

/* Main Content Padding */
main {
  padding-top: 64px;
  min-height: 100vh;
}

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

/* Fade In Up Animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Slide In From Left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide In From Right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Float Animation */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Pulse Glow Animation */
@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(0, 200, 83, 0.2);
  }
  50% {
    box-shadow: 0 0 40px rgba(0, 200, 83, 0.4);
  }
}

/* Shimmer Animation */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Scale In Animation */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Bounce Animation */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* Animation Utility Classes */
.animate-fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.animate-slide-in-left {
  animation: slideInLeft 0.6s ease-out forwards;
}

.animate-slide-in-right {
  animation: slideInRight 0.6s ease-out forwards;
}

.animate-float {
  animation: float 3s ease-in-out infinite;
}

.animate-pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

.animate-scale-in {
  animation: scaleIn 0.4s ease-out forwards;
}

.animate-bounce {
  animation: bounce 2s ease-in-out infinite;
}

/* Stagger Animation Delays */
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }
.animate-delay-5 { animation-delay: 0.5s; }

/* Initially hidden for scroll animations */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-animate.visible {
  opacity: 1;
  transform: translateY(0);
}
