/* ================================================================
   Bundle Builder — Dark Theme
   ================================================================ */

/* Reset & base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0a0a1a;
  color: #e0e0e0;
  min-height: 100vh;
  line-height: 1.6;
}

a {
  color: #00e5ff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ================================================================
   Header
   ================================================================ */
.bundle-header {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
  background: linear-gradient(135deg, #0a0a1a 0%, #0f1028 50%, #0a0a1a 100%);
  border-bottom: 1px solid #1a1a3a;
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: #00e5ff;
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity 0.2s;
}

.back-link:hover {
  opacity: 0.8;
  text-decoration: none;
}

.bundle-header h1 {
  font-size: 2.4rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #00e5ff, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 1.1rem;
  color: #888;
  max-width: 600px;
  margin: 0 auto;
}

/* ================================================================
   Sort Bar
   ================================================================ */
.sort-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sort-bar label {
  font-size: 0.85rem;
  color: #888;
  font-weight: 500;
}

.sort-bar select {
  background: #12122a;
  color: #e0e0e0;
  border: 1px solid #2a2a4a;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.sort-bar select:focus {
  border-color: #00e5ff;
}

/* ================================================================
   Bundles Grid
   ================================================================ */
.bundles-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

/* ================================================================
   Bundle Card
   ================================================================ */
.bundle-card {
  background: #0f0f24;
  border: 1px solid #1e1e3a;
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.bundle-card:hover {
  border-color: #00e5ff40;
  box-shadow: 0 8px 32px rgba(0, 229, 255, 0.08);
  transform: translateY(-3px);
}

/* Card header */
.bundle-card-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  margin: 0;
}

.bundle-card-desc {
  font-size: 0.9rem;
  color: #777;
  line-height: 1.4;
  margin: 0;
}

/* ================================================================
   Synergy Badge
   ================================================================ */
.synergy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #00e5ff;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.synergy-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 229, 255, 0.12) 40%,
    rgba(0, 229, 255, 0.12) 60%,
    transparent 100%
  );
  animation: synergy-glow 3s ease-in-out infinite;
}

@keyframes synergy-glow {
  0%   { transform: translateX(-50%); }
  50%  { transform: translateX(50%); }
  100% { transform: translateX(-50%); }
}

.synergy-icon {
  font-size: 1rem;
}

/* ================================================================
   Bot Avatar Row
   ================================================================ */
.bot-avatar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-start;
}

.bot-avatar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  position: relative;
}

.bot-avatar-item img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid #1e1e3a;
  background: #12122a;
  object-fit: cover;
  transition: border-color 0.2s, transform 0.2s;
}

.bundle-card:hover .bot-avatar-item img {
  border-color: #2a2a5a;
}

.bot-avatar-item img:hover {
  border-color: #00e5ff;
  transform: scale(1.1);
}

.bot-avatar-name {
  font-size: 0.65rem;
  color: #666;
  text-align: center;
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tooltip on hover */
.bot-avatar-item .avatar-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a3a;
  color: #e0e0e0;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
  border: 1px solid #2a2a4a;
}

.bot-avatar-item .avatar-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #1a1a3a;
}

.bot-avatar-item:hover .avatar-tooltip {
  opacity: 1;
}

/* In-cart checkmark overlay */
.bot-avatar-item.in-cart img {
  border-color: #22c55e;
}

.cart-check {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: #22c55e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: #fff;
  font-weight: 700;
  line-height: 1;
  border: 2px solid #0a0a1a;
}

/* ================================================================
   Savings Badge
   ================================================================ */
.savings-badge {
  display: inline-block;
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
}

/* ================================================================
   Pricing Row
   ================================================================ */
.pricing-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.price-individual {
  font-size: 1rem;
  color: #555;
  text-decoration: line-through;
}

.price-bundle {
  font-size: 1.5rem;
  font-weight: 800;
  color: #00e5ff;
}

.price-per-bot {
  font-size: 0.8rem;
  color: #666;
}

/* ================================================================
   Add Bundle Button
   ================================================================ */
.bundle-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 12px 24px;
  background: linear-gradient(135deg, #00b8d9, #00e5ff);
  color: #0a0a1a;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
  margin-top: auto;
}

.bundle-add-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 229, 255, 0.25);
}

.bundle-add-btn:active {
  transform: translateY(0);
}

.bundle-add-btn.all-in-cart {
  background: #1a1a3a;
  color: #22c55e;
  cursor: default;
  transform: none;
  box-shadow: none;
  border: 1px solid #22c55e40;
}

/* ================================================================
   Toast Notification
   ================================================================ */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #12122a;
  color: #e0e0e0;
  border: 1px solid #00e5ff40;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ================================================================
   Footer
   ================================================================ */
.bundle-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: #444;
  font-size: 0.8rem;
  border-top: 1px solid #1a1a2e;
}

/* ================================================================
   Responsive
   ================================================================ */
@media (max-width: 768px) {
  .bundle-header h1 {
    font-size: 1.8rem;
  }

  .subtitle {
    font-size: 0.95rem;
  }

  .bundles-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .bot-avatar-item img {
    width: 40px;
    height: 40px;
  }

  .bot-avatar-name {
    font-size: 0.6rem;
    max-width: 44px;
  }

  .pricing-row {
    gap: 0.5rem;
  }

  .price-bundle {
    font-size: 1.3rem;
  }

  .sort-bar {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .bundle-header h1 {
    font-size: 1.5rem;
  }

  .bot-avatar-item img {
    width: 36px;
    height: 36px;
  }

  .cart-check {
    width: 14px;
    height: 14px;
    font-size: 0.5rem;
  }
}

/* ================================================================
   Reduced motion
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
  .synergy-badge::before {
    animation: none;
  }

  .bundle-card {
    transition: none;
  }

  .bundle-add-btn {
    transition: none;
  }

  .toast {
    transition: none;
  }

  .bot-avatar-item img {
    transition: none;
  }
}

/* ================================================================
   Hero CTA Buttons
   ================================================================ */
.bundle-header-ctas {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.bundle-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 10px 22px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  background: linear-gradient(135deg, #00b8d9, #6366f1);
  color: #fff;
  transition: opacity 0.2s, transform 0.15s;
}

.bundle-cta-btn.secondary {
  background: rgba(255,255,255,0.08);
  border: 1px solid #2a2a4a;
  color: #a5b4fc;
}

.bundle-cta-btn:hover {
  opacity: 0.88;
  transform: translateY(-2px);
  text-decoration: none;
}

/* ================================================================
   Section headings
   ================================================================ */
.section-heading {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 0.4rem;
}

.section-sub {
  color: #777;
  font-size: 0.95rem;
  margin: 0 0 1.5rem;
}

/* ================================================================
   Featured Bundles Section
   ================================================================ */
.featured-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3rem 1rem 2rem;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

/* Featured card overrides — larger + gradient bg */
.bundle-card.featured-card {
  border-radius: 20px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.bundle-card.featured-card .bundle-card-title {
  font-size: 1.5rem;
}

.bundle-card.featured-card .price-bundle {
  font-size: 2rem;
}

/* Skeleton loader */
.bundle-skeleton {
  background: linear-gradient(90deg, #0f0f24 25%, #14143a 50%, #0f0f24 75%);
  background-size: 200% 100%;
  animation: skeleton-sweep 1.5s ease-in-out infinite;
  border-radius: 20px;
  height: 320px;
  border: 1px solid #1e1e3a;
}

@keyframes skeleton-sweep {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ================================================================
   All Bundles Section
   ================================================================ */
.all-bundles-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.all-bundles-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ================================================================
   Bundle Ribbon (badge)
   ================================================================ */
.bundle-ribbon {
  position: absolute;
  top: 16px;
  right: -28px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 36px;
  transform: rotate(35deg);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
  pointer-events: none;
  z-index: 2;
}

/* ================================================================
   Bundle Card Actions (dual button row)
   ================================================================ */
.bundle-card-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: auto;
}

.bundle-add-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 10px 16px;
  background: linear-gradient(135deg, #00b8d9, #00e5ff);
  color: #0a0a1a;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.bundle-add-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,229,255,0.25);
}

.bundle-add-btn.all-in-cart {
  background: #1a1a3a;
  color: #22c55e;
  cursor: default;
  transform: none;
  box-shadow: none;
  border: 1px solid #22c55e40;
}

.bundle-buy-btn {
  padding: 10px 16px;
  background: transparent;
  border: 1px solid #6366f1;
  border-radius: 10px;
  color: #a5b4fc;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}

.bundle-buy-btn:hover {
  background: #6366f1;
  color: #fff;
  transform: translateY(-2px);
}

/* +N more bots indicator */
.bot-avatar-more {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #1e1e3a;
  border: 2px dashed #3a3a5a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #777;
}

/* ================================================================
   Comparison Table
   ================================================================ */
.compare-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.compare-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid #1e1e3a;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.compare-table th {
  background: #0f0f24;
  color: #777;
  font-weight: 600;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #1e1e3a;
  white-space: nowrap;
}

.compare-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #12122a;
  vertical-align: middle;
}

.compare-table tr:last-child td {
  border-bottom: none;
}

.compare-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.compare-orig {
  color: #555;
}

.compare-bundle-price {
  color: #00e5ff;
  font-size: 1.1rem;
}

.compare-bots {
  color: #888;
  font-size: 0.8rem;
  max-width: 260px;
}

.compare-buy-btn {
  padding: 8px 18px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.2s, transform 0.15s;
}

.compare-buy-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

/* ================================================================
   Build Your Own CTA Section
   ================================================================ */
.build-cta-section {
  background: linear-gradient(135deg, #0f0f2a 0%, #1a1a3a 100%);
  border-top: 1px solid #1e1e3a;
  border-bottom: 1px solid #1e1e3a;
  padding: 4rem 1rem;
  text-align: center;
  margin: 2rem 0;
}

.build-cta-inner {
  max-width: 600px;
  margin: 0 auto;
}

.build-cta-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.build-cta-section h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.75rem;
}

.build-cta-section p {
  color: #888;
  margin-bottom: 2rem;
  line-height: 1.6;
}

.build-cta-big-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 14px 32px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 12px;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.15s;
  box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}

.build-cta-big-btn:hover {
  opacity: 0.88;
  transform: translateY(-2px);
  text-decoration: none;
}

/* ================================================================
   Email / Buy Modal
   ================================================================ */
.email-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1rem;
}

.email-modal {
  background: #0f0f28;
  border: 1px solid #2a2a4a;
  border-radius: 20px;
  padding: 2rem;
  max-width: 440px;
  width: 100%;
  position: relative;
  box-shadow: 0 16px 64px rgba(0,0,0,0.6);
}

.email-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: #666;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.email-modal-close:hover { color: #fff; }

.email-modal h3 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.5rem;
}

.email-modal-desc {
  color: #888;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.email-modal-price {
  color: #00e5ff;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
}

.email-modal label {
  display: block;
  font-size: 0.85rem;
  color: #888;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.email-modal input[type="email"],
.email-modal input[type="text"] {
  width: 100%;
  background: #12122a;
  border: 1px solid #2a2a4a;
  border-radius: 10px;
  padding: 10px 14px;
  color: #e0e0e0;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.email-modal input:focus {
  border-color: #6366f1;
}

.email-modal-referral-row {
  margin-top: 0.75rem;
}

.email-modal-submit {
  width: 100%;
  margin-top: 1.25rem;
  padding: 12px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.email-modal-submit:hover:not(:disabled) {
  opacity: 0.88;
  transform: translateY(-1px);
}

.email-modal-submit:disabled {
  opacity: 0.5;
  cursor: default;
}

.email-modal-note {
  color: #555;
  font-size: 0.75rem;
  text-align: center;
  margin-top: 0.75rem;
}

.email-modal-status {
  min-height: 1.2em;
  font-size: 0.85rem;
  color: #f87171;
  text-align: center;
  margin-top: 0.5rem;
}

/* ================================================================
   Responsive additions
   ================================================================ */
@media (max-width: 1024px) {
  .featured-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .featured-grid {
    grid-template-columns: 1fr;
  }

  .all-bundles-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .compare-bots {
    display: none;
  }

  .build-cta-section h2 {
    font-size: 1.4rem;
  }

  .bundle-card-actions {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bundle-skeleton {
    animation: none;
    background: #0f0f24;
  }
  .bundle-ribbon {
    transition: none;
  }
}
