/**
 * Pixel Art Tag Generator - Minecraft Style Tool
 * 
 * A responsive web tool for creating pixel art tags with text, gradients,
 * shadows, icons, and customizable backgrounds. Optimized for Minecraft
 * resource pack creators.
 * 
 * Responsive breakpoints:
 * - Desktop: >768px
 * - Tablet: 768px
 * - Mobile: 480px
 * - Small Mobile: 360px
 * - Extra Small: 270px
 * - Ultra Small: 200px
 */

/* ===== LAYOUT SECTIONS ===== */

.tag-section {
  margin: 20px 0;
}

/* Top Section - Preview and Actions */
.top-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 15px;
  margin: 20px 0;
  width: 100%;
  align-items: stretch;
  box-sizing: border-box;
}

/* Controls Section */
.controls-section {
  margin: 20px 0 0 0;
}

/* Tool Container - Text and Background Panels */
.tool-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

/* Icon section specific layout adjustments */
.icon-section .tool-container {
  grid-template-columns: 1fr;
}

/* When icons panel becomes visible, switch to 2-column layout */
.icon-section .tool-container:has(#iconsPanel[style*="display: block"]),
.icon-section .tool-container.has-icons {
  grid-template-columns: 1fr 1fr;
}

/* Fallback for browsers without :has() support */
.icon-section.has-icons .tool-container {
  grid-template-columns: 1fr 1fr;
}

/* ===== PANELS AND CARDS ===== */

.tool-panel {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
}

.tool-panel h3 {
  margin: 0 0 20px 0;
  font-size: 24px;
  color: #333;
  font-weight: bold;
}

/* ===== FORM ELEMENTS ===== */

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #666;
  font-size: 14px;
}

.input-group input[type="text"] {
  width: 100%;
  padding: 12px;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  font-size: 16px;
  background: #fff;
  transition: border-color 0.2s ease;
  text-align: center;
  font-family: monospace;
  font-weight: bold;
  text-transform: uppercase;
}

.input-group input[type="text"]:focus {
  outline: none;
  border-color: #1376b3;
}

.input-group select {
  width: 100%;
  padding: 12px;
  border: 2px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  transition: border-color 0.2s ease;
}

.input-group select:focus {
  outline: none;
  border-color: #1376b3;
}

/* Quantity Controls */
.quantity-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quantity-btn {
  padding: 8px;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  color: #666;
  font-size: 18px;
  font-weight: bold;
  width: 36px;
  height: 36px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-btn:hover {
  border-color: #1376b3;
  background: #f0f8ff;
}

.quantity-control input[type="number"] {
  flex: 1;
  padding: 8px 12px;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  text-align: center;
  font-size: 14px;
  background: #fff;
}

.quantity-control input[type="number"]:focus {
  outline: none;
  border-color: #1376b3;
}

/* ===== SPECIALIZED CONTROLS ===== */

/* Switch Controls */
.switch-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.switch {
  width: 20px;
  height: 20px;
  accent-color: #1376b3;
  cursor: pointer;
}

.switch-label {
  font-size: 14px;
  color: #666;
  cursor: pointer;
  margin: 0;
}

/* Colors Container */
.colors-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.color-entry {
  background: rgba(0, 0, 0, 0.1);
  padding: 12px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.color-entry label {
  margin-bottom: 6px;
  font-size: 12px;
  color: #333;
  font-weight: 600;
}

.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-box {
  width: 40px;
  height: 40px;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  cursor: pointer;
  background: none;
  padding: 0;
  transition: border-color 0.2s ease;
}

.color-box:hover {
  border-color: #1376b3;
}

.hex-input {
  flex: 1;
  padding: 8px 10px;
  padding-left: 24px;
  border: 2px solid #d1d5db;
  border-radius: 4px;
  font-family: monospace;
  font-size: 14px;
  background: #fff;
  color: #333;
  transition: border-color 0.2s ease;
}

.hex-input:focus {
  outline: none;
  border-color: #1376b3;
}

/* ===== UTILITY STYLES ===== */

/* Hide number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* ===== PREVIEW AND ACTIONS ===== */

/* Preview Card */
.preview-card {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}

.preview-card h3 {
  margin: 0 0 20px 0;
  font-size: 18px;
  color: #333;
  font-weight: bold;
}

.canvas-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px;
  width: 100%;
  height: auto;
  min-height: 80px;
  box-sizing: border-box;
}

#canvas {
  border: none;
  background: transparent;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  /* Scale down proportionally to fit container while maintaining aspect ratio */
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Actions Card */
.actions-card {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.actions-card h3 {
  margin: 0 0 20px 0;
  font-size: 18px;
  color: #333;
  font-weight: bold;
}

/* JSON button styling from json-formatter.css */
.json-button, .json-button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: 2px solid;
  border-radius: 4px;
  font-weight: bold;
  font-size: 16px;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-sizing: border-box;
  min-height: 44px;
  gap: 8px;
  width: 100%;
  min-width: 0;
}

.json-button {
  background-color: #1376B3;
  color: #ffffff;
  border: 2px solid #d1d5db;
}

.json-button:hover {
  background-color: #005583;
  border-color: #1f2937;
}

.json-button-secondary {
  background-color: #ffffff;
  color: #333333;
  border: 2px solid #d1d5db;
}

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

.copy-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.json-buttons-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* ===== LINKS SECTION ===== */

.links-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin: 50px auto;
  max-width: 800px;
}

.link-item {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 8px;
  border: 2px solid #e9ecef;
  text-align: center;
}

.link-item h3 {
  margin-bottom: 10px;
  font-size: 20px;
  color: #333;
}

.link-item p {
  margin-bottom: 20px;
  color: #666;
  font-size: 14px;
}

.link-button {
  display: inline-block;
  padding: 10px 20px;
  background: #1376b3;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.2s ease;
}

.link-button:hover {
  background: #005583;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet and below (768px) */
@media (max-width: 768px) {
  .top-section {
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 20px 0;
    padding: 0;
  }
  
  .controls-section {
    margin: 20px auto 0;
    padding: 0;
  }
  
  .tool-container {
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 0;
    padding: 0;
  }
  
  .tool-panel {
    padding: 15px;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
  }
  
  .tool-panel h3 {
    font-size: 20px;
    margin-bottom: 15px;
  }
  
  .input-group {
    margin-bottom: 15px;
  }
  
  .input-group input[type="text"],
  .input-group select {
    padding: 10px;
    font-size: 14px;
  }
  
  .quantity-control {
    flex-wrap: nowrap;
    gap: 6px;
  }
  
  .quantity-btn {
    padding: 6px;
    font-size: 16px;
    width: 32px;
    height: 32px;
  }
  
  .colors-container {
    gap: 10px;
  }
  
  .color-entry {
    padding: 12px;
  }
  
  .color-picker-wrapper {
    gap: 6px;
  }
  
  .links-section {
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 30px 0;
    padding: 0;
  }
  
  .actions-card {
    min-width: auto;
    width: 100%;
  }
  
  .preview-card {
    width: 100%;
    padding: 15px;
  }
  
  .canvas-container {
    padding: 8px;
    min-height: 60px;
  }
  
  /* Icons section responsive */
  .icon-section {
    margin: 20px 0 0 0;
    padding: 0;
  }
  
  .icon-section .tool-container {
    grid-template-columns: 1fr !important;
  }
  
  .icon-panel {
    padding: 15px;
  }
  
  .icon-entry {
    grid-template-columns: 1fr;
    gap: 10px;
    text-align: center;
  }
  
  .icon-preview-container {
    justify-self: center;
    width: 50px;
    height: 35px;
  }
  
  .icon-controls {
    align-items: center;
  }
  
  .icon-position-control {
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
  }
  
  .icon-position-control label {
    min-width: auto;
  }
}

/* Mobile (480px) */
@media (max-width: 480px) {
  .top-section {
    padding: 0;
    margin: 15px 0;
  }
  
  .controls-section {
    margin: 15px auto 0;
    padding: 0;
  }
  
  .tool-container {
    gap: 15px;
    margin: 0;
  }
  
  .tool-panel {
    padding: 12px;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
  }
  
  .tool-panel h3 {
    font-size: 18px;
    margin-bottom: 12px;
  }
  
  .input-group {
    margin-bottom: 12px;
  }
  
  .input-group label {
    font-size: 13px;
    margin-bottom: 6px;
  }
  
  .input-group input[type="text"],
  .input-group select {
    font-size: 14px;
    padding: 8px;
  }
  
  .quantity-control {
    flex-wrap: nowrap;
    gap: 4px;
    width: 100%;
  }
  
  .quantity-btn {
    padding: 4px;
    font-size: 14px;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
  }
  
  .quantity-control input[type="number"] {
    width: 60%;
    padding: 6px 4px;
    font-size: 12px;
    min-width: 30px;
    flex-shrink: 1;
  }
  
  .colors-container {
    gap: 8px;
    margin-bottom: 15px;
  }
  
  .color-entry {
    padding: 10px;
  }
  
  .color-entry label {
    font-size: 11px;
    margin-bottom: 4px;
  }
  
  .color-picker-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    width: 100%;
  }
  
  .color-box {
    width: 100%;
    height: 35px;
    margin-bottom: 4px;
    max-width: none;
  }
  
  .hex-input {
    padding: 6px 8px;
    padding-left: 20px;
    font-size: 12px;
    width: 100%;
    min-width: 0;
  }
  
  .preview-card {
    padding: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .actions-card {
    padding: 12px;
    width: 100%;
    max-width: 100%;
    min-width: auto;
    box-sizing: border-box;
  }
  
  .preview-card h3,
  .actions-card h3 {
    font-size: 16px;
    margin-bottom: 12px;
  }
  
  .canvas-container {
    padding: 5px;
    min-height: 50px;
  }
  
  /* Icons section responsive */
  .icon-section {
    margin: 15px 0 0 0;
    padding: 0;
  }
  
  .icon-panel {
    padding: 12px;
  }
  
  .icon-panel h3 {
    font-size: 18px;
    margin-bottom: 12px;
  }
  
  .icon-entry {
    padding: 10px;
    gap: 8px;
  }
  
  .icon-preview-container {
    width: 45px;
    height: 30px;
  }
  
  
  .icon-position-control {
    gap: 4px;
    width: 100%;
  }
  
  .icon-position-control label {
    font-size: 11px;
    width: auto;
    min-width: 0;
    white-space: nowrap;
  }
  
  .icon-position-control select {
    width: 75%;
    font-size: 11px;
    padding: 3px 6px;
  }
  
  .pixel-btn {
    min-width: 16px;
    height: 16px;
    font-size: 9px;
  }
  
  .pixel-input {
    width: 30px;
    font-size: 10px;
    padding: 1px 3px;
  }
  
  .link-item {
    padding: 15px;
  }
  
  .link-item h3 {
    font-size: 16px;
  }
}

/* Small Mobile (360px) */
@media (max-width: 360px) {
  .top-section {
    padding: 0;
    margin: 10px 0;
  }
  
  .controls-section {
    margin: 10px auto 0;
    padding: 0;
  }
  
  .tool-container {
    gap: 12px;
  }
  
  .tool-panel {
    padding: 10px;
  }
  
  .tool-panel h3 {
    font-size: 16px;
    margin-bottom: 10px;
  }
  
  .input-group {
    margin-bottom: 10px;
  }
  
  .input-group label {
    font-size: 12px;
    margin-bottom: 4px;
  }
  
  .input-group input[type="text"],
  .input-group select {
    font-size: 13px;
    padding: 6px;
  }
  
  .quantity-control {
    gap: 2px;
    width: 100%;
  }
  
  .quantity-btn {
    padding: 3px;
    font-size: 12px;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
  }
  
  .quantity-control input[type="number"] {
    width: 64%;
    padding: 4px 3px;
    font-size: 11px;
    min-width: 25px;
    flex-shrink: 1;
  }
  
  .color-entry {
    padding: 8px;
  }
  
  .color-box {
    width: 100%;
    height: 30px;
    max-width: none;
  }
  
  .hex-input {
    padding: 4px 6px;
    padding-left: 18px;
    font-size: 11px;
    width: 100%;
    min-width: 0;
  }
  
  .preview-card,
  .actions-card {
    padding: 8px;
    min-width: auto;
  }
  
  .preview-card h3,
  .actions-card h3 {
    font-size: 14px;
    margin-bottom: 8px;
  }
  
  .canvas-container {
    min-height: 40px;
    padding: 3px;
  }
  
  /* Icons section responsive */
  .icon-section {
    margin: 10px 0 0 0;
    padding: 0;
  }
  
  .icon-panel {
    padding: 10px;
  }
  
  .icon-panel h3 {
    font-size: 16px;
    margin-bottom: 10px;
  }
  
  .icon-entry {
    padding: 8px;
    gap: 6px;
  }
  
  .icon-move-btn .material-symbols-outlined,
  .icon-remove-btn .material-symbols-outlined {
    font-size: 14px;
    font-weight: 700;
  }
  
  .icon-preview-container {
    width: 40px;
    height: 25px;
  }
  
  
  .icon-position-control label {
    font-size: 10px;
  }
  
  .icon-position-control select {
    font-size: 10px;
    padding: 2px 4px;
  }
  
  .pixel-btn {
    min-width: 14px;
    height: 14px;
    font-size: 8px;
  }
  
  .pixel-input {
    width: 25px;
    font-size: 9px;
    padding: 1px 2px;
  }
}

/* Extra Small Mobile (270px) */
@media (max-width: 270px) {
  .top-section {
    padding: 0;
    margin: 8px 0;
  }
  
  .controls-section {
    margin: 8px auto 0;
    padding: 0;
  }
  
  .tool-container {
    gap: 8px;
  }
  
  .tool-panel {
    padding: 8px;
    border-width: 1px;
  }
  
  .tool-panel h3 {
    font-size: 14px;
    margin-bottom: 8px;
  }
  
  .input-group {
    margin-bottom: 8px;
  }
  
  .input-group label {
    font-size: 11px;
    margin-bottom: 3px;
  }
  
  .input-group input[type="text"],
  .input-group select {
    font-size: 12px;
    padding: 4px;
  }
  
  .quantity-control {
    gap: 1px;
    flex-wrap: nowrap;
    width: 100%;
  }
  
  .quantity-btn {
    padding: 2px;
    font-size: 10px;
    width: 20px;
    height: 20px;
    border-width: 1px;
    flex-shrink: 0;
  }
  
  .quantity-control input[type="number"] {
    width: 68%;
    padding: 2px 2px;
    font-size: 9px;
    min-width: 12px;
    border-width: 1px;
    flex-shrink: 1;
  }
  
  .colors-container {
    gap: 6px;
    margin-bottom: 12px;
  }
  
  .color-entry {
    padding: 6px;
    border-width: 1px;
  }
  
  .color-entry label {
    font-size: 10px;
    margin-bottom: 3px;
  }
  
  .color-box {
    width: 100%;
    height: 25px;
    border-width: 1px;
    max-width: none;
  }
  
  .hex-input {
    padding: 3px 4px;
    padding-left: 16px;
    font-size: 10px;
    border-width: 1px;
    width: 100%;
    min-width: 0;
  }
  
  .color-entry .hex-input::before {
    left: 5px;
    font-size: 10px;
  }
  
  .preview-card,
  .actions-card {
    padding: 6px;
    border-width: 1px;
    min-width: auto;
  }
  
  .preview-card h3,
  .actions-card h3 {
    font-size: 13px;
    margin-bottom: 6px;
  }
  
  .canvas-container {
    min-height: 30px;
    padding: 2px;
  }
  
  /* Icons section responsive */
  .icon-section {
    margin: 8px 0 0 0;
    padding: 0;
  }
  
  .icon-panel {
    padding: 8px;
    border-width: 1px;
  }
  
  .icon-panel h3 {
    font-size: 14px;
    margin-bottom: 8px;
  }
  
  .icon-entry {
    padding: 6px;
    gap: 4px;
    border-width: 1px;
  }
  
  .icon-preview-container {
    width: 35px;
    height: 20px;
    border-width: 1px;
  }
  
  
  .icon-position-control label {
    font-size: 9px;
  }
  
  .icon-position-control select {
    font-size: 9px;
    padding: 1px 3px;
    border-width: 1px;
  }
  
  .pixel-btn {
    min-width: 12px;
    height: 12px;
    font-size: 7px;
    border-width: 1px;
  }
  
  .pixel-input {
    width: 20px;
    font-size: 8px;
    padding: 1px;
    border-width: 1px;
  }
  
  .json-button,
  .json-button-secondary {
    padding: 8px 10px;
    font-size: 12px;
    min-height: 32px;
    border-width: 1px;
  }
  
  .json-buttons-container {
    gap: 8px;
  }
  
  .copy-icon {
    width: 10px;
    height: 10px;
  }
  
  .links-section {
    margin: 20px 0;
    padding: 0;
    gap: 15px;
  }
  
  .link-item {
    padding: 10px;
    border-width: 1px;
  }
  
  .link-item h3 {
    font-size: 14px;
    margin-bottom: 8px;
  }
  
  .link-item p {
    font-size: 12px;
    margin-bottom: 15px;
  }
  
  .link-button {
    padding: 6px 12px;
    font-size: 12px;
  }
}

/* Ultra Small Mobile (200px) */
@media (max-width: 200px) {
  .top-section {
    padding: 0;
    margin: 5px 0;
  }
  
  .controls-section {
    margin: 5px auto 0;
    padding: 0;
  }
  
  .tool-container {
    gap: 5px;
  }
  
  .tool-panel {
    padding: 5px;
  }
  
  .tool-panel h3 {
    font-size: 12px;
    margin-bottom: 5px;
  }
  
  .input-group {
    margin-bottom: 5px;
  }
  
  .input-group label {
    font-size: 9px;
    margin-bottom: 2px;
  }
  
  .input-group input[type="text"],
  .input-group select {
    font-size: 10px;
    padding: 3px;
  }
  
  .quantity-btn {
    padding: 2px;
    font-size: 9px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
  }
  
  .quantity-control input[type="number"] {
    width: 70%;
    padding: 2px 1px;
    font-size: 8px;
    min-width: 10px;
    flex-shrink: 1;
  }
  
  .color-box {
    width: 100%;
    height: 20px;
    max-width: none;
  }
  
  .hex-input {
    padding: 2px 3px;
    padding-left: 14px;
    font-size: 9px;
    width: 100%;
    min-width: 0;
  }
  
  .color-entry .hex-input::before {
    left: 3px;
    font-size: 9px;
  }
  
  .json-button,
  .json-button-secondary {
    padding: 5px 7px;
    font-size: 10px;
    min-height: 28px;
  }
  
  .copy-icon {
    width: 8px;
    height: 8px;
  }
  
  /* Icons section responsive */
  .icon-section {
    margin: 5px 0 0 0;
    padding: 0;
  }
  
  .icon-panel {
    padding: 5px;
  }
  
  .icon-panel h3 {
    font-size: 12px;
    margin-bottom: 5px;
  }
  
  .icon-entry {
    padding: 4px;
    gap: 3px;
  }
  
  .icon-preview-container {
    width: 30px;
    height: 18px;
  }
  
  
  .icon-position-control label {
    font-size: 8px;
  }
  
  .icon-position-control select {
    font-size: 8px;
    padding: 1px 2px;
  }
  
  .pixel-btn {
    min-width: 10px;
    height: 10px;
    font-size: 6px;
  }
  
  .pixel-input {
    width: 18px;
    font-size: 7px;
    padding: 0px 1px;
  }
}

/* ===== COLOR PICKER ENHANCEMENTS ===== */

.color-entry .color-picker-wrapper {
  margin-top: 8px;
}

.color-entry .hex-input {
  position: relative;
}

.color-entry .hex-input::before {
  content: '#';
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
  pointer-events: none;
}

/* ===== ICON UPLOAD SECTION ===== */

/* Icon Section Styling */
.icon-section {
  margin: 20px 0 0 0;
}

.icon-panel {
  background: #f8f9fa;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 20px;
  width: 100%;
}

.icon-panel h3 {
  margin: 0 0 20px 0;
  font-size: 24px;
  color: #333;
  font-weight: bold;
}

.icon-panel h4 {
  margin: 20px 0 15px 0;
  font-size: 18px;
  color: #333;
  font-weight: 600;
}

/* Icon Drop Zone Styling */
.icon-drop-zone {
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-drop-zone:hover {
  border-color: #1376b3;
  background: #f0f8ff;
}

.icon-drop-zone.drag-over {
  border-color: #1376b3;
  background: #e6f3ff;
  border-style: solid;
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.drop-icon {
  width: 24px;
  height: 24px;
  color: #666;
}

.icon-drop-zone p {
  margin: 0;
  color: #666;
  font-size: 14px;
  font-weight: 500;
}

.drop-hint {
  font-size: 12px !important;
  color: #888 !important;
  font-style: italic;
}


.icons-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Individual Icon Entry */
.icon-entry {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.icon-header {
  background: rgba(0, 0, 0, 0.08);
  padding: 8px 12px;
  border-bottom: 1px solid #d1d5db;
  border-radius: 6px 6px 0 0;
  text-align: center;
}

.icon-header .icon-info {
  font-size: 12px;
  font-weight: 500;
  color: #374151;
}

.icon-content {
  padding: 12px;
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 15px;
  align-items: center;
}

.icon-preview-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 60px;
  height: 40px;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 4px;
}

.icon-preview {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  border-radius: 0 !important;
  object-fit: contain;
}

.icon-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.icon-info {
  font-size: 11px;
  color: #666;
}

.icon-position-control {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.icon-position-control label {
  font-size: 12px;
  color: #333;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
}

.icon-position-control select {
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 12px;
  background: #fff;
}

/* Pixel positioning controls */
.icon-pixel-controls {
  margin-top: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  border: 1px solid #e9ecef;
}

.pixel-control-group {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
}

.pixel-control-group:last-child {
  margin-bottom: 0;
}

.pixel-control-group label {
  font-size: 11px;
  color: #333;
  font-weight: 600;
  min-width: 12px;
  margin: 0;
}

.pixel-btn {
  padding: 2px 6px;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  font-size: 10px;
  line-height: 1;
  transition: all 0.2s ease;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pixel-btn:hover {
  background: #f0f8ff;
  border-color: #1376b3;
}

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

.pixel-input {
  width: 40px;
  padding: 2px 4px;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  font-size: 11px;
  text-align: center;
  background: #fff;
}

.pixel-input:focus {
  outline: none;
  border-color: #1376b3;
  box-shadow: 0 0 0 1px rgba(19, 118, 179, 0.2);
}

.icon-actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
}

.icon-move-btn, .icon-remove-btn {
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-move-btn .material-symbols-outlined,
.icon-remove-btn .material-symbols-outlined {
  font-size: 16px;
  font-weight: 700;
  color: #333;
}

.icon-move-btn:hover {
  background: #f0f8ff;
  border-color: #1376b3;
}

.icon-remove-btn {
  color: #dc3545;
  border-color: #dc3545;
}

.icon-remove-btn:hover {
  background: #dc3545;
  color: white;
}

.scale-hint {
  font-size: 11px;
  color: #888;
  text-align: center;
  margin-top: 5px;
}

/* Clear button styling */
.clear-image-btn {
  margin-top: 10px;
  padding: 8px 16px;
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background-color 0.2s ease;
}

.clear-image-btn:hover {
  background: #c82333;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .icon-content {
    grid-template-columns: 50px 1fr auto;
    gap: 8px;
    padding: 10px;
  }
  
  .icon-preview-container {
    justify-self: center;
    width: 50px;
    height: 30px;
  }
  
  .icon-controls {
    align-items: center;
  }
  
  .icon-position-control {
    justify-content: center;
  }
  
  .icon-move-btn .material-symbols-outlined,
  .icon-remove-btn .material-symbols-outlined {
    font-size: 12px;
    font-weight: 700;
  }
}

/* Ultra Small Screens - Stack everything vertically */
@media (max-width: 260px) {
  .icon-content {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 8px;
    text-align: center;
  }
  
  .icon-preview-container {
    justify-self: center;
    width: 40px;
    height: 25px;
  }
  
  .icon-controls {
    align-items: center;
  }
  
  .icon-position-control {
    justify-content: center;
  }
  
  .icon-actions {
    flex-direction: row;
    justify-content: center;
    gap: 5px;
  }
  
  .icon-header {
    padding: 6px 8px;
  }
  
  .icon-header .icon-info {
    font-size: 11px;
  }
}