/* ==========================================================================
   island AI Coding - Dark-Tech SaaS Design System
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-dark: #0a0d14;
  --bg-card: rgba(18, 24, 38, 0.7);
  --bg-card-hover: rgba(26, 35, 55, 0.85);
  --border-light: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.4);
  
  --primary-purple: #6366f1;
  --primary-teal: #06b6d4;
  --primary-emerald: #10b981;
  --accent-pink: #ec4899;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* Fonts */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', Roboto, sans-serif;
  --font-mono: 'Cascadia Code', 'SFMono-Regular', Consolas, monospace;
  
  /* Shadows & Effects */
  --glow-primary: 0 0 30px rgba(99, 102, 241, 0.25);
  --glow-teal: 0 0 30px rgba(6, 182, 212, 0.25);
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  overflow-x: hidden;
  line-height: 1.6;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: #111827;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-150%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Background Aurora Effects */
.aurora-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.aurora-blob {
  position: absolute;
  filter: blur(120px);
  opacity: 0.35;
  border-radius: 50%;
  animation: float 20s infinite ease-in-out alternate;
}

.aurora-blob-1 {
  top: -10%;
  left: 20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--primary-purple) 0%, transparent 70%);
}

.aurora-blob-2 {
  top: 40%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--primary-teal) 0%, transparent 70%);
  animation-delay: -7s;
}

.aurora-blob-3 {
  bottom: -10%;
  left: 30%;
  width: 550px;
  height: 550px;
  background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
  animation-delay: -14s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 30px) scale(1.1); }
  100% { transform: translate(-30px, -20px) scale(0.95); }
}

/* Typography Helpers */
.gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 40%, var(--primary-purple) 70%, var(--primary-teal) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

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

/* Header & Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(10, 13, 20, 0.75);
  border-bottom: var(--glass-border);
  transition: all 0.3s ease;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.brand-mark {
  color: #2dd4bf;
  font-size: 1.15em;
  text-shadow: 0 0 18px rgba(45, 212, 191, 0.4);
}

.ui-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--text-main);
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-purple), var(--primary-teal));
  color: #ffffff;
  box-shadow: var(--glow-primary);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(99, 102, 241, 0.5);
  opacity: 0.95;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: var(--glass-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.875rem;
}

/* Hero Section */
.hero {
  padding-top: 160px;
  padding-bottom: 90px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 30px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 24px;
}

.hero-tag .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary-emerald);
  box-shadow: 0 0 10px var(--primary-emerald);
}

.hero-title {
  font-size: 3.5rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -1.5px;
  margin-bottom: 24px;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 36px;
  max-width: 540px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  align-items: center;
}

/* Code Playground Box */
.code-playground {
  background: rgba(15, 20, 32, 0.85);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: var(--glass-border);
}

.code-tabs {
  display: flex;
  gap: 8px;
}

.code-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.code-tab.active {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

.copy-btn {
  background: rgba(255, 255, 255, 0.05);
  border: var(--glass-border);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.code-body {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: #e2e8f0;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.6;
}

.code-keyword { color: #c084fc; }
.code-string { color: #34d399; }
.code-function { color: #60a5fa; }
.code-comment { color: #94a3b8; }

/* Metrics Section */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 40px;
  margin-bottom: 80px;
}

.metric-card {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.metric-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.3);
}

.metric-value {
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 4px;
}

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

/* Platform Advantages */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 100px;
}

.feature-card {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 26px;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
  border-color: rgba(6, 182, 212, 0.35);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  border-radius: 12px;
  color: #67e8f9;
  background: rgba(6, 182, 212, 0.12);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

.feature-card h3 {
  margin-bottom: 10px;
  font-size: 1.05rem;
  color: var(--text-main);
}

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

/* Models Grid Section */
.section-title {
  text-align: center;
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.section-desc {
  text-align: center;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 48px auto;
  font-size: 1.05rem;
}

.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 100px;
}

.model-card {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.model-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-purple), var(--primary-teal));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.model-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.model-card:hover::before {
  opacity: 1;
}

.model-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.model-name {
  min-width: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
}

.model-name-sub {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.model-tag {
  flex-shrink: 0;
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  white-space: nowrap;
}

.model-tag.tag-hot {
  background: rgba(236, 72, 153, 0.15);
  color: #f472b6;
  border-color: rgba(236, 72, 153, 0.3);
}

.model-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  flex-grow: 1;
}

.model-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 16px;
}

/* Admin Custom Section (Markdown & HTML Zone) */
.custom-section {
  padding: 80px 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.4) 0%, rgba(10, 13, 20, 0.8) 100%);
  border-top: var(--glass-border);
  border-bottom: var(--glass-border);
  margin-bottom: 100px;
}

.custom-card {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  backdrop-filter: blur(16px);
}

/* Prose Dark Styling for Rendered Markdown */
.prose-dark {
  color: #e2e8f0;
  font-size: 1.05rem;
  line-height: 1.8;
  max-width: 100%;
  overflow-x: auto;
}

.prose-dark h1, .prose-dark h2, .prose-dark h3 {
  color: #ffffff;
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.prose-dark h1 { font-size: 2rem; border-bottom: 1px solid var(--border-light); padding-bottom: 12px; }
.prose-dark h2 { font-size: 1.5rem; }
.prose-dark h3 { font-size: 1.25rem; }

.prose-dark p { margin-bottom: 1.25em; }

.prose-dark ul, .prose-dark ol {
  margin-bottom: 1.25em;
  padding-left: 1.5em;
}

.prose-dark li { margin-bottom: 0.5em; }

.prose-dark blockquote {
  border-left: 4px solid var(--primary-purple);
  padding: 12px 20px;
  background: rgba(99, 102, 241, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 1.25em;
  color: #cbd5e1;
}

.prose-dark table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5em;
}

.prose-dark th, .prose-dark td {
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  text-align: left;
}

.prose-dark th {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-weight: 600;
}

.prose-dark code {
  background: rgba(0, 0, 0, 0.4);
  color: #38bdf8;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.prose-dark pre {
  background: #0f172a;
  border: var(--glass-border);
  padding: 18px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: 1.5em;
}

.prose-dark pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* FAQ Section */
.faq-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 100px;
}

.faq-item {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: 28px;
}

.faq-q {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.faq-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(6, 182, 212, 0.45);
  border-radius: 50%;
  color: var(--primary-teal);
  font-size: 0.8rem;
}

.faq-a {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.faq-a a {
  color: #67e8f9;
  text-underline-offset: 3px;
}

.faq-a a:hover {
  color: #a5f3fc;
}

/* Footer */
.footer {
  border-top: var(--glass-border);
  background: rgba(5, 7, 12, 0.95);
  padding: 60px 0 30px 0;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand p {
  color: var(--text-muted);
  margin-top: 12px;
  max-width: 320px;
}

.footer-col h4 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 24px;
  color: var(--text-muted);
}

/* Responsive Styles */
@media (max-width: 1120px) {
  .nav-links {
    display: none;
  }
}

@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 130px;
  }
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .faq-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .hero-title {
    font-size: 2.4rem;
  }
  .nav-container {
    height: 72px;
  }
  .logo {
    gap: 8px;
    font-size: 1.05rem;
  }
  .nav-actions .btn-secondary {
    display: none;
  }
  .nav-actions {
    gap: 8px;
  }
  .nav-actions .btn {
    padding: 10px 14px;
  }
  .code-header {
    gap: 8px;
    padding: 12px;
  }
  .code-tabs {
    min-width: 0;
    gap: 0;
  }
  .code-tab {
    padding: 6px 8px;
  }
  .copy-btn {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    justify-content: center;
    padding: 0;
  }
  .copy-label {
    display: none;
  }
  .custom-card {
    padding: 24px;
  }
  .feature-grid {
    grid-template-columns: 1fr;
  }
  .metrics-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Model Marketplace (models.html) Specific Styles
   ========================================================================== */
.marketplace-hero {
  padding-top: 140px;
  padding-bottom: 40px;
  text-align: center;
}

.search-filter-wrapper {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(16px);
  margin-bottom: 48px;
  box-shadow: var(--glass-shadow);
}

.search-box-group {
  position: relative;
  margin-bottom: 20px;
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
}

.search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px 20px 16px 48px;
  color: #fff;
  font-size: 1.05rem;
  outline: none;
  transition: all 0.25s ease;
}

.search-input:focus {
  border-color: var(--primary-teal);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  background: rgba(255, 255, 255, 0.04);
  border: var(--glass-border);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--primary-purple), var(--primary-teal));
  color: #fff;
  border-color: transparent;
  box-shadow: var(--glow-primary);
}

.marketplace-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.market-model-card {
  background: var(--bg-card);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.market-model-card:hover {
  transform: translateY(-6px);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.model-company-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary-teal);
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.model-code-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: #38bdf8;
}

.code-copy-trigger {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.code-copy-trigger:hover {
  color: #fff;
}

.model-spec-list {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 14px;
}

.model-spec-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rate-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
}


@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
