/* ---------- Global Toast ---------- */
/* Global Toast */
.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2000;
}
.toast.success {
  background: #27ae60;
}
.toast.error {
  background: #ff4d4d;
}
.toast.info {
  background: #2d89ef;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1300;
}
.modal[hidden] {
  display: none !important;
}

.modal-content {
  background: var(--card-bg, #1e1e1e);
  color: var(--text, #fff);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  text-align: center;
  max-width: 400px;
}

.modal .modal-content {
  background: #14161a;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  width: min(520px, 92vw);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

/* ---------- Page Layout ---------- */
.app {
  display: grid;
  grid-template-columns: 1fr 50%;
  grid-template-rows: auto;
  gap: 20px;
  margin-top: 40px;
  align-items: stretch;
}

.panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.02)
  );
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.panel-colors {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: stretch;
}

.panel-colors .card {
  display: flex; /* switch from grid to flex */
  flex-direction: column; /* stack elements vertically */
  gap: 12px;
  height: 100%;
}

.panel-colors .card .section-title {
  margin: 0;
  font-size: 1.1rem;
  width: 100%;
}

.panel-colors .card .btn-eye {
  align-self: flex-start; /* keep small icon aligned to left */
}

.panel-colors .card .btn {
  width: 100%; /* button spans full width */
  align-self: flex-start; /* align left */
}

.panel-left,
.panel-right {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  gap: 20px;
}

.panel-right {
  width: 50vw;
  position: sticky;
  top: 88px;
  align-self: start;
  height: calc(100vh - 100px);
  max-height: calc(100vh - 100px);
  overflow: hidden;
}

.panel-left .card:nth-child(2) {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.panel-right .canvas-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.panel-colors .span-2 {
  grid-column: 1 / -1;
}

/* Accordion panels */
.accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(
    160deg,
    rgba(255, 255, 255, 0.06),
    rgba(255, 255, 255, 0.02)
  );
  box-shadow: var(--shadow);
  overflow: hidden;
}
.accordion > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.accordion > summary::-webkit-details-marker {
  display: none;
}
.accordion > summary::after {
  content: "";
  margin-left: auto;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text);
  border-bottom: 2px solid var(--text);
  transform: rotate(45deg);
  opacity: 0.8;
}
.accordion[open] > summary::after {
  transform: rotate(225deg);
}
.accordion[open] > summary {
  border-bottom: 1px solid var(--border);
}
.accordion > .card {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 16px;
}

.accordion-body {
  padding: 16px;
}

/* Titles */
h2#title,
h2 {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 2px;
  margin: 0 0 10px 0;
  color: var(--brand);
  text-shadow:
    0 2px 12px #222,
    0 0px 2px var(--brand);
}

.page-title {
  grid-column: 1 / -1;
  margin: 0 0 10px 0;
}
