/* ══════════════════════════════════════════════════════════════════════
   KUNJ TOOLS - GIVE COMMAND & CUSTOM ITEM GENERATOR
   Master Responsive CSS (Desktop, Tablet, Mobile & Foldables)
   100% Zero-Truncation, Pixel-Perfect Minecraft Layout
   ══════════════════════════════════════════════════════════════════════ */

.tool-hero-givecmd {
  --tool-accent: #f59e0b;
}

#page-givecmd {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
  box-sizing: border-box;
  width: 100%;
  overflow-x: hidden;
}

#page-givecmd *,
#page-givecmd *::before,
#page-givecmd *::after {
  box-sizing: border-box;
}

/* ── Quick Presets Bar ── */
#page-givecmd .gc-presets-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin: 0 auto 1.5rem;
  width: 100%;
}

#page-givecmd .gc-preset-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  color: var(--text);
  font-family: var(--mc);
  font-size: 0.65rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  line-height: 1.2;
}

#page-givecmd .gc-preset-btn:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: #f59e0b;
  transform: translateY(-2px);
  color: #fff;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

#page-givecmd .gc-preset-btn:active {
  transform: translateY(0);
}

/* ── Two-Column Responsive Layout ── */
#page-givecmd .gc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 420px);
  gap: 1.5rem;
  width: 100%;
  margin: 0 auto 2.5rem;
  align-items: start;
}

#page-givecmd .gc-controls-col {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  min-width: 0;
  width: 100%;
}

/* ── Builder Sections & Panels ── */
#page-givecmd .gc-section {
  background: var(--panel);
  border: 2px solid var(--panel-border);
  border-radius: 8px;
  padding: 1.2rem;
  width: 100%;
  min-width: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

#page-givecmd .gc-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--mc);
  font-size: clamp(0.75rem, 2.8vw, 0.88rem);
  color: #f59e0b;
  text-shadow: 1px 1px 0 #000;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--panel-border);
  line-height: 1.35;
  word-break: break-word;
}

/* ── Section 1: Edition Radios ── */
#page-givecmd .gc-edition-radios {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 1rem;
  width: 100%;
}

#page-givecmd .gc-edition-label {
  display: flex;
  flex-direction: column;
  padding: 10px 12px;
  border: 2px solid var(--panel-border);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 0;
  width: 100%;
}

#page-givecmd .gc-edition-label:hover {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.05);
}

#page-givecmd .gc-edition-label:has(input:checked) {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.14);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.22);
}

#page-givecmd .gc-edition-label input {
  display: none;
}

#page-givecmd .gc-ed-title {
  font-family: var(--mc);
  font-size: 0.72rem;
  color: #fff;
  margin-bottom: 4px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
}

#page-givecmd .gc-ed-sub {
  font-size: 0.58rem;
  color: var(--text-mut);
  line-height: 1.35;
  word-break: break-word;
}

/* ── Target & Count Row ── */
#page-givecmd .gc-field-row {
  display: flex;
  gap: 12px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  width: 100%;
}

#page-givecmd .gc-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 160px;
  min-width: 0;
}

#page-givecmd .gc-field-label {
  font-family: var(--mc);
  font-size: 0.62rem;
  color: var(--text-sec);
  line-height: 1.25;
}

#page-givecmd select,
#page-givecmd input[type="text"],
#page-givecmd input[type="number"] {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--panel-border);
  color: #fff;
  border-radius: 4px;
  padding: 8px 10px;
  font-family: var(--mc);
  font-size: 0.72rem;
  width: 100%;
  max-width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#page-givecmd select:focus,
#page-givecmd input:focus {
  outline: none;
  border-color: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.35);
}

/* ── Section 2: Items Category Bar & Grid ── */
#page-givecmd .gc-cat-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  width: 100%;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

#page-givecmd .gc-cat-btn {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--panel-border);
  color: var(--text-sec);
  border-radius: 4px;
  padding: 6px 12px;
  font-family: var(--mc);
  font-size: 0.62rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.12s ease;
}

#page-givecmd .gc-cat-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

#page-givecmd .gc-cat-btn.active {
  background: #f59e0b;
  color: #000;
  border-color: #f59e0b;
  font-weight: bold;
}

#page-givecmd .gc-items-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 6px;
  max-height: 250px;
  overflow-y: auto;
  padding: 6px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  width: 100%;
  scrollbar-width: thin;
}

#page-givecmd .gc-item-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 7px 9px;
  cursor: pointer;
  color: var(--text);
  font-family: var(--mc);
  font-size: 0.62rem;
  text-align: left;
  transition: all 0.1s ease;
  min-width: 0;
}

#page-givecmd .gc-item-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

#page-givecmd .gc-item-btn.active {
  background: rgba(245, 158, 11, 0.25);
  border-color: #f59e0b;
  color: #fff;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

#page-givecmd .gc-item-ic {
  font-size: 1.2rem;
  flex-shrink: 0;
}

#page-givecmd .gc-item-name {
  white-space: normal;
  word-break: break-word;
  line-height: 1.25;
  overflow: visible;
  text-overflow: unset;
}

/* ── Section 3: Color Palette & Style Buttons ── */
#page-givecmd .gc-color-palette {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
  gap: 6px;
  margin: 8px 0;
  max-width: 100%;
}

#page-givecmd .gc-col-swatch {
  height: 28px;
  border-radius: 4px;
  border: 2px solid rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: transform 0.12s ease;
}

#page-givecmd .gc-col-swatch:hover,
#page-givecmd .gc-col-swatch.active {
  transform: scale(1.15);
  border-color: #fff;
  outline: 2px solid #f59e0b;
}

#page-givecmd .gc-style-group {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
  width: 100%;
}

#page-givecmd .gc-style-btn {
  flex: 1 1 80px;
  text-align: center;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--panel-border);
  color: var(--text-sec);
  border-radius: 4px;
  font-family: var(--mc);
  font-size: 0.65rem;
  cursor: pointer;
  transition: all 0.12s;
}

#page-givecmd .gc-style-btn.active {
  background: #f59e0b;
  color: #000;
  border-color: #f59e0b;
  font-weight: bold;
}

/* ── Section 4: Lore Lines ── */
#page-givecmd .gc-lore-item {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
  width: 100%;
}

#page-givecmd .gc-lore-input {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.72rem;
}

#page-givecmd .gc-lore-col {
  width: 36px;
  height: 36px;
  border: 1px solid var(--panel-border);
  border-radius: 4px;
  padding: 0;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
}

#page-givecmd .gc-lore-del {
  flex-shrink: 0;
  height: 36px;
  padding: 0 12px;
  color: #fca5a5;
  border-color: rgba(220, 38, 38, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ── Section 5: Enchantments Studio ── */
#page-givecmd .gc-ench-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
  width: 100%;
  scrollbar-width: thin;
}

#page-givecmd .gc-ench-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  gap: 12px;
  width: 100%;
  transition: border-color 0.12s;
}

#page-givecmd .gc-ench-row.active {
  border-color: rgba(245, 158, 11, 0.6);
  background: rgba(245, 158, 11, 0.1);
}

#page-givecmd .gc-ench-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 140px;
  min-width: 0;
}

#page-givecmd .gc-ench-title {
  font-family: var(--mc);
  font-size: 0.7rem;
  color: #fff;
  line-height: 1.3;
  word-break: break-word;
}

#page-givecmd .gc-ench-badge {
  font-size: 0.58rem;
  color: var(--text-mut);
}

#page-givecmd .gc-ench-badge.active {
  color: #f59e0b;
  font-weight: bold;
}

#page-givecmd .gc-ench-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#page-givecmd .gc-ench-slider {
  width: 110px;
  height: 24px;
  accent-color: #f59e0b;
  cursor: pointer;
}

#page-givecmd .gc-ench-num {
  width: 50px;
  height: 32px;
  text-align: center;
  padding: 4px 6px;
  font-size: 0.72rem;
  border-radius: 4px;
}

/* ── Section 6: Attributes ── */
#page-givecmd .gc-attr-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  width: 100%;
  background: rgba(0, 0, 0, 0.22);
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--panel-border);
}

#page-givecmd .gc-attr-type {
  flex: 1 1 140px;
  min-width: 120px;
}

#page-givecmd .gc-attr-val {
  flex: 0 0 75px;
}

#page-givecmd .gc-attr-slot {
  flex: 1 1 110px;
  min-width: 100px;
}

#page-givecmd .gc-attr-del {
  flex-shrink: 0;
  height: 34px;
  padding: 0 10px;
  color: #fca5a5;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Right Column: Sticky Preview & Output ── */
#page-givecmd .gc-sticky-col {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  width: 100%;
  min-width: 0;
}

/* ── Authentic Minecraft In-Game Tooltip ── */
#page-givecmd .mc-tooltip-box {
  background: #100010;
  border: 2px solid #280050;
  border-radius: 6px;
  padding: 14px 16px;
  box-shadow: inset 0 0 0 1px #5000aa, 0 10px 30px rgba(0, 0, 0, 0.7);
  font-family: var(--mc), monospace;
  position: relative;
  line-height: 1.45;
  image-rendering: pixelated;
  width: 100%;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

#page-givecmd .mc-tooltip-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(80, 0, 170, 0.4);
}

#page-givecmd .mc-item-icon-wrap {
  width: 46px;
  height: 46px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(80, 0, 170, 0.5);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

#page-givecmd .mc-item-icon-wrap::after {
  content: '';
  position: absolute;
  inset: -100%;
  background: linear-gradient(135deg, transparent 40%, rgba(168, 85, 247, 0.35) 50%, transparent 60%);
  animation: mcGlintAnim 3s infinite linear;
}

@keyframes mcGlintAnim {
  0% { transform: translate(-30%, -30%); }
  100% { transform: translate(30%, 30%); }
}

#page-givecmd .mc-item-title {
  font-size: clamp(0.85rem, 3vw, 1rem);
  letter-spacing: 0.5px;
  text-shadow: 2px 2px 0 #000;
  word-break: break-word;
}

#page-givecmd .mc-ench-line {
  color: #AAAAAA;
  font-size: 0.65rem;
  text-shadow: 1px 1px 0 #000;
  margin-top: 2px;
  word-break: break-word;
}

#page-givecmd .mc-lore-line {
  font-size: 0.62rem;
  margin-top: 4px;
  text-shadow: 1px 1px 0 #000;
  line-height: 1.4;
  word-break: break-word;
}

#page-givecmd .mc-attr-header {
  color: #AAAAAA;
  font-size: 0.58rem;
  margin-top: 8px;
}

#page-givecmd .mc-attr-line {
  color: #5555FF;
  font-size: 0.62rem;
  text-shadow: 1px 1px 0 #000;
  word-break: break-word;
}

#page-givecmd .mc-unbr-tag {
  color: #5555FF;
  font-size: 0.62rem;
  margin-top: 8px;
  text-shadow: 1px 1px 0 #000;
}

/* ── Command Output Box ── */
#page-givecmd .gc-output-card {
  background: var(--panel);
  border: 2px solid var(--panel-border);
  border-radius: 8px;
  padding: 1.2rem;
  width: 100%;
  min-width: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

#page-givecmd .gc-cmd-textarea {
  width: 100%;
  max-width: 100%;
  height: 105px;
  background: #090714;
  border: 2px solid var(--panel-border);
  border-radius: 6px;
  color: #4ade80;
  font-family: monospace;
  font-size: 0.72rem;
  padding: 10px;
  resize: vertical;
  line-height: 1.45;
  word-break: break-all;
  overflow-x: hidden;
}

#page-givecmd .gc-cmd-textarea:focus {
  outline: none;
  border-color: #f59e0b;
}

#page-givecmd .gc-output-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 6px;
}

#page-givecmd .gc-char-badge {
  font-family: var(--mc);
  font-size: 0.62rem;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 4px;
}

#page-givecmd .gc-chat-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid #f59e0b;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.62rem;
  color: #fbbf24;
  margin-bottom: 12px;
  display: none;
  line-height: 1.4;
}

#page-givecmd .gc-btn-copy {
  width: 100%;
  padding: 13px;
  font-family: var(--mc);
  font-size: 0.88rem;
  background: linear-gradient(180deg, #f59e0b, #d97706);
  color: #000;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#page-givecmd .gc-btn-copy:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
}

#page-givecmd .gc-btn-copy.btn-copied {
  background: linear-gradient(180deg, #22c55e, #16a34a);
  color: #fff;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

/* ── SEO FAQ Section ── */
#page-givecmd .seo-faq-section {
  max-width: 1000px;
  margin: 3rem auto 2rem;
  padding: 0;
  width: 100%;
}

#page-givecmd .seo-faq-title {
  font-family: var(--mc);
  font-size: clamp(1rem, 3.5vw, 1.35rem);
  color: #f59e0b;
  text-shadow: 2px 2px 0 #000;
  margin-bottom: 1.2rem;
  text-align: center;
}

#page-givecmd .seo-faq-item {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  margin-bottom: 10px;
  padding: 12px 16px;
  width: 100%;
}

#page-givecmd .seo-faq-item summary {
  font-family: var(--mc);
  font-size: 0.75rem;
  color: #fff;
  cursor: pointer;
  user-select: none;
  line-height: 1.35;
}

#page-givecmd .seo-faq-body {
  margin-top: 10px;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--text-sec);
}

/* ══════════════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS (Tablets, iPads, Phones)
   ══════════════════════════════════════════════════════════════════════ */

/* Medium Screens & Tablets (<= 960px) */
@media (max-width: 960px) {
  #page-givecmd {
    padding-bottom: 2rem;
  }

  #page-givecmd .gc-layout {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  #page-givecmd .gc-sticky-col {
    position: static;
    top: auto;
    width: 100%;
  }

  #page-givecmd .gc-presets-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 6px;
  }

  #page-givecmd .gc-preset-btn {
    width: 100%;
    padding: 8px 6px;
    font-size: 0.62rem;
    white-space: normal;
    text-align: center;
  }
}

/* Small Tablets & Large Phones (<= 768px) */
@media (max-width: 768px) {
  #page-givecmd .gc-edition-radios {
    grid-template-columns: 1fr;
  }

  #page-givecmd .gc-ench-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
  }

  #page-givecmd .gc-ench-info {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  #page-givecmd .gc-ench-ctrl {
    width: 100%;
    justify-content: space-between;
  }

  #page-givecmd .gc-ench-slider {
    flex: 1 1 auto;
    width: auto;
  }
}

/* Mobile Phones (<= 640px) */
@media (max-width: 640px) {
  #page-givecmd {
    padding: 0 0.5rem 2rem;
  }

  #page-givecmd .gc-section {
    padding: 0.95rem;
    border-radius: 6px;
  }

  #page-givecmd .gc-presets-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  #page-givecmd .gc-field-row {
    display: grid;
    grid-template-columns: 1fr 100px;
    gap: 8px;
  }

  #page-givecmd .gc-items-container {
    grid-template-columns: repeat(2, 1fr);
    max-height: 220px;
    gap: 6px;
  }

  #page-givecmd .gc-item-btn {
    padding: 7px 8px;
    font-size: 0.6rem;
  }

  #page-givecmd .gc-style-group {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  #page-givecmd .gc-style-btn {
    padding: 7px 4px;
    font-size: 0.6rem;
  }

  #page-givecmd .gc-attr-row {
    display: grid;
    grid-template-columns: 80px 1fr 40px;
    gap: 8px;
    align-items: center;
    padding: 8px;
  }

  #page-givecmd .gc-attr-type {
    grid-column: 1 / -1;
    width: 100%;
  }

  #page-givecmd .gc-attr-val,
  #page-givecmd .gc-attr-slot {
    width: 100%;
  }

  #page-givecmd .gc-attr-del {
    height: 36px;
    width: 40px;
  }

  #page-givecmd .mc-tooltip-box {
    padding: 10px 12px;
  }
}

/* Ultra-Compact Phones (<= 380px) */
@media (max-width: 380px) {
  #page-givecmd .gc-presets-bar {
    grid-template-columns: 1fr;
  }

  #page-givecmd .gc-field-row {
    grid-template-columns: 1fr;
  }

  #page-givecmd .gc-items-container {
    grid-template-columns: 1fr;
  }

  #page-givecmd .gc-style-group {
    grid-template-columns: 1fr;
  }
}
