:root {
  --accent: #36b9ff;
  --accent-dark: #247cc1;
  --background: #1a222b;
  --card-bg: #343a40;
  --card-hover: #232e3a;
  --border: #232e3a;
  --shadow: 0 2px 18px #18365013;
  --radius: 10px;
  --text: #e8f1fa;
  --text-muted: #a2b6cd;
  --tag-bg: #2d3845;
  --tag: #70ccff;
}

body {
  background: var(--background);
  color: var(--text);
  font-family: "Overpass", "Inter", system-ui, sans-serif;
  margin: 0;
  min-height: 100vh;
}

.kits-title {
  font-family: "Overpass", sans-serif;
  font-size: 1.15rem;
  font-weight: 400;
  text-align: center;
  margin-top: 3rem;
  color: #fff;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.2rem;
  margin-bottom: 2rem;
  padding: 0 1.3rem 0 1.3rem;
}
@media (max-width: 1200px) { .apps-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .apps-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .apps-grid { grid-template-columns: 1fr; } }

/* --- KITS CARD --- */
.app-card, .kit-card {
  background: #343a40;
  border-radius: 0.2rem;
  border: 2.2px solid transparent;
  box-shadow: var(--shadow);
  padding: 1.18rem 1.13rem 1.02rem 1.13rem;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 165px;
  width: 100%;
  max-width: 370px;
  margin: 0 auto 0.15rem auto;
  transition: border-color .18s, box-shadow .13s, background .17s;
}
.right-card{
  background: #343a40;
  border-radius: var(--radius);
  border: 2.2px solid transparent;
  box-shadow: var(--shadow);
  padding: 1.18rem 1.13rem 1.02rem 1.13rem;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 265px;
  min-width: 400px;
  margin: 0 auto 0.15rem auto;
}

.app-card.selected, .kit-card.selected {
  border-color: var(--accent);
  box-shadow: 0 6px 28px -6px #36b9ff44;
}
.app-card:hover, .app-card:focus-within,
.kit-card:hover, .kit-card:focus-within {
  border-color: var(--accent-dark);
 background: #343a40;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.33rem;
  text-transform: uppercase;
}

.app-icon {
  width: 42px; height: 42px;
  border-radius: 10px;
  background: #343a40;
  display: flex;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.app-icon img {
  width: 26px; height: 26px;
  border-radius: 7px;
  object-fit: contain;
  display: block;
}
.app-icon i, .app-icon svg {
  font-size: 1.6em;
  color: #ffffff;
  width: 1.2em; height: 1.2em;
}

.app-name {
  font-family: "Overpass", sans-serif;
  font-size: 1.13rem;
  color: #fff;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  flex: 1 1 auto;
  line-height: 1.11;
  margin-bottom: 0.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Price + Category badges */
.kit-card-toprow {
  display: flex;
  align-items: center;
  gap: .55em;
  margin-bottom: .11em;
}
.kit-card-category-badge,
.badge, .badge-secondary {
  background: #2d3845;
  color: #84cdfc;
  border-radius: 6px;
  padding: 0.26em 0.89em;
  font-size: 0.84em;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.kit-price-badge {
  background: #6c757d;
  color: #fff;
  border-radius: 0.1rem;
  padding: 0.2em 0.2em;
  font-size: 0.875em;
  font-weight: 400;
}

.app-desc, .kit-card-desc {
  font-family: "Overpass", sans-serif;
  font-size: 0.99em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  margin-top: 0.4rem;
  min-height: 68px;
  max-height: 68px;
  line-height: 1.56;
  display: -webkit-box;
/*  -webkit-line-clamp: 3;*/
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.kit-card-apps-row {
  display: flex;
  align-items: center;
  min-height: 6em;
  max-height: 6em;
  font-size: 0.93em;
  margin-bottom: 0.5em;
  overflow: hidden;
}
.kit-apps-label {
  color: #b0c8df;
  margin-right: .6em;
  font-weight: 400;
  text-transform: uppercase;
  font-size: 0.83rem;
}
.kit-apps-badges {
/*  display: flex;*/
  flex-wrap: wrap;
  gap: 0.12em 0.19em;
  align-items: flex-start;
  max-width: 100%;
  overflow: hidden;
}
.kit-app-badge {
  background: #6c757d;
  color: #e8f1fa;
  border-radius: 0.22em;
  font-size: 0.91em;
  font-weight: 500;
  padding: .13em .7em .13em .68em;
  margin-right: .11em;
  margin-bottom: .09em;
  letter-spacing: .01em;
  transition: background .13s;
  white-space: nowrap;
}
.kit-app-badge--none {
  color: #ccc; background: #191933;
}

/* --- Configure Button --- */
.kit-card-footer {
  border-top: 1px solid #212529;
  margin-top: auto;
  padding-top: 0.44rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 2em;
}
.kit-configure-btn {
  color: #ffffff;
  border: none;
  padding: 0.45em 0.5em;
  text-decoration: none !important;
  transition: background 0.13s;
  display: flex;
  align-items: right;
}
.kit-configure-btn:hover, .kit-configure-btn:focus {
  color: #fff;
  outline: none;
  transition: background .18s, color .15s;
}
#kit-categories,
.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.17em;
  margin-bottom: 0.82em;
  padding-top: 0.1em;
  padding-bottom: 0.1em;
  margin-left: 1.5%;
  width: 97%;
}

.category-btn {
  background: #495057;
  color: #ffffff;
  border: 1px solid transparent;
  border-radius: 0.2rem;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  padding: 0.09rem 0.44rem;
  margin: 0 0em 0.08em 0;
  cursor: pointer;
  outline: none;
  transition: background .18s, color .15s;
}

.category-btn.active,
.category-btn:focus {
  background: #007bff;
  color: #fff;
  border-color: #007bff;
  font-weight: 700;
  box-shadow: 0 2px 12px #36b9ff22;
}

.category-btn:hover:not(.active) {
  background: #247cc1;
  color: #fff;
  border-color: var(--accent-dark);
}
#kit-search-bar {
  width: 97%;
  padding: .65rem 1rem;
  background: #343a40;
  border: 1px solid #495057;
  border-radius: .3rem;
  color: #fff;
  font-size: 1rem;
  height: 40px;
  margin-bottom: 0.5rem;
  margin-left: 1.5%;
/*  margin-right: 1.5%;*/
}

#kit-search-bar:focus,
#kit-search-bar:active {
  border-color: var(--accent);
  background: #25354a;
  color: #fff;
}
/* --- LAYOUT --- */
.configurator-container {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  max-width: 98%;
  margin: 1% auto;
  background: #272b30;
  padding: 1rem;
  border-radius: .5rem;
  min-height: 70vh;
  overflow: hidden;
}

.configurator-column,
.stacks-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.assemble-page.twocol {
  display: flex;
  gap: 1.2rem;
  align-items: flex-start;
  justify-content: center;
  max-width: 1800px;
  margin: 2.5rem auto 3.5rem auto;
  padding: 0 0vw;
}

/* Left: Stack/Configurator | Right: App selection */
.assemble-stack-col {
  flex: 1 1 0;
  min-width: 400px;
  max-width: 400px;
  width: 900%;
}
.assemble-apps-col {
  flex: 2 1 0;
  min-width: 1100px;
  max-width: 1100px;
  width: 100%;
}


@media (max-width: 1000px) {
  .assemble-page.twocol {
    flex-direction: column;
    gap: 1.8rem;
  }
  .assemble-stack-col,
  .assemble-apps-col {
    max-width: 100%;
  }
}

/* Region/Storage Selectors */
.region-select-list,
.storage-select-list {
  display: flex;
  flex-direction: column;
  gap: 0.3em;
  margin-top: 0.5em;
}

.storage-option,
.region-option {
  background: #343a40;
  color: #ccc;
  border-radius: 0.4em;
  padding: 0.25em 1.15em;
  font-size: 1.01em;
  cursor: pointer;
  transition: background 0.18s, color 0.13s, border 0.18s;
  border: 2px solid transparent;
  user-select: none;
  outline: none;
}

.storage-option.selected,
.region-option.selected {
  background: #007bff;
  color: #fff;
  border: 2px solid #007bff;
  font-weight: 600;
  outline: none;
}

.storage-option:hover:not(.selected),
.region-option:hover:not(.selected) {
  background: #2e83e6;
  color: #fff;
}

/* Extra: consistent form field margin/padding for inputs in stack panel */
.assemble-stack-col input[type="email"] {
  width: 100%;
  padding: 0.8em 1em;
  border-radius: 0.4em;
  background: #222b33;
  color: #fff;
  border: 1.5px solid #3a4d5f;
  margin-bottom: 1em;
  font-size: 1.03em;
  transition: border-color .15s;
}
.assemble-stack-col input[type="email"]:focus {
  border-color: #36b9ff;
  background: #24354c;
}

/* Error messages (if used) */
.text-danger, .error-message {
  color: #ff7368 !important;
  font-size: 0.98em;
  margin-top: 0.21em;
  margin-bottom: 0.31em;
}
.apps-columns-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.2em; /* vertical and horizontal spacing */
}

@media (max-width: 1100px) {
  .apps-columns-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .apps-columns-grid { grid-template-columns: 1fr; }
}

.kit-app-slot {
  background: rgba(255,255,255,0.03);
  border-radius: 13px;
  padding: 1em 1em .7em 1em;
  box-shadow: 0 2px 12px rgba(12,8,30,0.04);
  margin-bottom: 0.9em;
}
.assemble-card {
  background: #343a40;
  border-radius: var(--radius);
  border: 2.2px solid transparent;
  box-shadow: var(--shadow);
  padding: 1.18rem 1.13rem 1.02rem 1.13rem;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 265px;
  width: 100%;
  max-width: 98%;
  margin: 0 auto 0.15rem auto;
  transition: border-color .18s, box-shadow .13s, background .17s;
}
.fancy-app-license {
  margin-right: 0.8em;
  background: #22bb66; 
  color: #ffffff;
  font-size: 0.875rem !important;
  font-weight: 400;
  border-radius: 3px;
  padding: 0.15em 0.15em 0.15em 0.15em;
}
.fancy-app-category {
 margin-right: 0.8em;
 color: #ffffff;
  background: #364259;
  font-size: 0.875rem !important;
  font-weight: 400;
  border-radius: 3px;
  padding: 0.15em 0.15em 0.15em 0.15em;
}
.fancy-features-list {
  padding-left: 1.25em;
  margin-bottom: 1em;
  color: #eee;
  font-size: 0.9rem !important;
  font-weight: 400;
}
.fancy-app-section-title {
  font-size: 0.9em; font-weight: 400; margin: 1.2em 0 0.5em 0; color: #ffffff;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.fancy-app-desc {
  margin-bottom: 1.1rem;
  color: #d5d5de;
  font-size: 0.9rem !important;
  font-weight: 400;
}
.fancy-app-resources {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1.1rem;
  font-size: 0.85rem;
  font-weight:400;
}
.fancy-resource {
  display: flex;
  align-items: center;
  gap: 0.3em;
  background: #6c757d;
  padding: 0.38em 0.7em;
  border-radius: 8px;
  color: #ffeedd;
  text-transform: uppercase;
}
.kit-description {
  font-family: "Overpass", "sans-serif";
  font-size: 0.875rem;
  font-weight: 400;
  color: #b4bcc9;
  margin-bottom: 0.75rem;
  margin-top: 0.02rem;
  flex: 1 1 auto;
  min-height: 38px; /* At least 1 line */
  word-break: break-word;
}
.kit-details {
  padding: 0.5rem 0 0 0.5rem;
  border-radius: 0 0 .5rem .5rem;
  font-family: "Overpass", "sans-serif";
  font-size: 0.875rem;
  font-weight: 400;
  color: #b4bcc9;
}
.kits-assemble-title {
  font-family: "Overpass", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: #fff;
  text-transform: uppercase;
}
.stacks-column-header-font {
  font-family: "Overpass", "sans-serif";
  font-size: 1rem;
  font-weight: 400;
  color: #fff;
  text-transform: uppercase;
  padding-bottom: 0.1rem;
  margin-bottom: .6em;
  margin-top: -2em;
}
.kit-region-header-font {
  font-family: "Overpass", "sans-serif";
  font-size: 1rem;
  font-weight: 400;
  color: #fff;
  text-transform: uppercase;
  padding-bottom: 0.1rem;
  margin-bottom: .6em;
}
.kit-select-application-title {
  font-family: "Overpass", "sans-serif";
  font-size: 1rem;
  font-weight: 400;
  color: #fff;
  text-transform: uppercase;
  padding-bottom: 0.1rem;
  margin-bottom: .6em;
}
/* --- App Slot (in apps-columns-grid) --- */
.kit-app-slot {
  background: rgba(255,255,255,0.03);
  border-radius: 0.2rem;
  padding: 1em 1em 0.7em 1em;
  box-shadow: 0 2px 12px rgba(12,8,30,0.04);
  margin-bottom: 0.95em;
  min-height: 85px;
}
.kit-app-slot-label {
  margin-bottom: 0.32em !important;
  color: #ffffff;
  font-size: 1.07em;
  letter-spacing: 0.01em;
  font-family: "Overpass", sans-serif;
  font-weight: 400;
  text-transform: uppercase;
}

/* --- App Option Button --- */
.kit-app-option {
  background: #81a1c1;
  color: #fff;
  font-family: "Overpass", "Arial", sans-serif;
  font-weight: 400;
  border: 2px solid #81a1c1;
  padding: 0.5em 1.1em;
  border-radius: 0.5em;
  font-size: 0.98em;
  cursor: pointer;
  margin-bottom: 0.11em;
  transition: background 0.13s, border-color 0.13s, color 0.13s;
}
.kit-app-option.selected {
  background: #007bff !important;
  border-color: #007bff !important;
  color: #fff !important;
  font-family: "Overpass", "Arial", sans-serif !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em;
  transition: background 0.14s, color 0.14s;
}

/* --- Modal for App Details --- */
.app-details-modal-overlay {
  position: fixed;
  z-index: 9999;
  left: 0; top: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.34);
  display: flex;
  align-items: center;
  justify-content: center;
}
.app-details-modal-content {
  background: #343a40;
  color: #f9f9f9;
  border-radius: 16px;
  padding: 2.3em 2em 2em 2em;
  max-width: 900px;
  width: 98vw;
  box-shadow: 0 8px 48px rgba(16,8,24,0.26);
  position: relative;
  animation: fadein 0.19s;
}
.modal-close-btn {
  position: absolute;
  top: 0.75em;
  right: 1em;
  background: none;
  border: none;
  color: #bbb;
  font-size: 1.9em;
  cursor: pointer;
}
.modal-close-btn:hover {
  color: #fff;
}
@keyframes fadein {
  from { opacity: 0; transform: translateY(20px);}
  to   { opacity: 1; transform: none; }
}

/* --- Checkout Button --- */
.kit-checkout-btn {
  background: #F68537;
  color: #fff;
  font-weight: bold;
  border: none;
  border-radius: 2em;
  padding: 0.75em 2.2em;
  font-size: 1.16em;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(30,22,5,0.05);
  transition: background 0.15s, box-shadow 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  width: 100%;
}
.kit-checkout-btn:hover,
.kit-checkout-btn:focus {
  background: #f89553;
  box-shadow: 0 2px 12px rgba(246,133,55,0.12);
  outline: none;
}
.kits-column-legend-font {
  font-family: "Overpass", "sans-serif";
  font-size: 0.8rem;
  font-weight: 400;
  text-align: left;
  color: #fff;
  text-transform: uppercase;
  padding-bottom: 0.1rem;
  margin-bottom: .6em;
}


