/* ===== 2026 Modern AI Design System for SVClub ===== */
/* Non-destructive enhancements - layered on top of existing styles */

/* ===== 1. CSS Variables for Modern Design ===== */
:root {
  /* Enhanced color palette */
  --gradient-primary: linear-gradient(135deg, #facc15 0%, #eab308 50%, #ca8a04 100%);
  --gradient-bg: linear-gradient(180deg, #08080a 0%, #0c0c0f 50%, #08080a 100%);
  --gradient-card: linear-gradient(145deg, rgba(26,26,30,0.8) 0%, rgba(17,17,20,0.9) 100%);
  --gradient-accent: linear-gradient(90deg, var(--accent) 0%, var(--accent-bright) 100%);
  
  /* Glow effects */
  --glow-accent: 0 0 40px rgba(234,179,8,0.15);
  --glow-text: 0 0 20px rgba(234,179,8,0.3);
  --glow-card: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05);
  
  /* Motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  
  /* Typography scale */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;
  --text-4xl: 2.5rem;
  
  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;
}

/* ===== 2. Animated Background ===== */
body {
  background: var(--bg);
  background-image: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(234,179,8,0.08) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(34,197,94,0.05) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 0% 50%, rgba(59,130,246,0.05) 0%, transparent 50%);
  background-attachment: fixed;
}

/* Utility */
.hidden { display: none !important; }

/* ===== 3. Enhanced Header ===== */
.header {
  background: rgba(8,8,10,0.85);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 1px 0 rgba(0,0,0,0.5);
}

.header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(234,179,8,0.3), transparent);
}

.logo {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: transform 0.3s var(--ease-spring);
}

.logo:hover {
  transform: scale(1.02);
}

/* ===== 4. Modern Navigation ===== */
.nav-btn {
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nav-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s;
}

.nav-btn:hover::before {
  opacity: 1;
}

.nav-btn.active {
  background: var(--gradient-primary);
  color: #000;
  font-weight: 700;
  box-shadow: var(--glow-accent);
}

.nav-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ===== 5. Hero Section Enhancement ===== */
.hero {
  background: 
    radial-gradient(ellipse 100% 70% at 50% 0%, rgba(234,179,8,0.12) 0%, transparent 50%),
    linear-gradient(180deg, #08080a 0%, #0f0f12 50%, #08080a 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  opacity: 0.03;
  pointer-events: none;
}

.hero-mascot {
  animation: float 6s ease-in-out infinite;
  display: inline-block;
}

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

.hero h1 {
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 50%, var(--text) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shine 3s linear infinite;
}

@keyframes shine {
  0% { background-position: 200% center; }
  100% { background-position: -200% center; }
}

.hero-ctas {
  gap: 16px;
}

.btn {
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.hero-protocol {
  background: 
    linear-gradient(135deg, rgba(26,26,30,0.9) 0%, rgba(17,17,20,0.95) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  position: relative;
}

.hero-protocol::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(234,179,8,0.3), transparent);
}

/* ===== 6. Card Enhancements ===== */
.card {
  background: var(--gradient-card);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: var(--glow-card);
  position: relative;
  transition: all 0.3s var(--ease-out-expo);
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(234,179,8,0.2);
  box-shadow: var(--glow-card), 0 0 30px rgba(234,179,8,0.1);
}

.composer {
  background: var(--gradient-card);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: var(--glow-card);
}

.composer:focus-within {
  border-color: rgba(234,179,8,0.3);
  box-shadow: var(--glow-card), 0 0 20px rgba(234,179,8,0.1);
}

.composer textarea {
  background: transparent;
  border: none;
  color: var(--text);
  resize: none;
}

.composer textarea:focus {
  outline: none;
}

/* ===== 7. Post Card Improvements ===== */
.post {
  background: var(--gradient-card);
  border: 1px solid rgba(255,255,255,0.06);
  position: relative;
  transition: all 0.3s var(--ease-out-expo);
}

.post::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, transparent 50%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.post:hover {
  transform: translateY(-2px);
  border-color: rgba(234,179,8,0.15);
  box-shadow: var(--glow-card), 0 0 20px rgba(0,0,0,0.3);
}

.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-bright) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #000;
  font-size: 14px;
  flex-shrink: 0;
}

.post-handle {
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-address {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text3);
  opacity: 0.6;
}

.post-content {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.post-content a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.post-content a:hover {
  border-bottom-color: var(--accent);
}

.post-actions {
  display: flex;
  gap: 4px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.action-btn {
  background: transparent;
  border: none;
  color: var(--text2);
  padding: 8px 12px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s var(--ease-out-expo);
}

.action-btn:hover {
  background: rgba(234,179,8,0.1);
  color: var(--accent);
  transform: scale(1.02);
}

.action-btn.upvoted {
  color: var(--accent);
}

.action-btn.upvoted:hover {
  background: rgba(234,179,8,0.15);
}

/* ===== 8. Stats Cards ===== */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 600px;
  margin: 24px auto 0;
}

.hero-stat {
  background: var(--gradient-card);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  transition: all 0.3s var(--ease-out-expo);
}

.hero-stat:hover {
  transform: translateY(-4px);
  border-color: rgba(234,179,8,0.2);
}

.hero-stat .num {
  font-size: 32px;
  font-weight: 800;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-stat .label {
  font-size: 11px;
  color: var(--text3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
}

/* ===== 9. Sidebar Enhancements ===== */
.side-col .card {
  background: var(--gradient-card);
}

.sidebar-profile {
  text-align: center;
  padding: 20px;
}

.sidebar-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-bright) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: #000;
  margin: 0 auto 12px;
  box-shadow: 0 4px 20px rgba(234,179,8,0.3);
}

/* ===== 10. Form Elements ===== */
input[type="text"],
input[type="search"],
textarea {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  transition: all 0.2s;
  font-family: inherit;
}

input[type="text"]:focus,
input[type="search"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface2);
  box-shadow: 0 0 0 3px rgba(234,179,8,0.1);
}

input::placeholder,
textarea::placeholder {
  color: var(--text3);
}

/* ===== 11. Animations & Micro-interactions ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.post,
.card {
  animation: fadeIn 0.4s var(--ease-out-expo);
}

.post:nth-child(1) { animation-delay: 0ms; }
.post:nth-child(2) { animation-delay: 50ms; }
.post:nth-child(3) { animation-delay: 100ms; }
.post:nth-child(4) { animation-delay: 150ms; }
.post:nth-child(5) { animation-delay: 200ms; }

/* ===== 12. Loading States ===== */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== 13. Toast Notifications ===== */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface3);
  color: var(--text);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  opacity: 0;
  transition: all 0.3s var(--ease-out-expo);
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  background: linear-gradient(135deg, rgba(34,197,94,0.2) 0%, var(--surface3) 100%);
  border-color: rgba(34,197,94,0.3);
}

.toast.error {
  background: linear-gradient(135deg, rgba(239,68,68,0.2) 0%, var(--surface3) 100%);
  border-color: rgba(239,68,68,0.3);
}

/* ===== 14. Responsive Improvements ===== */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  
  .side-col {
    display: none;
  }
  
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  
  .hero h1 {
    font-size: 28px;
  }
  
  .hero-tagline {
    font-size: 14px;
  }
  
  .hero-ctas {
    flex-direction: column;
    align-items: center;
  }
  
  .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 40px 16px 32px;
  }
  
  .hero-mascot {
    font-size: 56px;
  }
  
  .hero h1 {
    font-size: 24px;
  }
  
  .post-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .post-actions {
    flex-wrap: wrap;
  }
}

/* ===== 15. Focus States (Accessibility) ===== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn:focus-visible,
.nav-btn:focus-visible,
.action-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(234,179,8,0.2);
}

/* ===== 16. Scrollbar Styling ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
  background: var(--border2);
}

/* ===== 17. Selection Styling ===== */
::selection {
  background: rgba(234,179,8,0.3);
  color: var(--text);
}

/* ===== 18. Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .hero-mascot {
    animation: none;
  }
  
  .hero h1 {
    animation: none;
  }
}