﻿/* responsive.css (remaining styles) */
/* Split from legacy style.css */


.mask-preview-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.mask-preview-thumbnail {
  max-width: 110px;
}

@media screen and (min-width: 600px) {
  .preview-top-row {
    flex-direction: row;
    justify-content: space-around;
  }
  
  .preview-container,
  .edge-preview-container,
  .processed-preview-container,
  .filtered-preview-container,
  .original-preview-container {
    flex: 1;
    max-width: 32%;
  }
}

/* Desktop: let previews grow instead of being capped at ~32% width */
@media screen and (min-width: 902px) {
  .preview-top-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
    align-items: start;
    justify-items: center;
  }

  .preview-container,
  .edge-preview-container,
  .processed-preview-container,
  .filtered-preview-container,
  .original-preview-container {
    max-width: none;
    width: 100%;
  }

  .preview-thumbnail {
    max-width: 120px;
  }
}

.pattern-divider {
  border: none;
  border-top: 1px solid var(--dark-border);
  margin: 1rem 0;
  opacity: 0.5;
}

.text-items-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  width: 100%;
}

.text-items-panel {
  display: grid;
  gap: 12px;
  padding: 0; /* panel already has padding */
}

.text-items-list {
  border: 1px solid var(--dark-border);
  border-radius: 6px;
  background: rgba(3, 3, 8, 0.25);
  padding: 0.5rem;
  display: grid;
  gap: 0.4rem;
  max-height: 180px;
  overflow: auto;
}

.text-item-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.5rem;
  border: 1px solid rgba(0, 255, 255, 0.10);
  border-radius: 6px;
  cursor: pointer;
  background: rgba(0, 255, 255, 0.03);
}

.text-item-row.active {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.25);
  background: rgba(0, 255, 255, 0.08);
}

.text-item-title {
  font-size: 0.85rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-item-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.text-item-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  width: 100%;
}

.text-item-cell {
  display: grid;
  gap: 0.35rem;
  place-items: center;
  text-align: center;
}

.text-item-cell select {
  width: 100%;
  max-width: 260px;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--dark-border);
  border-radius: 6px;
  background: rgba(0, 255, 255, 0.05);
  color: var(--text-primary);
}

.clear-btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.5rem;
  font-size: 0.85rem;
}

/* Buttons */
button {
  padding: 0.6rem 1rem;
  border: 1px solid var(--dark-border);
  border-radius: 4px;
  background: rgba(0, 255, 255, 0.05);
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

button:not([disabled]):hover {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 10px var(--neon-cyan);
  background: rgba(0, 255, 255, 0.1);
  color: var(--neon-cyan);
  transform: translateY(-1px);
}

button:not([disabled]):active {
  transform: translateY(0);
  box-shadow: 0 0 5px var(--neon-cyan);
}

button[disabled] {
  background: rgba(0, 255, 255, 0.02);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.5;
}

/* Floating Draggable D-Pad */
.dpad-wrapper {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  user-select: none;
  touch-action: none;
  cursor: default;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.dpad-wrapper.hidden {
  display: none;
}

.dpad-wrapper.centered {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  bottom: 20px;
}

.dpad-wrapper.dragging {
  pointer-events: auto;
}

.dpad-wrapper .dpad {
  pointer-events: auto;
}

.dpad-drag-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  pointer-events: none;
  display: none;
}

.dpad-drag-overlay.active {
  display: block;
  pointer-events: auto;
  cursor: grabbing;
}

.dpad-wrapper.dragging {
  cursor: grabbing;
}

.dpad-drag-handle {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  width: 45px;
  height: 24px;
  background: rgba(10, 10, 15, 0.95);
  border: 1px solid var(--neon-cyan);
  border-radius: 6px 6px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  color: var(--neon-cyan);
  font-size: 12px;
  transition: all 0.3s ease;
  touch-action: none;
  box-shadow: var(--glow-cyan-soft);
  text-shadow: var(--glow-cyan-soft);
  pointer-events: auto;
  z-index: 1001;
}

.dpad-drag-handle:hover {
  background: rgba(0, 255, 255, 0.1);
  box-shadow: var(--glow-cyan);
  transform: translateX(-50%) translateY(-2px);
}

.dpad-drag-handle:active {
  cursor: grabbing;
  background: rgba(0, 255, 255, 0.15);
  transform: translateX(-50%) translateY(0);
}

.dpad {
  display: grid;
  place-items: center;
  grid-template-areas:
  	 '. up .'
   'left . right'
    '. down .';
  gap: 3px;
  background: rgba(10, 10, 15, 0.95);
  border: 1.5px solid var(--neon-cyan);
  padding: 8px;
  border-radius: 8px;
  box-shadow: var(--glow-cyan-soft);
  backdrop-filter: blur(10px);
}

.dpad #up {
  grid-area: up;
}

.dpad #left {
  grid-area: left;
}

.dpad #right {
  grid-area: right;
}

.dpad #down {
  grid-area: down;
}

.dpad > button {
  background: rgba(0, 255, 255, 0.1);
  border: 1.5px solid var(--neon-cyan);
  border-radius: 6px;
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  padding: 0;
  transition: all 0.2s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 0 5px var(--neon-cyan);
}

.dpad > button svg {
  width: 20px;
  height: 20px;
  color: var(--neon-cyan);
  filter: drop-shadow(0 0 3px var(--neon-cyan));
  transition: all 0.2s ease;
}

.dpad > button:hover:not(:active) {
  background: rgba(0, 255, 255, 0.2);
  border-color: var(--neon-cyan-light);
  box-shadow: 0 0 15px var(--neon-cyan);
  transform: scale(1.05);
}

.dpad > button:active,
.dpad > button.active {
  background: rgba(0, 255, 255, 0.3);
  border-color: var(--neon-cyan-light);
  box-shadow: 0 0 20px var(--neon-cyan), inset 0 0 10px var(--neon-cyan);
  transform: scale(0.95);
}

.dpad > button:active svg,
.dpad > button.active svg {
  filter: drop-shadow(0 0 6px var(--neon-cyan));
  transform: scale(1.1);
}

/* Mobile optimizations */
/* Stack image upload columns on smaller screens */
@media screen and (max-width: 600px) {
  .image-master-reset-row {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 800px) {
  .dpad-wrapper {
    bottom: 12px;
    right: 12px;
  }

  .dpad > button {
    width: 45px;
    height: 45px;
  }

  .dpad > button svg {
    width: 20px;
    height: 20px;
  }

  .dpad {
    padding: 8px;
    gap: 3px;
  }
  
  .dpad-drag-handle {
    width: 45px;
    height: 24px;
    top: -24px;
    font-size: 12px;
  }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 255, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 255, 255, 0.4);
  box-shadow: 0 0 5px var(--neon-cyan);
}

