/* ============ প্যানেল ও ড্রয়ার স্টাইল (panels.css) ============ */

/* মূল শিট কনটেইনার */
.sheet {
  flex: none;
  max-height: 44dvh;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  background: var(--sh);
  border-top: 1px solid var(--ln);
  border-radius: 18px 18px 0 0;
  position: relative;
  z-index: 25;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4);
}

.sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.16);
  margin: 6px auto 2px;
  flex: none;
}

.tab-pane,
.text-active-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* সাব-ড্রয়ার কন্ট্রোল বক্স (টুল কন্ট্রোলস) */
.sub-drawer-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 14px;
}

.tool-ctrl-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 2px;
}

.ctrl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ctrl-header b {
  font-size: 13.5px;
  color: #fff;
}

.ctrl-actions {
  display: flex;
  gap: 6px;
}

/* টেক্সট এম্পটি স্টেট */
.text-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 16px;
  gap: 8px;
}

.empty-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(200, 16, 46, 0.12);
  display: grid;
  place-items: center;
  color: var(--ac);
  margin-bottom: 2px;
}

.empty-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.empty-desc {
  font-size: 12px;
  color: var(--mu);
  max-width: 280px;
  line-height: 1.4;
}

/* প্রাইমারি ও অ্যাকশন বাটন */
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--ac);
  color: #fff;
  font: 600 13.5px var(--ui);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(200, 16, 46, 0.35);
  transition: all 0.18s ease;
}

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

.primary-btn:active {
  transform: scale(0.97);
}

.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: 0;
  border-radius: 10px;
  background: #d90429;
  color: #fff;
  font: 600 13px var(--ui);
  cursor: pointer;
}

.sm-btn {
  padding: 5px 10px;
  border: 1px solid var(--ln);
  border-radius: 8px;
  background: var(--soft);
  color: var(--tx);
  font: 500 12px var(--ui);
  cursor: pointer;
  transition: all 0.15s ease;
}

.sm-btn:hover {
  background: var(--ln);
  color: #fff;
}

.sm-btn.on {
  background: var(--ac);
  border-color: var(--ac);
  color: #fff;
}

.wide-btn {
  width: 100%;
}

.flex-center {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 0;
}

/* টেক্সট চিপস ও কন্টেক্সট বার */
.text-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(11, 14, 18, 0.6);
  flex: none;
}

.chip-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border: 1px solid var(--ln);
  border-radius: 8px;
  background: var(--soft);
  color: var(--tx);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.chip-item:hover {
  background: var(--ln);
}

.chip-item.on {
  background: var(--ac);
  border-color: var(--ac);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(200, 16, 46, 0.35);
}

.plus-chip {
  background: rgba(200, 16, 46, 0.18);
  border-color: var(--ac);
  color: #ff453a;
  font-weight: 600;
}

/* ফর্ম ও ইনপুট কন্ট্রোল */
.styled-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--ln);
  border-radius: 10px;
  background: var(--bg);
  color: var(--tx);
  font: 14px/1.5 var(--ui);
  resize: none;
  box-sizing: border-box;
}

.styled-textarea:focus, .styled-input:focus {
  outline: none;
  border-color: var(--ac);
  box-shadow: 0 0 0 2px rgba(200, 16, 46, 0.25);
}

.styled-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--ln);
  border-radius: 10px;
  background: var(--bg);
  color: var(--tx);
  font: 13px var(--ui);
  box-sizing: border-box;
}

.styled-select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--ln);
  border-radius: 8px;
  background: var(--soft);
  color: var(--tx);
  font: 13px var(--ui);
}

/* চিপস ও প্যালেট */
.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.q-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--mu);
  cursor: pointer;
  border: 1px solid var(--ln);
  transition: all 0.12s ease;
}

.q-tag:hover {
  color: #fff;
  border-color: var(--ac);
}

/* কালার সোয়াচ */
.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0;
}

.swatch-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: transform 0.15s ease;
}

.swatch-btn.on {
  border-color: #fff;
  transform: scale(1.15);
  box-shadow: 0 0 0 2px var(--ac);
}

.inline-color {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.color-input {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  background: none;
}

.hex-input {
  width: 80px;
  padding: 6px 8px;
  border: 1px solid var(--ln);
  border-radius: 8px;
  background: var(--bg);
  color: #fff;
  font-family: monospace;
  font-size: 13px;
  text-transform: uppercase;
}

/* ফন্ট গ্রিড */
.fonts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding: 2px;
}

.font-card {
  padding: 8px 10px;
  border: 1px solid var(--ln);
  border-radius: 10px;
  background: var(--soft);
  color: var(--tx);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all 0.15s ease;
}

.font-card small {
  font-size: 10.5px;
  color: var(--mu);
}

.font-card.on {
  border-color: var(--ac);
  background: rgba(200, 16, 46, 0.15);
  color: #fff;
  box-shadow: 0 0 0 1px var(--ac);
}

/* রিলেটিভ পজিশন গ্রিড */
.rel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 4px;
}

.rel-btn {
  padding: 8px 4px;
  border: 1px solid var(--ln);
  border-radius: 8px;
  background: var(--soft);
  color: var(--tx);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.rel-btn:hover {
  background: var(--ln);
  color: #fff;
}

.rel-btn.highlight {
  background: rgba(200, 16, 46, 0.18);
  border-color: var(--ac);
  font-weight: 600;
}

/* নাজ প্যাড */
.nudge-pad {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
}

.nudge-btn {
  width: 44px;
  height: 40px;
  border: 1px solid var(--ln);
  border-radius: 8px;
  background: var(--soft);
  color: var(--tx);
  font-size: 14px;
  cursor: pointer;
}

.v-pad {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* রেঞ্জ ও স্টেপার */
.range-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stepper-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stepper-row input[type="range"] {
  flex: 1;
}

.step-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--ln);
  border-radius: 8px;
  background: var(--soft);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

/* স্টাইল টগল গ্রুপ */
.style-toggle-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 4px;
}

.style-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--ln);
  border-radius: 10px;
  background: var(--soft);
  color: var(--tx);
  cursor: pointer;
  transition: all 0.15s ease;
}

.style-btn b, .style-btn i, .style-btn u, .style-btn s {
  font-size: 18px;
}

.style-btn span {
  font-size: 10.5px;
}

.style-btn.on {
  border-color: var(--ac);
  background: rgba(200, 16, 46, 0.18);
  color: #fff;
}

/* সুইচ রো */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}

.switch-row span {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
}

/* টেমপ্লেট গ্রিড */
.templates-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* টেমপ্লেট কম্প্যাক্ট বার */
.tpl-compact-bar {
  display: flex;
  align-items: center;
  padding: 6px 10px;
  overflow: hidden;
  flex: 1;
}

.tpl-grid {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 6px;
  scrollbar-width: none;
  align-items: center;
  width: 100%;
}

.tpl-grid::-webkit-scrollbar {
  display: none;
}

/* কাস্টম টেমপ্লেট আপলোড কার্ড */
.tpl-add-card {
  flex: 0 0 auto;
  width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px;
  border: 1.5px dashed #ff453a;
  border-radius: 12px;
  background: rgba(255, 69, 58, 0.08);
  color: #fff;
  cursor: pointer;
  transition: all 0.18s ease;
}

.tpl-add-card:hover {
  background: rgba(255, 69, 58, 0.18);
  border-color: #ff6961;
  transform: translateY(-2px);
}

.tpl-add-card .th-add-box {
  width: 60px;
  height: 74px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

.tpl-add-card .th-add-box .ic {
  width: 24px;
  height: 24px;
  stroke: #ff453a;
}

.tpl-add-card span {
  font-size: 10px;
  font-weight: 700;
  color: #ff6961;
  white-space: nowrap;
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tpl {
  flex: 0 0 auto;
  width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 6px;
  border: 1px solid var(--ln);
  border-radius: 12px;
  background: var(--soft);
  color: var(--tx);
  cursor: pointer;
  position: relative;
  transition: all 0.18s ease;
}

.tpl .th {
  width: 60px;
  height: 74px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.tpl span {
  font-size: 11px;
  white-space: nowrap;
  max-width: 66px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tpl:hover {
  transform: translateY(-2px);
  border-color: var(--tx);
}

.tpl.on {
  border-color: var(--ac);
  background: rgba(200, 16, 46, 0.16);
  box-shadow: 0 0 0 1px var(--ac);
}

.tpl .x {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d90429;
  color: #fff;
  font-size: 13px;
  display: grid;
  place-items: center;
}

.tpl-footer-row {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px 6px;
}

.tpl-guide-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--mu);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tpl-guide-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* ফুলস্ক্রিন পপআপ মোডাল স্টাইল */
.fullscreen-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.fullscreen-modal[hidden] {
  display: none !important;
}

.modal-card {
  width: 100%;
  max-width: 460px;
  background: #161b22;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-card.guide-card {
  max-width: 560px;
  max-height: 85vh;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
}

.modal-close {
  background: none;
  border: 0;
  color: var(--mu);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-body.scrollable {
  overflow-y: auto;
  max-height: calc(85vh - 120px);
}

.modal-textarea {
  width: 100%;
  min-height: 140px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0d1117;
  color: #fff;
  font-size: 15px;
  line-height: 1.6;
  resize: vertical;
  box-sizing: border-box;
  font-family: inherit;
}

.modal-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.modal-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: 0;
}

.modal-btn.secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--tx);
}

.modal-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.modal-btn.primary {
  background: #238636;
  color: #fff;
}

.modal-btn.primary:hover {
  background: #2ea043;
}

.guide-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 6px;
}

.guide-section h3 {
  font-size: 13px;
  color: #ffd60a;
  margin: 0;
}

.guide-section p {
  font-size: 12px;
  color: var(--tx);
  margin: 0;
  line-height: 1.5;
}

.code-box {
  background: #090d13;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px 12px;
  font-family: monospace;
  font-size: 11px;
  color: #a5d6ff;
  overflow-x: auto;
  margin: 4px 0;
  line-height: 1.45;
}

.guide-list {
  margin: 4px 0;
  padding-left: 20px;
  font-size: 12px;
  color: var(--tx);
  line-height: 1.6;
}

/* রিবনে প্লাস (+) বাটন */
.tool-btn.add-btn {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}

.tool-btn.add-btn .ic {
  stroke: #38bdf8;
}

.tool-btn.add-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
}

/* শেপস ও তীর প্যালেট */
.shapes-palette, .arrows-palette {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.shape-btn {
  padding: 9px;
  border: 1px solid var(--ln);
  border-radius: 8px;
  background: var(--soft);
  color: var(--tx);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.shape-btn:hover {
  border-color: var(--ac);
  background: var(--ln);
}

/* প্রজেক্টস কার্ড গ্রিড */
.projects-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  max-height: 200px;
  overflow-y: auto;
  padding: 4px 2px;
}

.project-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--ln);
  border-radius: 10px;
  background: var(--soft);
}

.p-thumb {
  width: 44px;
  height: 52px;
  border-radius: 6px;
  background: #000;
  overflow: hidden;
  flex: none;
}

.p-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.p-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.p-details b {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.p-details small {
  font-size: 10.5px;
  color: var(--mu);
}

.p-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* সেগমেন্টেড কন্ট্রোল */
.seg {
  display: flex;
  background: var(--soft);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--ln);
}

.seg button {
  flex: 1;
  padding: 5px 8px;
  border: 0;
  background: none;
  color: var(--mu);
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
}

.seg button.on {
  background: var(--ac);
  color: #fff;
  font-weight: 600;
}

/* সাইডবার ড্রয়ার */
.drawer {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100%;
  background: var(--sh);
  border-left: 1px solid var(--ln);
  z-index: 99;
  display: flex;
  flex-direction: column;
  transition: right 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.5);
}

.drawer.open {
  right: 0;
}

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.scrim.show {
  opacity: 1;
  pointer-events: auto;
}

.dh {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 12px;
  border-bottom: 1px solid var(--ln);
  background: var(--bar);
}

.ll {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.layer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--ln);
  border-radius: 8px;
  background: var(--soft);
  cursor: pointer;
}

.layer-row.on {
  border-color: var(--ac);
  background: rgba(200, 16, 46, 0.12);
}

/* টোস্ট নোটিফিকেশন */
.toast {
  position: fixed;
  bottom: 74px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20, 24, 30, 0.96);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
