/* -------------------- Base -------------------- */

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, sans-serif;
  background: linear-gradient(
    135deg,
    #f3e8ff 0%,
    #fce7f3 50%,
    #e0f2fe 100%
  );
  color: #111827;
}

/* -------------------- Header / Text -------------------- */

h1 {
  font-size: 36px;
  text-align: center;
  margin-bottom: 8px;
  color: #111827;
}

#instructions {
  font-size: 14px;
  text-align: center;
  color: #6b7280;
  margin-top: 0;
}

/* -------------------- Grid Wrapper (NEW) -------------------- */

.grid-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 30px;
}

.grid-body {
  display: flex;
  align-items: center;
}

/* -------------------- Column Labels -------------------- */

#columnLabels {
  display: grid;
  justify-content: center;
  margin-bottom: 6px;
  font-size: 12px;
  color: #6b7280;
}

#columnLabels div {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* -------------------- Row Labels -------------------- */

#rowLabels {
  display: grid;
  margin-right: 6px;
  font-size: 12px;
  color: #6b7280;
}

#rowLabels div {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* -------------------- Grid -------------------- */

#grid {
  display: grid;
  gap: 0;
}

.pixel {
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  box-sizing: border-box;
}

/* -------------------- Controls Layout -------------------- */

.controls {
  max-width: 1280px;
  margin: 40px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 768px) {
  .controls {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* -------------------- Card Style -------------------- */

.group {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  padding: 16px;
}

.group-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 12px;
  text-align: left;
}

.group-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* -------------------- Buttons -------------------- */

button {
  padding: 6px 12px;
  margin-bottom: 10px;
  border-radius: 0px;
  border: 1px solid #d1d5db;
  background: white;
  color: #374151;
  cursor: pointer;
  transition: all 0.15s ease;
   display: flex;
  align-items: center;
  gap: 6px;
}

button:hover {
  border-color: #9ca3af;
  background: #f9fafb;
}

button:focus {
  outline: none;
  border-color: #FF4A00;
  box-shadow: 0 0 0 1px #FF4A00;
}

button.active,
.pcr-button.active {
  background-color: #111827;
  color: white;
  border-color: #111827;
}

/* -------------------- Primary Button -------------------- */

button.primary {
  background: #FF4A00;
  color: white;
  border: none;
}

button.primary:hover {
  background: #E64200;
}

/* -------------------- Pickr Styling -------------------- */

.pcr-button {
  border-radius: 0px;
}

/* -------------------- Disabled -------------------- */

.pcr-disabled {
  opacity: 0.4 !important;
  pointer-events: none;
}

/* -------------------- Hide Coordinates (Toggle) -------------------- */

.hidden-labels {
  display: none !important;
}

.color-palette {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 0px;
  border: 1px solid #ddd;
  cursor: pointer;
}

#imageCanvas {
  border: 1px solid #ddd;
  margin-top: 20px;
}

#imageCanvas {
  border: 1px solid #ddd;
  image-rendering: pixelated;
  width: 320px;
  height: 320px;
}

.converter-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 40px;
  gap: 20px;
}

#downloadPixel {
  display: none;
}

#imageGrid{
display:grid;
gap:0;
margin-top:20px;
}

.imagePixel{
width:20px;
height:20px;
border:1px solid #eee;
}

/* -------------------- link styling -------------------- */
a {
  text-decoration: none;
}

.faq-container {
  margin-top: 60px;
  padding: 20px;
  border-top: 1px solid #eee;
}

.faq-toggle summary {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

/* remove default triangle */
.faq-toggle summary::-webkit-details-marker {
  display: none;
}

.faq-content {
  max-width: 700px;
  margin: 20px auto 0;
  text-align: left;
}

.faq-content h3 {
  margin-top: 18px;
  font-size: 16px;
}

.faq-content p {
  color: #555;
  font-size: 14px;
}
.faq-arrow {
  margin-left: 6px;
  transition: transform 0.2s ease;
}

/* rotate arrow when open */
details[open] .faq-arrow {
  transform: rotate(180deg);
}

/* -------------------- Header / Text -------------------- */

ul {
  display: inline-block;
  text-align: left;
  margin: 0 auto;
  padding-left: 20px;
}

.converter-section {
  text-align: center;
  margin-top: 200px;
}

.tool-container {
  text-align: center;
  margin-top: 40px;
}
.upload-container {
  position: relative;
  display: inline-block;
}
.upload-box {
  display: inline-block;
  padding: 20px 40px;
  border: 2px dashed #ccc;
  border-radius: 0px;
  background: #f9f9f9;
  cursor: pointer;
}
.upload-box:hover {
  border-color: #999;
  background: #f2f2f2;
}
.upload-box.uploaded {
  border-style: solid;
  background: #fff;
}
.remove-btn {
  display: none;
  position: absolute;
  top: -8px;
  right: -8px;

  width: 22px;
  height: 22px;

  display: flex;               /* center content */
  align-items: center;
  justify-content: center;

  border: none;
  border-radius: 0px;

  background: #ff4d4f;
  color: white;
  font-size: 14px;
  line-height: 1;

  cursor: pointer;
}
.remove-btn:hover {
  background: #e64244;
}
.remove-btn {
  outline: none;
}
#convertBtn {
  display: block;
  margin: 20px auto;
  padding: 12px 28px;
  font-size: 16px;
  border-radius: 0px;
  border: none;
  background: #FF4A00;
  color: white;
  cursor: pointer;
  transition: background 0.2s ease;
}

#convertBtn:hover {
  background: #E64200;
}

#fileName {
  margin-top: 10px;
  color: #555;
  font-size: 14px;
}

/* Overlay */
.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  z-index: 999;
}

/* Card */
.popup-card {
  position: relative;
  background: #fff;
  padding: 20px;
  border-radius: 16px;
  width: 320px;
  text-align: center;
  animation: fadeIn 0.2s ease;
}

/* Title */
.popup-card h2 {
  margin-bottom: 12px;
}

/* Preview */
.preview-grid {
  display: grid;
  margin: 10px auto;
  justify-content: center;
}

/* Input */
.share-input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  margin-top: 10px;
}

/* Buttons */
.popup-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.btn {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: none;
  background: #eee;
  cursor: pointer;
  transition: 0.2s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  background: #155de9;
  color: white;
}

.btn.whatsapp {
  margin-top: 10px;
  width: 100%;
  background: #25D366;
  color: white;
}

/* Close */
.close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  cursor: pointer;
  font-size: 18px;
}

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

