/* ─────────────────────────────────────────────────────────────
   xMonthly Cloud Tour Builder — tour-builder.css v1.2
   All selectors prefixed .xmct- to avoid conflicts.

   v1.2:
   - Max-width increased to 1400px
   - Dark mode styles via .xmct-dark class on #xmct-root
     (applied by JS when ?mode=light is absent from URL)
───────────────────────────────────────────────────────────── */

/* ── Reset ───────────────────────────────────────────────── */
#xmct-root *,
#xmct-root *::before,
#xmct-root *::after {
  box-sizing: border-box;
}

#xmct-root {
  font-family: inherit;
  color: #1a1a2e;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.xmct-wrap {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

/* ── Tabs ────────────────────────────────────────────────── */
.xmct-tabs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid #e8e4dd;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 8px;
}

.xmct-tabs-left { display: flex; }

.xmct-tab {
  border: none;
  background: none;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  color: #888;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  letter-spacing: 0.01em;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.xmct-tab:hover     { color: #0d1117; }
.xmct-tab--active   { color: #0d1117; border-bottom-color: #0d1117; }

.xmct-counter {
  font-size: 14px;
  color: #666;
  padding: 4px 0;
}
.xmct-accent { color: #2563eb; font-weight: 600; }

/* ── Panel ───────────────────────────────────────────────── */
.xmct-panel {
  display: flex;
  flex-direction: column;
  gap: 36px;
}

/* ── Sections ────────────────────────────────────────────── */
.xmct-section { display: flex; flex-direction: column; gap: 16px; }

.xmct-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.xmct-section-title { font-size: 22px; font-weight: 700; color: #0d1117; }
.xmct-section-sub   { font-size: 14px; color: #666; margin-top: 3px; }

/* ── Buttons ─────────────────────────────────────────────── */
.xmct-btn-group { display: flex; gap: 8px; align-items: center; }

.xmct-btn {
  border-radius: 6px;
  padding: 9px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, opacity 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  line-height: 1.4;
  font-family: inherit;
}

.xmct-btn--outline  { border: 1px solid #0d1117 !important; background: transparent; color: #0d1117; }
.xmct-btn--outline:hover { background: #0d1117; color: #fff; }

.xmct-btn--ghost    { border: 1px solid #ccc !important; background: transparent; color: #555; }
.xmct-btn--ghost:hover { background: #f0f0f0; }

.xmct-btn--primary  { background: #2563eb; color: #fff; font-weight: 600; font-size: 15px; padding: 11px 22px; }
.xmct-btn--primary:hover { background: #1d4ed8; }

.xmct-btn--dark     { background: #0d1117; color: #fff; font-weight: 600; }
.xmct-btn--dark:hover { background: #1e293b; }

.xmct-btn--colored  { color: #fff; font-weight: 600; }
.xmct-btn--colored:hover { opacity: 0.85; }

.xmct-btn--outline-color { background: transparent; font-weight: 500; border: 1px solid; }
.xmct-btn--outline-color:hover { opacity: 0.7; }

/* ── Product Grid ────────────────────────────────────────── */
.xmct-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}

.xmct-product-pill {
  border: 2px solid #e8e4dd;
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  background: #fff;
  cursor: pointer;
  position: relative;
  user-select: none;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s, background 0.15s;
}
.xmct-product-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.09);
}

.xmct-product-pill img {
  height: 36px;
  width: 36px;
  object-fit: contain;
  display: block;
  margin: 0 auto 10px;
  pointer-events: none;
}

.xmct-pill-label {
  font-size: 12px;
  font-weight: 600;
  color: #555;
  line-height: 1.3;
  display: block;
  pointer-events: none;
  transition: color 0.15s;
}

.xmct-pill-check {
  position: absolute;
  top: 6px; right: 6px;
  width: 19px; height: 19px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

/* ── Product Rows ────────────────────────────────────────── */
.xmct-rows { display: flex; flex-direction: column; gap: 14px; }

.xmct-product-row {
  background: #fff;
  border: 1px solid #e8e4dd;
  border-radius: 12px;
  overflow: hidden;
}

.xmct-product-row-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: background 0.1s;
}
.xmct-product-row-header:hover { background: #fafaf8; }

.xmct-product-row-left  { display: flex; align-items: center; gap: 14px; }
.xmct-product-row-right { display: flex; align-items: center; gap: 10px; }

.xmct-product-row-icon {
  width: 40px; height: 40px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.xmct-product-row-icon img { width: 26px; height: 26px; object-fit: contain; pointer-events: none; }

.xmct-product-row-name  { font-size: 15px; font-weight: 600; color: #0d1117; }
.xmct-product-row-count { font-size: 13px; color: #888; margin-top: 1px; }

.xmct-selected-badge { font-size: 13px; font-weight: 500; min-width: 70px; text-align: right; }

.xmct-chevron {
  font-size: 22px; color: #aaa;
  transition: transform 0.2s; line-height: 1;
  pointer-events: none;
}
.xmct-chevron--open { transform: rotate(90deg); }

/* ── Service Grid ────────────────────────────────────────── */
.xmct-service-grid {
  padding: 14px 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
  border-top: 1px solid #f0ece6;
}

.xmct-service-card {
  border: 1.5px solid #e8e4dd;
  border-radius: 9px;
  padding: 14px 15px;
  cursor: pointer;
  background: #fafaf9;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s, background 0.15s;
}
.xmct-service-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.07); }

.xmct-svc-check {
  position: absolute; top: 9px; right: 9px;
  width: 19px; height: 19px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: #fff; font-weight: 700;
  pointer-events: none;
}

.xmct-svc-name  { font-size: 13px; font-weight: 600; color: #0d1117; margin-bottom: 5px; padding-right: 22px; }
.xmct-svc-desc  { font-size: 12px; color: #777; line-height: 1.55; }
.xmct-svc-price { margin-top: 8px; font-size: 13px; font-weight: 600; }

/* ── CTA Bar ─────────────────────────────────────────────── */
.xmct-cta-bar {
  background: #0d1117;
  border-radius: 12px;
  padding: 20px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}
.xmct-cta-title { font-size: 16px; font-weight: 600; color: #fff; }
.xmct-cta-sub   { font-size: 14px; color: #8892a4; margin-top: 2px; }

/* ── Empty State ─────────────────────────────────────────── */
.xmct-empty { text-align: center; padding: 52px 20px; color: #999; }
.xmct-empty-icon  { font-size: 44px; margin-bottom: 14px; }
.xmct-empty-title { font-size: 19px; color: #555; font-weight: 600; margin-bottom: 6px; }
.xmct-empty-sub   { font-size: 14px; }

/* ── Preview Hero ────────────────────────────────────────── */
.xmct-preview-hero {
  background: linear-gradient(135deg, #0d1117 0%, #1a2744 100%);
  border-radius: 14px;
  padding: 44px 36px;
  position: relative;
  overflow: hidden;
  margin-bottom: 4px;
}
.xmct-preview-hero-glow {
  position: absolute; top: 0; right: 0;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(37,99,235,0.2) 0%, transparent 70%);
  pointer-events: none;
}
.xmct-preview-hero-title {
  color: #fff; font-size: 30px; font-weight: 700;
  margin-bottom: 10px; line-height: 1.2; position: relative;
}
.xmct-preview-hero-desc {
  font-size: 15px; color: #94a3b8; max-width: 520px;
  line-height: 1.6; margin-bottom: 22px; position: relative;
}
.xmct-preview-tags { display: flex; flex-wrap: wrap; gap: 8px; position: relative; }
.xmct-preview-tag {
  background: rgba(255,255,255,0.1); border-radius: 20px;
  padding: 5px 13px; display: flex; align-items: center; gap: 7px;
  font-size: 13px; color: #e2e8f0;
}
.xmct-preview-tag img { width: 16px; height: 16px; object-fit: contain; }

/* ── Preview Cards ───────────────────────────────────────── */
.xmct-preview-cards { display: flex; flex-direction: column; gap: 22px; }

.xmct-preview-card {
  background: #fff;
  border: 1px solid #e8e4dd;
  border-radius: 14px;
  overflow: hidden;
}

.xmct-preview-card-header {
  padding: 24px 28px;
  display: flex; align-items: flex-start; gap: 16px;
}
.xmct-preview-card-icon {
  width: 52px; height: 52px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.xmct-preview-card-icon img { width: 34px; height: 34px; object-fit: contain; }

.xmct-preview-card-info  { flex: 1; }
.xmct-preview-card-name  { font-size: 19px; font-weight: 700; color: #0d1117; margin-bottom: 4px; }
.xmct-preview-card-tag   { font-size: 14px; color: #666; margin-bottom: 12px; }
.xmct-feature-tags       { display: flex; flex-wrap: wrap; gap: 6px; }
.xmct-feature-tag        { font-size: 12px; border-radius: 4px; padding: 3px 8px; font-weight: 500; }

.xmct-preview-svcs-wrap  { padding: 16px 28px; border-top: 1px solid #f0ece6; }
.xmct-preview-svcs-label {
  font-size: 11px; font-weight: 600; color: #999;
  letter-spacing: 0.07em; text-transform: uppercase; margin-bottom: 12px;
}
.xmct-preview-svcs-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }

.xmct-preview-svc {
  border: 1px solid #ede9e2; border-radius: 8px; padding: 13px 15px; background: #fafaf8;
}

.xmct-preview-card-footer {
  padding: 14px 28px; border-top: 1px solid #f0ece6;
  display: flex; flex-wrap: wrap; gap: 10px;
}

/* ── Footer CTA ──────────────────────────────────────────── */
.xmct-footer-cta {
  background: #fff; border: 1px solid #e8e4dd;
  border-radius: 14px; padding: 30px 32px; text-align: center; margin-top: 4px;
}
.xmct-footer-cta-title { font-size: 20px; font-weight: 700; color: #0d1117; margin-bottom: 8px; }
.xmct-footer-cta-sub   { font-size: 15px; color: #666; margin-bottom: 20px; }

/* ── Animation ───────────────────────────────────────────── */
@keyframes xmctFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.xmct-fade-in { animation: xmctFadeIn 0.22s ease both; }

/* ════════════════════════════════════════════════════════════
   DARK MODE  —  applied when JS adds .xmct-dark to #xmct-root
   (i.e. when ?mode=light is absent from the URL)
════════════════════════════════════════════════════════════ */

#xmct-root.xmct-dark {
  color: #e2e8f0;
}

/* Tabs */
#xmct-root.xmct-dark .xmct-tabs         { border-bottom-color: #2d3748; }
#xmct-root.xmct-dark .xmct-tab          { color: #94a3b8; }
#xmct-root.xmct-dark .xmct-tab:hover    { color: #e2e8f0; }
#xmct-root.xmct-dark .xmct-tab--active  { color: #e2e8f0; border-bottom-color: #60a5fa; }
#xmct-root.xmct-dark .xmct-counter      { color: #94a3b8; }

/* Section titles */
#xmct-root.xmct-dark .xmct-section-title { color: #f1f5f9; }
#xmct-root.xmct-dark .xmct-section-sub   { color: #94a3b8; }

/* Buttons */
#xmct-root.xmct-dark .xmct-btn--outline  { border-color: #60a5fa !important; color: #60a5fa; }
#xmct-root.xmct-dark .xmct-btn--outline:hover { background: #60a5fa; color: #0d1117; }
#xmct-root.xmct-dark .xmct-btn--ghost    { border-color: #374151 !important; color: #94a3b8; }
#xmct-root.xmct-dark .xmct-btn--ghost:hover { background: #1e293b; color: #e2e8f0; }

/* Product pills */
#xmct-root.xmct-dark .xmct-product-pill {
  background: #1e293b;
  border-color: #2d3748;
}
#xmct-root.xmct-dark .xmct-product-pill:hover {
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
}
#xmct-root.xmct-dark .xmct-pill-label { color: #cbd5e1; }

/* Product rows */
#xmct-root.xmct-dark .xmct-product-row            { background: #1e293b; border-color: #2d3748; }
#xmct-root.xmct-dark .xmct-product-row-header:hover { background: #263548; }
#xmct-root.xmct-dark .xmct-product-row-name        { color: #f1f5f9; }
#xmct-root.xmct-dark .xmct-product-row-count       { color: #64748b; }
#xmct-root.xmct-dark .xmct-chevron                 { color: #475569; }

/* Service grid */
#xmct-root.xmct-dark .xmct-service-grid { border-top-color: #2d3748; }
#xmct-root.xmct-dark .xmct-service-card {
  background: #263548;
  border-color: #334155;
}
#xmct-root.xmct-dark .xmct-service-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.35); }
#xmct-root.xmct-dark .xmct-svc-name { color: #f1f5f9; }
#xmct-root.xmct-dark .xmct-svc-desc { color: #94a3b8; }

/* CTA bar stays dark — already works in both modes */

/* Empty state */
#xmct-root.xmct-dark .xmct-empty-title { color: #94a3b8; }
#xmct-root.xmct-dark .xmct-empty-sub   { color: #64748b; }

/* Preview cards */
#xmct-root.xmct-dark .xmct-preview-card         { background: #1e293b; border-color: #2d3748; }
#xmct-root.xmct-dark .xmct-preview-card-name    { color: #f1f5f9; }
#xmct-root.xmct-dark .xmct-preview-card-tag     { color: #94a3b8; }
#xmct-root.xmct-dark .xmct-preview-svcs-wrap    { border-top-color: #2d3748; }
#xmct-root.xmct-dark .xmct-preview-svcs-label   { color: #64748b; }
#xmct-root.xmct-dark .xmct-preview-svc          { background: #263548; border-color: #334155; }
#xmct-root.xmct-dark .xmct-preview-card-footer  { border-top-color: #2d3748; }

/* Footer CTA */
#xmct-root.xmct-dark .xmct-footer-cta       { background: #1e293b; border-color: #2d3748; }
#xmct-root.xmct-dark .xmct-footer-cta-title { color: #f1f5f9; }
#xmct-root.xmct-dark .xmct-footer-cta-sub   { color: #94a3b8; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .xmct-product-grid        { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
  .xmct-service-grid        { grid-template-columns: 1fr; }
  .xmct-preview-hero        { padding: 28px 20px; }
  .xmct-preview-hero-title  { font-size: 24px; }
  .xmct-preview-card-header { flex-direction: column; }
  .xmct-preview-svcs-grid   { grid-template-columns: 1fr; }
  .xmct-section-header      { flex-direction: column; }
  .xmct-cta-bar             { flex-direction: column; }
  .xmct-preview-card-footer { flex-direction: column; }
  .xmct-tabs                { flex-direction: column; align-items: flex-start; }
}