/* Digital Brains — Custom CSS */

/* --- Footer Override --- */
.footer__inner {
  justify-content: center !important;
}

.third-party-box {
  display: inline-block;
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  margin-top: 0.25rem;
  font-size: inherit;
  text-align: center;
}

/* --- Override Terminal Theme Container --- */
.container {
  max-width: 100% !important;
  padding: 2rem 1rem !important;
  border-right: none !important;
}

.content {
  width: 100%;
}

/* --- Color Palette System --- */
:root {
  /* Default palette (Terminal Green) */
  --bg: #0d0d0d;
  --text: #e0e0e0;
  --primary: #00ff41;
  --secondary: #008f11;
  --hover: #33ff66;
  --active: #00cc33;
  --code-bg: #1a1a1a;
  --card-bg: #141414;
  --border: #2a2a2a;

  /* Map to terminal theme vars so nav/logo follow palette */
  --accent: var(--primary);
  --background: var(--bg);
}

/* Palette presets — applied via html[data-palette] */
html[data-palette="purple"] {
  --primary: #bf5fff;
  --secondary: #7b2fbe;
  --hover: #d48aff;
  --active: #9944dd;
  --accent: var(--primary);
}

html[data-palette="ocean"] {
  --primary: #00bfff;
  --secondary: #006994;
  --hover: #33ccff;
  --active: #0088dd;
  --accent: var(--primary);
}

html[data-palette="amber"] {
  --primary: #ffb000;
  --secondary: #cc7a00;
  --hover: #ffcc33;
  --active: #dd9900;
  --accent: var(--primary);
}

/* Inverted (light mode) */
html[data-invert="true"] {
  --bg: #f5f5f5;
  --text: #0d0d0d;
  --primary: #00aa2a;
  --secondary: #006611;
  --hover: #33cc44;
  --active: #008822;
  --code-bg: #e8e8e8;
  --card-bg: #eeeeee;
  --border: #cccccc;
  --accent: var(--primary);
  --background: var(--bg);
  --foreground: var(--text);
}

html[data-invert="true"][data-palette="purple"] {
  --primary: #9944dd;
  --secondary: #6b2faa;
  --hover: #aa55ee;
  --active: #8833cc;
  --accent: var(--primary);
}

html[data-invert="true"][data-palette="ocean"] {
  --primary: #0077bb;
  --secondary: #005588;
  --hover: #3399dd;
  --active: #0066aa;
  --accent: var(--primary);
}

html[data-invert="true"][data-palette="amber"] {
  --primary: #cc8800;
  --secondary: #996600;
  --hover: #dd9922;
  --active: #bb7711;
  --accent: var(--primary);
}

/* --- Home Page Styles --- */
.home .hero {
  text-align: center;
  padding: 3rem 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.home .hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--primary);
  margin-bottom: 1.25rem;
}

.home .tagline {
  color: var(--text);
  opacity: 0.8;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* Search bar */
.search-container {
  position: relative;
  max-width: 500px;
  width: 90%;
  margin: 0 auto 1.5rem;
}

#search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--code-bg);
  border: 2px solid var(--border);
  color: var(--text);
  font-size: clamp(0.9rem, 2vw, 1rem);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s;
}

#search-input:focus {
  border-color: var(--primary);
}

.search-hint {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text);
  opacity: 0.4;
  font-size: 0.8rem;
}

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  padding: 0 1rem;
}

.filter-btn {
  padding: 0.4rem 1rem;
  background: var(--code-bg);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  border-radius: 3px;
  font-size: clamp(0.8rem, 2vw, 0.9rem);
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  color: var(--bg);
  border-color: var(--primary);
}

/* Souls grid */
.souls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 0 1rem 2rem;
  max-width: 960px;
  margin: 0 auto;
}

.soul-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
  transition: border-color 0.2s, transform 0.2s;
}

.soul-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.soul-card h3 {
  margin: 0 0 0.5rem;
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.soul-card h3 a {
  color: var(--text);
  text-decoration: none;
}

.soul-card h3 a:hover {
  color: var(--primary);
}

.soul-card p {
  color: var(--text);
  opacity: 0.7;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  margin: 0 0 1rem;
  line-height: 1.5;
}

.card-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.category-badge, .card-meta .category {
  color: var(--secondary);
  font-size: clamp(0.7rem, 1.5vw, 0.8rem);
  text-transform: uppercase;
}

.price-badge, .card-meta .price {
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  font-size: clamp(0.7rem, 1.5vw, 0.75rem);
  font-weight: bold;
}

.price.free {
  background: var(--secondary);
  color: var(--bg);
}

.price.premium {
  background: #ff6b6b;
  color: var(--bg);
}

/* CTA section */
.cta-section {
  text-align: center;
  padding: 2rem 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.cta-section h2 {
  color: var(--text);
  margin-bottom: 1rem;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
}

.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--primary);
  color: var(--bg);
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  transition: background 0.2s;
  font-size: clamp(0.9rem, 2vw, 1rem);
}

.btn:hover {
  background: var(--hover);
}

/* Email signup section */
.email-signup-section {
  text-align: center;
  padding: 2rem 1rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.email-signup-section p {
  color: var(--text);
  opacity: 0.7;
  margin-bottom: 1rem;
}

/* --- Inline Email Form --- */
.inline-form {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  max-width: 400px;
  margin: 0 auto;
}

.inline-form input[type="email"] {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
}

.inline-form input[type="email"]:focus {
  border-color: var(--accent);
}

.inline-form button {
  padding: 0.6rem 1.2rem;
  background: var(--accent);
  color: var(--bg);
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
}

.inline-form button:hover {
  opacity: 0.85;
}

@media (max-width: 480px) {
  .inline-form {
    flex-direction: column;
  }
}

/* --- Premium Landing Page --- */
.premium-landing {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.premium-header {
  text-align: center;
  margin-bottom: 3rem;
}

.premium-header h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.premium-header .tagline {
  color: var(--text);
  opacity: 0.8;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.feature-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
  transition: border-color 0.2s;
}

.feature-card:hover {
  border-color: var(--primary);
}

.feature-card h3 {
  color: var(--text);
  margin: 0 0 0.5rem;
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.feature-card p {
  color: var(--text);
  opacity: 0.7;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
  line-height: 1.5;
}

.why-premium {
  margin-bottom: 3rem;
}

.why-premium h2 {
  color: var(--text);
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  margin-bottom: 1rem;
}

.why-premium p {
  color: var(--text);
  opacity: 0.8;
  margin-bottom: 1rem;
}

.why-premium ul {
  list-style: none;
  padding: 0;
}

.why-premium li {
  color: var(--text);
  opacity: 0.7;
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.5rem;
  font-size: clamp(0.85rem, 2vw, 0.95rem);
}

.why-premium li::before {
  content: "→";
  color: var(--primary);
  position: absolute;
  left: 0;
}

.email-signup-section h2 {
  color: var(--text);
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  margin-bottom: 1rem;
}

.back-to-free {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

/* --- Soul Page Styles --- */
.post-header .category-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: var(--secondary);
  color: var(--bg);
  border-radius: 3px;
  font-size: clamp(0.75rem, 1.5vw, 0.8rem);
  text-transform: uppercase;
  margin-right: 0.5rem;
}

.post-header .price-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  font-size: clamp(0.75rem, 1.5vw, 0.8rem);
  font-weight: bold;
}

.post-header .price-badge.free {
  background: var(--secondary);
  color: var(--bg);
}

.post-header .price-badge.premium {
  background: #ff6b6b;
  color: var(--bg);
}

.soul-id {
  font-size: clamp(0.7rem, 1.5vw, 0.8rem);
  color: var(--text);
  opacity: 0.5;
  margin-left: 1rem;
}

/* Post wrapper — center all content */
.post {
  max-width: 72ch;
  margin: 0 auto;
}

.post-header {
  text-align: center;
  margin-bottom: 2rem;
}

.post-header h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--primary);
  margin-bottom: 1.25rem;
}

.post-meta {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

/* Post content — constrained width for readability */
.post-content {
  max-width: 72ch;
  margin: 0 auto;
}

.post-footer {
  text-align: center;
  margin-top: 2rem;
}

.action-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.post-footer .tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  margin-bottom: 1.25rem;
}

.tag {
  color: var(--secondary);
  text-decoration: none;
  font-size: clamp(0.8rem, 2vw, 0.85rem);
}

.tag:hover {
  color: var(--primary);
}

.soul-id-footer {
  margin-top: 1rem;
  font-size: clamp(0.75rem, 1.5vw, 0.8rem);
  color: var(--text);
  opacity: 0.5;
}

.soul-id-footer code {
  background: var(--code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: clamp(0.75rem, 1.5vw, 0.8rem);
}

.copy-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 4px;
  cursor: pointer;
  font-size: clamp(0.85rem, 2vw, 0.9rem);
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: var(--primary);
  color: var(--bg);
}

.download-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 4px;
  cursor: pointer;
  font-size: clamp(0.85rem, 2vw, 0.9rem);
  transition: all 0.2s ease;
}

.download-btn:hover {
  background: var(--primary);
  color: var(--bg);
}

.btn-source, .btn-license {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: transparent;
  border: 1px solid var(--primary);
  color: var(--primary);
  border-radius: 4px;
  cursor: pointer;
  font-size: clamp(0.85rem, 2vw, 0.9rem);
  font-weight: bold;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-source:hover, .btn-license:hover {
  background: var(--primary);
  color: var(--bg);
  text-decoration: none;
}

/* --- Color Picker (header area) --- */
.color-picker {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-left: auto;
}

.palette-btn {
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.palette-btn span {
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.palette-btn:hover span {
  transform: scale(1.1);
}

.palette-btn.active span {
  box-shadow: 0 0 0 2px var(--text), 0 0 8px currentColor;
}

.palette-btn[data-palette="green"] span { background: #00ff41; }
.palette-btn[data-palette="purple"] span { background: #b388ff; }
.palette-btn[data-palette="ocean"] span { background: #00bcd4; }
.palette-btn[data-palette="amber"] span { background: #ffab00; }

.invert-toggle {
  padding: 0;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: clamp(2rem, 4.5vw, 2.8rem);
  margin-left: 0.5rem;
}

.invert-toggle:hover {
  font-weight: bold;
}

/* --- Free Souls List Page Styles --- */
.souls-list-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.list-header {
  text-align: center;
  margin-bottom: 3rem;
}

.list-header h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.list-header .tagline {
  color: var(--text);
  opacity: 0.8;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
}

/* --- Responsive Breakpoints --- */

/* Tablet (768px and below) */
@media (max-width: 768px) {
  .home .hero {
    padding: 2rem 1rem;
  }

  .souls-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
  }

  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .color-picker {
    flex-wrap: wrap;
    justify-content: center;
    margin-left: 0;
    margin-top: 0.5rem;
  }

  .header__inner {
    flex-direction: column;
    align-items: center;
  }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
  .home .hero {
    padding: 1.5rem 0.75rem;
  }

  .souls-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 0.75rem 1.5rem;
  }

  .soul-card {
    padding: 1rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    gap: 0.3rem;
  }

  .filter-btn {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
  }

  .search-container {
    width: 95%;
  }

  .premium-landing,
  .souls-list-page {
    padding: 1.5rem 0.75rem;
  }

  .color-picker {
    gap: 0.3rem;
  }

  .palette-btn {
    width: 20px;
    height: 20px;
  }
}

/* Large screens */
@media (min-width: 1200px) {
  .souls-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1100px;
  }

  .features-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* --- Navigation Links — no underline, bold on hover --- */
.navigation-menu a,
.menu__dropdown a {
  text-decoration: none !important;
}

.navigation-menu a:hover,
.menu__dropdown a:hover {
  font-weight: bold !important;
}

/* Active nav link — inverted (primary bg + text color) */
.navigation-menu a.active,
.menu__dropdown a.active {
  background: var(--primary);
  color: var(--bg);
  padding: 5px 18px;
  border-radius: var(--radius);
}

.navigation-menu a.active:hover,
.menu__dropdown a.active:hover {
  font-weight: bold !important;
  background: var(--hover);
  color: var(--bg);
}
