/* ===================
   Base Layout & Resets
====================== */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: sans-serif;
  background: #f1f5f9;
  margin: 0;
  padding: 0;
}

/* ===================
   Header
====================== */
header {
  background: #2563eb;
  color: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header span {
  font-family: monospace;
  font-size: 2rem;
}

.badge {
  background: white;
  color: black;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  margin-left: 0.5rem;
  font-size: 1.6rem;
  display: inline-block;
}

/* ===================
   Layout Containers
====================== */
.main-wrapper {
  width: 100%;
  padding: 1rem 2rem;
  box-sizing: border-box;
}

.container {
  display: flex;
  gap: 1rem;
  align-items: stretch;
}

.panel {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  margin: 0.5rem 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  word-wrap: break-word;
}

.container > .panel {
  flex: 1;
}

/* ===================
   Parts Display
====================== */
.part {
  padding: 0.5rem;
  margin: 0.5rem 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #f9fafb;
  cursor: pointer;
}

/* Type Color Highlights */
.cpu { background-color: #fef3c7; }
.gpu { background-color: #e0f2fe; }
.ram { background-color: #f3e8ff; }
.ssd { background-color: #d1fae5; }
.psu { background-color: #fde68a; }
.motherboard { background-color: #e5e7eb; }
.case{background-color: rgba(124, 58, 237, 0.58); /* violet-600 */}
.fan{ background-color: rgba(250, 78, 0, 0.52); }
.cooler{ background-color: rgba(250, 0, 199, 0.31); }
/* ===================
   Buttons
====================== */
button {
  padding: 0.4rem 0.8rem;
  margin: 0.5rem 0;
  cursor: pointer;
  border: none;
  border-radius: 5px;
  background-color: #2563eb;
  color: white;
}

/* Filter Button Colors */
button.filter-cpu { background-color: #fcd34d; }
button.filter-gpu { background-color: #7dd3fc; }
button.filter-ram { background-color: #d8b4fe; }
button.filter-ssd { background-color: #6ee7b7; }
button.filter-psu { background-color: #facc15; }
button.filter-motherboard { background-color: #9ca3af; }
button.filter-case { background-color: #7c3aed; /* violet-600 */ }
button.filter-fan { background-color: rgba(250, 78, 0, 0.52); }
button.filter-cooler { background-color: rgba(250, 0, 199, 0.52); }

/* Info Buttons */
button[class^="info-"] {
  color: black;
  border: none;
  margin-right: 0.5rem;
  padding: 0.4rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
}

#submit-build{
  background-color: green;
}

button.info-cpu { background-color: #fcd34d; }
button.info-gpu { background-color: #7dd3fc; }
button.info-ram { background-color: #d8b4fe; }
button.info-ssd { background-color: #6ee7b7; }
button.info-psu { background-color: #facc15; }
button.info-motherboard { background-color: #9ca3af; }
button.info-cooling { background-color: rgba(250, 78, 0, 0.52); }

/* Part Button Block */
#part-buttons button {
  margin: 0.2rem;
  padding: 0.5rem 1rem;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

button:hover {
  opacity: 0.9;
  transform: scale(1.02);
  transition: all 0.2s ease-in-out;
}

/* ===================
   Zones & Slots
====================== */
.drop-zone {
  min-height: 200px;
  border: 2px dashed #ccc;
  border-radius: 6px;
  padding: 1rem;
  text-align: center;
  background-color: #f8fafc;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.fan-slot {
  margin-bottom: .5rem;
}


.drop-zone.filled {
  background: #e0f2fe;
}

/* ===================
   Scroll Areas
====================== */
.shop-list {
  max-height: 550px;
  overflow-y: auto;
}

#inventory {
  min-height: 550px;
  max-height: 550px;
  overflow-y: auto;
  background-color: #f3f4f6;
  border: 2px dashed #ccc;
  border-radius: 6px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

#workbench-slots {
  max-height: 580px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-right: 0.5rem;
  margin-bottom: 1rem;
}

/* ===================
   Stats and Info
====================== */
#stats-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

#build-stats {
  width: 100%;
  background-color: #eff6ff;
  text-align: left;
}

#info-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

#info-panel {
  width: 100%;
  background-color: #f0fdf4;
}

#info-content {
  margin-top: 0.5rem;
}

/* ===================
   Customer Panel
====================== */
#customer-panel {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

#customer-avatar {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

#customer-avatar .avatar-img {
  width: 200px;
  height: 200px;
  background: #e0f2fe;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

#customer-info {
  flex: 1;
}

#customer-info blockquote {
  margin: 0 0 0.5rem 0;
  padding: 1rem;
  border-radius: 10px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  font-style: italic;
}

#customer-info ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ===================
  Toast
====================== */

.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background-color: #1e293b; /* dark slate */
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 1000;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.4s ease;
  max-width: 300px;
  font-size: 0.95rem;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.warning {
  background-color: #f59e0b; /* amber */
  color: #000;
}

.toast.error {
  background-color: #ef4444; /* red */
}

.toast.success {
  background-color: #10b981; /* green */
}

.toast.hidden {
  display: none;
}

/* ===================
  Instruction Overlay
====================== */

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(20, 20, 20, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  color: white;
}

.overlay-content {
  background: #1f2937;
  padding: 2rem;
  border-radius: 8px;
  max-width: 90vw;
  max-height: 85vh;
  text-align: left;
  overflow-y: auto;
  overflow-x: hidden;
  font-size: clamp(0.85rem, 2vw, 1.1rem); /* responsive font size */
  line-height: 1.4;
  word-break: break-word;
  box-sizing: border-box;
}

.overlay-content h2 {
  margin-top: 0;
  margin-bottom: 1rem;
}

.overlay-content ul {
  padding-left: 1.2rem;
  margin-bottom: 1.5rem;
}

.overlay-content li {
  margin-bottom: 0.5rem;
}

.overlay-content button {
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  background-color: #3b82f6;
  border: none;
  color: white;
  border-radius: 5px;
  cursor: pointer;
}

.overlay-content button:hover {
  background-color: #2563eb;
}

.modal {
  background: #1f2937;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
  max-width: 300px;
  width: 90%;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.modal input {
  font-size: 1.5rem;
  padding: 0.5rem;
  text-align: center;
  text-transform: uppercase;
  width: 100px;
  letter-spacing: 2px;
}

/* === Responsive Tweaks === */

/* Small screens: phones */
@media (max-width: 600px) {
  header {
    flex-direction: column;
    text-align: center;
    padding: 1rem;
  }

  .container {
    flex-direction: column;
  }

  #customer-panel {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  #customer-avatar .avatar-img {
    width: 150px;
    height: 150px;
    font-size: 2rem;
  }

  .overlay-content {
    padding: 1rem;
    width: 90%;
  }

  .modal {
    max-width: 90%;
    padding: 1rem;
  }

  #shop,
  #inventory,
  #workbench-slots {
    max-height: none;
    height: auto;
    overflow: visible;
  }

  .main-wrapper {
    padding: 1rem;
  }

  #info-wrapper,
  #stats-wrapper {
    flex-direction: column;
  }

  button,
  .overlay-content button {
    width: 100%;
    box-sizing: border-box;
  }

  #customer-info blockquote {
    font-size: 0.9rem;
  }

  .badge {
    font-size: 1.2rem;
    margin-top: 0.5rem;
  }
}

/* Medium screens: tablets */
@media (min-width: 601px) and (max-width: 1024px) {
  header {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .container {
    flex-direction: column;
  }

  #customer-panel {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .overlay-content {
    width: 95%;
  }
}

