/* =====================================================
   OyeTools - Multi-Layer Responsive Canvas Styles
   ===================================================== */

/* Reset Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #000000;
  background: #ffffff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  text-align: center;
  padding: 2.5rem 1rem;
  background: #ffffff;
  border-bottom: 1px solid #f0f0f0;
  box-shadow: 0 2px 15px rgba(0,0,0,0.05);
  position: relative;
}

.lang-switcher {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.lang-switcher select {
  padding: 0.4rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
}

h1 {
  font-size: 2.4rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.5px;
}

header p {
  font-size: 1.1rem;
  color: #555555;
}

/* Core Central Container Flow System */
main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

#upload-section {
  width: 100%;
  max-width: 500px;
}

.drop-area {
  border: 3px dashed #cccccc;
  border-radius: 16px;
  padding: 5rem 2rem;
  text-align: center;
  background: #ffffff;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.drop-area:hover, .drop-area.dragover {
  border-color: #4a90e2;
  background: #fafafa;
}

.drop-area i {
  font-size: 3.5rem;
  color: #4a90e2;
  margin-bottom: 1.5rem;
}

.drop-area p {
  font-size: 1.2rem;
  font-weight: 600;
}

#file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Center Column Editor Core System Layout (Matches Circle Crop Image Interface) */
#editor-section {
  width: 100%;
  max-width: 700px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.image-container {
  position: relative;
  background: #fdfdfd;
  border: 1px dashed #dee2e6;
  border-radius: 12px;
  padding: 0.5rem;
  box-shadow: 0 4px 25px rgba(0,0,0,0.04);
  max-width: 100%;
  max-height: 500px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
}

#base-img {
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

#layers-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Blocks container events layer mapping overlapping */
}

/* Watermark Frame Configuration (100% Transparent till selected) */
.watermark-layer {
  position: absolute;
  cursor: move;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  background: transparent;
  border: 1.5px solid transparent;
  pointer-events: auto; /* Re-enables layer mouse interactivity */
}

/* Becomes fully active highlighted box frame with selectors when user clicks it */
.watermark-layer.active-selected {
  border-color: #4a90e2;
}

.content-render-box {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.wm-text-render {
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
  text-align: center;
  width: 100%;
}

.wm-img-render {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

/* Top Rotation Anchor Stick Extensions line link */
.rotation-line-hook {
  position: absolute;
  top: -26px;
  left: calc(50% - 0.75px);
  width: 1.5px;
  height: 26px;
  background-color: #4a90e2;
  pointer-events: none;
  display: none;
}

/* 8 Axis Selector Nodes Anchors (Blue Round Dots) */
.handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background-color: #4a90e2;
  border: 1.5px solid #ffffff;
  border-radius: 50%;
  z-index: 60;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  display: none; /* Hidden until layer is selected */
}

/* Floating Corner Custom Delete Option (X Inside Circle) */
.delete-btn-handle {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 22px;
  height: 22px;
  background-color: #ff4d4d;
  color: white;
  border: 1.5px solid #ffffff;
  border-radius: 50%;
  display: none; /* Only show on active selection */
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  z-index: 70;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  transition: transform 0.1s ease;
}

.delete-btn-handle:hover {
  transform: scale(1.15);
  background-color: #e03e3e;
}

/* Show all active controls handles nodes only on active selection */
.watermark-layer.active-selected .handle,
.watermark-layer.active-selected .rotation-line-hook,
.watermark-layer.active-selected .delete-btn-handle {
  display: flex;
}

.rotation-handle { top: -32px; left: calc(50% - 6px); cursor: grab; }
.tl { top: -6px; left: -6px; cursor: nwse-resize; }
.tc { top: -6px; left: calc(50% - 6px); cursor: ns-resize; }
.tr { top: -6px; right: -6px; cursor: nesw-resize; }
.ml { top: calc(50% - 6px); left: -6px; cursor: ew-resize; }
.mr { top: calc(50% - 6px); right: -6px; cursor: ew-resize; }
.bl { bottom: -6px; left: -6px; cursor: nesw-resize; }
.bc { bottom: -6px; left: calc(50% - 6px); cursor: ns-resize; }
.br { bottom: -6px; right: -6px; cursor: nwse-resize; }

/* Dashboard Control Panel Styles */
.zoom-slider-wrapper {
  width: 100%;
  background: #ffffff;
  padding: 1.25rem;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  border: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.btn-group-wrapper {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

.btn-outline-dark {
  border-radius: 8px !important;
  padding: 0.65rem 1rem !important;
  font-weight: 600 !important;
  flex: 1;
}

.btn-outline-dark:hover {
  background-color: #f8f9fa !important;
  color: #000000 !important;
}

.zoom-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #222222;
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.zoom-label span:last-child {
  color: #4a90e2;
  font-weight: 700;
}

.zoom-slider {
  width: 100%;
  height: 6px;
  border-radius: 5px;
  outline: none;
  -accent-color: #4a90e2;
}

.subgroup-box {
  border-top: 1px solid #f5f5f5;
  padding-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-control, .form-select {
  padding: 0.55rem 0.75rem;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  font-size: 0.95rem;
}

.btn-outline-secondary.active {
  background-color: #6c757d !important;
  color: white !important;
}

/* Primary Action Buttons */
#download-btn {
  background: linear-gradient(135deg, #4a90e2, #357abd);
  color: #ffffff;
  border: none;
  padding: 1rem 2.5rem;
  border-radius: 8px;
  font-size: 1.15rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(74,144,226,0.3);
}

#download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(74,144,226,0.4);
}

/* SEO Panels Content */
.seo-section {
  padding: 3rem 1rem;
  border-top: 1px solid #f5f5f5;
}

@media (min-width: 769px) {
  .seo-section { max-width: 60%; margin: 0 auto; }
}

.seo-section h2 { font-size: 2rem; font-weight: 700; margin-bottom: 1rem; text-align: center; }
.seo-section p { font-size: 1.05rem; color: #333333; line-height: 1.7; text-align: justify; }

/* Footers Panel */
footer {
  border-top: 1px solid #eeeeee;
  padding: 2.5rem 1rem;
  text-align: center;
  margin-top: auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.footer-links a { color: #4a90e2; text-decoration: none; font-weight: 500; }
.copyright { color: #777777; font-size: 0.9rem; }

/* Mobile Adaptation Settings */
@media (max-width: 576px) {
  h1 { font-size: 1.8rem; }
  main { padding: 1.5rem 0.5rem; }
  .image-container { max-height: 400px; }
  #base-img { max-height: 380px; }
  .btn-outline-dark { padding: 0.5rem !important; font-size: 0.85rem; }
}