/* ReadmeDesign - Shared Stylesheet */
/* ========== ROOT & VARIABLES ========== */
:root {
  --emerald: #10b981;
  --cyan: #06b6d4;
  --bg-base: #090d16;
  --bg-card: #0f1623;
  --bg-panel: #141c2e;
  --border: #1e2d45;
  --text-primary: #c9d1d9;
  --text-secondary: #8b949e;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-base);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ========== NOISE OVERLAY ========== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

@media (max-width: 768px) {
  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
}

/* ========== GRADIENT TEXT ========== */
.gradient-text {
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 50%, #818cf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-warm {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 60%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-bg {
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
}

/* ========== GLASS MORPHISM ========== */
.glass-card {
  background: rgba(15, 22, 35, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.glass-effect {
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ========== GRID BACKGROUND ========== */
.grid-bg {
  background-image:
    linear-gradient(rgba(16, 185, 129, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 185, 129, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* ========== GLOW ORBS ========== */
.orb-emerald {
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.orb-cyan {
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.10) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.orb-purple {
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

/* ========== NAVIGATION ========== */
.nav-blur {
  background: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  width: 100%;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.logo:hover {
  opacity: 0.8;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(to bottom right, #10b981, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-ring 2s ease-in-out infinite;
}

.logo-icon i {
  color: white;
  font-size: 18px;
}

.logo-text {
  color: white;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.logo-subtext {
  font-size: 12px;
  color: #64748b;
  font-family: 'JetBrains Mono', monospace;
  margin-top: -4px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  color: #94a3b8;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a:hover {
  color: #10b981;
}

.nav-links a i {
  font-size: 12px;
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  transition: color 0.2s ease;
}

.mobile-menu-btn:hover {
  color: white;
}

.mobile-menu {
  display: none;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid var(--border);
  padding: 16px;
}

.mobile-menu.active {
  display: block;
}

.mobile-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #cbd5e1;
  text-decoration: none;
  padding: 12px 0;
  font-weight: 500;
  transition: color 0.2s ease;
}

.mobile-menu a:hover {
  color: #10b981;
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .mobile-menu-btn {
    display: block;
  }
}

/* ========== BUTTONS ========== */
.cta-btn {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: white;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 15px;
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.cta-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.cta-btn:hover::after {
  opacity: 1;
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.4);
}

.cta-btn:active {
  transform: translateY(0);
}

.cta-btn.secondary {
  background: transparent;
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.5);
}

.cta-btn.secondary:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: #10b981;
  box-shadow: none;
}

.outline-btn {
  background: transparent;
  color: #10b981;
  font-weight: 600;
  padding: 13px 28px;
  border-radius: 10px;
  border: 1px solid rgba(16, 185, 129, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 15px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.outline-btn:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: #10b981;
  transform: translateY(-2px);
}

/* ========== BADGES ========== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  font-family: 'JetBrains Mono', monospace;
}

.badge-emerald {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-purple {
  background: rgba(129, 140, 248, 0.15);
  color: #818cf8;
  border: 1px solid rgba(129, 140, 248, 0.3);
}

.badge-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-rose {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* ========== FORMS ========== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}

.form-input,
.form-textarea {
  background: #0d1424;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  padding: 12px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  width: 100%;
  transition: all 0.2s ease;
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #484f58;
}

.form-input:focus,
.form-textarea:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
  font-family: 'Inter', sans-serif;
}

/* ========== CARDS ========== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s ease;
}

.card:hover {
  border-color: rgba(16, 185, 129, 0.3);
  transform: translateY(-2px);
}

/* ========== TEMPLATE CARDS — NEW DESIGN ========== */
.template-card {
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(135deg, rgba(14,21,35,0.95) 0%, rgba(10,15,28,0.98) 100%);
  box-shadow: 0 8px 32px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255,255,255,0.05);
  cursor: pointer;
  align-self: start;
  height: auto;
}

.template-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(16,185,129,0.1) 0%, rgba(6,182,212,0.05) 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
}

.template-card:hover::before {
  opacity: 1;
}

.template-card:hover {
  transform: translateY(-8px) scale(1.01);
  border-color: rgba(16,185,129,0.4);
  box-shadow: 0 24px 64px rgba(0,0,0,0.6), 0 0 20px rgba(16,185,129,0.1), inset 0 1px 1px rgba(255,255,255,0.08);
}

/* Card header section */
#templates .template-card > .p-5 {
  padding: 24px 24px 16px !important;
  background: transparent !important;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

/* Card icon */
#templates .template-card .w-10.h-10 {
  width: 48px !important;
  height: 48px !important;
  border-radius: 12px !important;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  font-size: 1.5rem;
}

/* Top badge pill */
#templates .template-card > .p-5 > div:first-child .badge {
  padding: 6px 16px !important;
  font-size: 12px !important;
  letter-spacing: 0.04em !important;
  border-radius: 100px !important;
  font-weight: 600 !important;
  background: rgba(255,255,255,0.08) !important;
  border: 1px solid rgba(255,255,255,0.12) !important;
  color: #a5f3fc !important;
}

/* Card title */
#templates .template-card h3 {
  font-size: 1.25rem !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
  letter-spacing: -0.015em;
  margin-top: 18px !important;
  color: #ffffff !important;
}

/* Card description */
#templates .template-card > .p-5 > p {
  font-size: 13px !important;
  line-height: 1.6 !important;
  color: #94a3b8 !important;
  margin-top: 10px !important;
}

/* Terminal preview window — max-height clamp prevents any stretching */
#templates .template-card .terminal-window {
  margin: 14px 24px 0 !important;
  border-radius: 14px !important;
  max-height: 160px !important;
  height: auto !important;
  min-height: 0 !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  background: rgba(5,10,20,0.8) !important;
  overflow: hidden !important;
  flex: 0 0 auto !important;
  display: block !important;
  position: relative;
  z-index: 1;
  box-shadow: inset 0 1px 3px rgba(255,255,255,0.05), 0 4px 16px rgba(0,0,0,0.3) !important;
}

/* Terminal bar */
#templates .template-card .terminal-bar {
  background: rgba(26,34,52,0.8) !important;
  border-bottom: 1px solid rgba(255,255,255,0.05) !important;
  padding: 10px 14px !important;
}

/* Terminal body — block display, no flex, no min-height */
#templates .template-card .terminal-body {
  display: block !important;
  padding: 10px 12px !important;
  font-size: 9.5px !important;
  line-height: 1.5 !important;
  background: transparent !important;
  color: #9fb5d2 !important;
  min-height: 0 !important;
  height: auto !important;
  font-family: 'JetBrains Mono', monospace !important;
  overflow: hidden !important;
}

/* Small badges inside terminal */
#templates .template-card .terminal-body .badge {
  padding: 3px 10px !important;
  font-size: 10px !important;
  letter-spacing: 0.03em !important;
  border-radius: 100px !important;
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
}

/* Bottom section (tags + CTA) */
#templates .template-card .px-5.pb-5 {
  padding: 16px 24px 20px !important;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 12px !important;
}

/* Tag badges row */
#templates .template-card .px-5.pb-5 .flex.flex-wrap.gap-2 {
  margin-bottom: 0 !important;
  gap: 8px !important;
  display: flex !important;
  flex-wrap: wrap !important;
}

/* Preview Template button — full-width solid gradient */
#templates .template-card .px-5.pb-5 > a:last-child {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  padding: 13px 16px !important;
  border-radius: 12px !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  text-decoration: none !important;
  border: none !important;
  background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 8px 24px rgba(16,185,129,0.25) !important;
}

#templates .template-card .px-5.pb-5 > a:last-child:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 32px rgba(16,185,129,0.35) !important;
}

/* Responsive */
@media (max-width: 1024px) {
  #templates .template-card {
    border-radius: 20px;
  }
  #templates .template-card > .p-5 {
    padding: 22px 22px 14px !important;
  }
  #templates .template-card .w-10.h-10 {
    width: 44px !important;
    height: 44px !important;
  }
  #templates .template-card h3 {
    font-size: 1.12rem !important;
  }
  #templates .template-card .terminal-window {
    margin: 12px 20px 0 !important;
    max-height: 150px !important;
  }
  #templates .template-card .terminal-body {
    padding: 9px 11px !important;
    font-size: 9px !important;
  }
  #templates .template-card .px-5.pb-5 {
    padding: 14px 20px 18px !important;
  }
}

@media (max-width: 768px) {
  #templates .template-card {
    border-radius: 18px;
  }
  #templates .template-card > .p-5 {
    padding: 18px 18px 14px !important;
  }
  #templates .template-card .w-10.h-10 {
    width: 40px !important;
    height: 40px !important;
  }
  #templates .template-card h3 {
    font-size: 1.05rem !important;
    margin-top: 12px !important;
  }
  #templates .template-card > .p-5 > p {
    font-size: 11px !important;
  }
  #templates .template-card .terminal-window {
    margin: 10px 16px 0 !important;
    max-height: 140px !important;
    border-radius: 12px !important;
  }
  #templates .template-card .terminal-body {
    padding: 8px 10px !important;
    font-size: 8.5px !important;
    line-height: 1.4 !important;
  }
  #templates .template-card .px-5.pb-5 {
    padding: 12px 16px 16px !important;
  }
  #templates .template-card .px-5.pb-5 > a:last-child {
    padding: 10px 12px !important;
    font-size: 12px !important;
    border-radius: 10px !important;
  }
}

@media (max-width: 640px) {
  #templates .template-card {
    border-radius: 16px;
  }
  #templates .template-card > .p-5 {
    padding: 16px 14px 12px !important;
  }
  #templates .template-card h3 {
    font-size: 0.95rem !important;
  }
  #templates .template-card .terminal-window {
    margin: 8px 14px 0 !important;
    max-height: 130px !important;
  }
  #templates .template-card .terminal-body {
    padding: 8px 10px !important;
    font-size: 8px !important;
  }
  #templates .template-card .px-5.pb-5 {
    padding: 10px 14px 14px !important;
  }
}

/* ========== TERMINAL WINDOW ========== */
.terminal-window {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0d1424;
}

.terminal-bar {
  background: #1a2235;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }

.terminal-body {
  background: #0d1424;
  padding: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #8b9ab0;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Link reset so terminal-window anchors inherit styles */
.link-reset { text-decoration: none; color: inherit; display: block; }

/* Direct Preview overlay button */
.direct-preview-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: rgba(2,6,23,0.7);
  color: #cfeeea;
  border: 1px solid rgba(16,185,129,0.12);
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 8px;
  text-decoration: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 12;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.template-card:hover .direct-preview-btn {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ========== ANIMATIONS ========== */
@keyframes spin-slow {
  to { transform: rotate(360deg); }
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes shimmer {
  0% { background-position: -700px 0; }
  100% { background-position: 700px 0; }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.spin-slow { animation: spin-slow 8s linear infinite; }
.pulse-ring { animation: pulse-ring 2s ease-in-out infinite; }
.float { animation: float 6s ease-in-out infinite; }
.shimmer { animation: shimmer 2.5s linear infinite; }
.slide-in { animation: slide-in 0.4s ease forwards; }
.fade-in { animation: fade-in 0.4s ease forwards; }

/* ========== UTILITIES ========== */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  width: 100%;
}

.text-center { text-align: center; }
.text-white { color: white; }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }
.text-emerald-400 { color: #34d399; }

.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }

.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.grid { display: grid; }
.grid-cols-1 { grid-template-columns: 1fr; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 768px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr !important; }
  .hidden-mobile { display: none; }
}

@media (max-width: 640px) {
  .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr !important; }
}

/* ========== SCROLLBAR ========== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
}

::-webkit-scrollbar-thumb {
  background: #1e2d45;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #10b981;
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ========== PRINT STYLES ========== */
@media print {
  body::before { display: none; }
  .nav-blur { display: none; }
  .no-print { display: none; }
}
