/*!
 * omalovanka.css
 * Štýly pre omaľovánku - PDF A4 export + WOW gradient/color picker + 54 farieb
 */

/* ===== Base Layout ===== */

/* Zakázať dark/night mode v Samsung Browser a iných mobilných prehliadačoch */
:root {
  color-scheme: only light;
}

#container {
  position: relative;
  width: 750px;
  height: 750px;
  max-width: 100%;
  background: white;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
}

#canvasLayer, #svgLayer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
#canvasLayer { z-index: 1; }
#svgLayer { z-index: 2; pointer-events: none; }



/* ===== Buttons ===== */
button {
  padding: 10px 20px;
  margin: 5px;
  cursor: pointer;
  border: none;
  border-radius: 8px;
  background: #4CAF50;
  color: white;
  font-size: 14px;
  font-weight: 700;
}
button:hover { background: #45a049; }
button.secondary { background: #2196F3; }
button.secondary:hover { background: #1e88e5; }



#undoBtn, #redoBtn, #clearBtn, #zoomDisplay, #zoomOutBtn, #zoomInBtn, #downloadCleanBtn, #downloadColoredBtn, #downloadDedicationBtn, #venovanie, #shareImageBtn, #shareTextBtn, #sendEmailBtn, #sendToFriendBtn {
      user-select: none;
}
#downloadDedicationBtn {
      cursor: pointer;
}




/* ===== Color Picker ===== */
.color-picker { margin: 0; }

.color-picker--buttons {
  position: relative;
}

.color-picker--palette {
  height: auto;
}

/* Paleta je prázdna v Elementor editore (JS nebeží) —
   min-height zabraňuje zrúteniu kontajnera na výšku 0 */
#basePalette.palette-grid {
  align-content: start;
}

/* ===== Color Btn Row ===== */
.color-btn-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.color-btn {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 2px solid #333;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  box-sizing: border-box;
  font-family: var(--e-global-typography-text-font-family), Sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,1), 0 0 3px rgba(0,0,0,1);
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
}
.color-btn.active {
  border: 3px solid #000;
  box-shadow: 0 0 10px rgba(0,0,0,0.35);
}

/* ===== 54 farieb: grid 9 v riadku ===== */
#basePalette.palette-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 8px;
  margin: 0;
  align-items: center;
}
#basePalette .color-btn {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  margin: 0;
  border-radius: 8px;
}

/* ===== WOW panels (shared) ===== */
.panel {
  position: absolute;
  z-index: 1000;
  margin-top: 6px;
  padding: 10px;
  border: 1px solid #000;
  border-radius: 10px;
  background: #fff;
  max-width: 720px;
  width: 100%;
  overflow: visible;
  font-family: var(--e-global-typography-text-font-family), Sans-serif;
}
.panel .row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.panel .row.row-sm {
  margin: 10px 0;
}

.panel .rowhead {
  display: flex;
  align-items: center;
  gap: 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #000;
}
.panel .rowhead h3 {
  margin: 0;
  font-size: 20px;
  width: 50%;
  word-break: break-word;
  white-space: normal;
}
.panel .rowhead .preview-box {
  flex: none;
  width: 50%;
  margin: 0;
}

@media (max-width: 768px) {
  .panel .rowhead .preview-box {
    height: 40px;
  }
}



.preview-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.preview-box {
  width: 100%;
  height: 45px;
  border-radius: 8px;
  border: 1px solid #333;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  position: relative;
  overflow: hidden;
  background: #ff00ff;
  cursor: pointer;
}
.preview-box::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.20), transparent 38%),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,0.10), transparent 45%);
  pointer-events: none;
}

/* ===== Toggle Switch ===== */
.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: #222;
  user-select: none;
}
.switch {
  position: relative;
  width: 54px;
  height: 30px;
  border-radius: 999px;
  background: #d6d6d6;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12);
}
.switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  transition: transform 160ms ease;
}
.switch.on { background: #4CAF50; }
.switch.on::after { transform: translateX(24px); }
.toggle small { font-weight: 700; color: #555; }

/* ===== Panel close button ===== */
.panel .panel-close,
button.panel-close {
  background: #fff;
  border: 1px solid #000;
  border-radius: 50%;
  color: #000;
  font-size: 16px;
  line-height: 0;
  width: 25px;
  height: 25px;
  padding: 0 !important;
  margin: 0 !important;
  cursor: pointer;
  position: absolute;
  top: -13px;
  right: -13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.panel .panel-close:hover,
.panel .panel-close:focus,
button.panel-close:hover,
button.panel-close:focus {
  background: #fff !important;
  color: #2196F3 !important;
  opacity: 1 !important;
}

/* ===== Angle display next to slider ===== */
.angle-display {
  font-size: 14px;
  font-weight: 700;
  color: #333;
  white-space: nowrap;
  min-width: 40px;
}

/* ===== Color inputs ===== */
input[type="color"] {
  width: 88px;
  height: 38px;
  cursor: pointer;
}

@media (max-width: 768px) {
  input[type="color"] {
    width: 60px;
  }
}
a.save-fav-link {
  font-size: 15px;
  font-weight: 700;
  color: #333;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
a.save-fav-link:has(.fav-limit-msg) {
  white-space: normal;
  word-break: break-word;
  pointer-events: none;
}
a.save-fav-link:hover { color: #2196F3; }
a.save-fav-link.is-saved { color: #f5a623; }
a.save-fav-link.is-saved:hover { color: #f5a623; cursor: default; }

/* ===== Clear favorites link ===== */
.clear-fav-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
a.clear-fav-link {
  font-size: 13px;
  color: #888;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
a.clear-fav-link .cfav-icon {
  display: inline-block;
  text-decoration: none;
  flex-shrink: 0;
  font-variant-emoji: text;
}
a.clear-fav-link .cfav-text {
  text-decoration: underline;
  text-underline-offset: 2px;
}
a.clear-fav-link:hover { color: #e00; }
.clear-fav-confirm {
  font-size: 13px;
  color: #333;
}
.clear-fav-confirm a {
  color: #333;
  text-decoration: underline;
  cursor: pointer;
}
.clear-fav-confirm a:first-of-type:hover { color: #e00; }
.clear-fav-confirm a:last-of-type:hover { color: #2196F3; }

/* ===== Favorites ===== */
.fav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding-top: 10px;
  border-top: 1px solid #000;
}
.fav-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}

.fav-swatch, .fav-color {
  width: 100%;
  height: 42px;
  border-radius: 8px;
  border: 1px solid #000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.fav-swatch:hover, .fav-color:hover { transform: translateY(-1px); }
.fav-swatch .del, .fav-color .del {
  position: absolute;
  top: 0px;
  right: 0px;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  border: none;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 10px;
  padding: 0;
  cursor: pointer;
}
.fav-swatch .del:hover, .fav-color .del:hover {
  background: rgba(0,0,0,1);
}
.fav-swatch .badge, .fav-color .badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  background: rgba(255,255,255,0.65);
  color: #000;
  font-size: 8px;
  font-weight: 400;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid rgba(0,0,0,0.12);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== Presets ===== */
.preset-wrap {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}
.preset-wrap .preset-btn,
button.preset-btn {
  width: 100%;
  padding: 6px 0;
  border-radius: 8px;
  background: #fff;
  color: #000;
  font-weight: 500;
  font-size: 12px;
  border: 1px solid #000;
  cursor: pointer;
  margin: 0;
  text-align: center;
}
.preset-wrap .preset-btn:hover,
button.preset-btn:hover {
  color: #000;
  background: #dddddd;
}
.preset-wrap .preset-btn:active,
button.preset-btn:active { background: #e20074; }


/* ===== Venovanie Box ===== */
#dedicationText {
  width: 100%;
  box-sizing: border-box;
  min-height: 60px;
  resize: none;
  border-radius: 5px;
  border: 1px solid #ddd;
  padding: 10px;
  font-size: 14px;
  font-family: var(--e-global-typography-text-font-family), Sans-serif;
  outline: none;
}
#dedicationText::placeholder {
  font-family: var(--e-global-typography-text-font-family), Sans-serif;
}
#dedicationText:focus {
  border-color: #2196F3;
  box-shadow: 0 0 0 3px rgba(33,150,243,0.15);
}

/* ===== Elementor Undo/Redo/Clear ===== */
#undoBtn.is-disabled,
#redoBtn.is-disabled {
  opacity: 0.4 !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
}

#undoBtn:not(.is-disabled),
#redoBtn:not(.is-disabled),
#clearBtn {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

#undoBtn:not(.is-disabled):hover,
#redoBtn:not(.is-disabled):hover,
#clearBtn:hover {
  opacity: 0.8;
}



/* ===== Tablet + Mobile Layout ===== */
@media (max-width: 1024px) {
  #basePalette.palette-grid {
    gap: 6px;
  }
}

/* ===== Mobile Layout ===== */
@media (max-width: 768px) {
  #container {
    width: 100vw;
    height: 100vw;
    max-width: 100vw;
    max-height: 100vw;
    margin-left: 0px;
    margin-right: 0px;
    border-radius: 0;
  }
  .color-picker { height: auto; }
  .color-picker--buttons { height: auto; }
  .color-picker--palette { height: auto; }
  .color-btn-row { gap: 6px; }

  #basePalette.palette-grid {
    min-height: calc(7 * (100vw - 8 * 12px) / 9 + 6 * 6px + 10px);
  }

  .fav-swatch .badge,
  .fav-color .badge {
    font-size: 8px;
  }
}

/* ─── Limit obľúbených ──────────────────────────────────────────────────── */
.fav-limit-msg {
  color: #e05;
  font-size: 0.82em;
  font-style: italic;
  opacity: 0.85;
  white-space: normal;
  word-break: break-word;
  display: inline-block;
}

/* ─── Podporte nás button ───────────────────────────────────────────────── */
.color-btn--support {
  background: #fff;
  color: #333;
  text-shadow: none;
  cursor: pointer;
}
.color-btn--support-icon {
  margin-right: 4px;
}

/* ─── Gradient + vlastná farba – predvolené pozadie ─────────────────────── */
#customGradientBtn {
  background: linear-gradient(90deg, #177578 0%, #941877 100%);
}
#customColorBtn {
  background: #ff00ff;
}
