/* ============================================
   UBANTU FOUNDATION — VISUAL EDITOR STYLES
   ============================================ */

/* ===== EDITOR TOOLBAR (top bar) ===== */
#ub-editor-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: #1a1a2e;
  border-bottom: 2px solid #B5563E;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 99999;
  font-family: 'Outfit', sans-serif;
  box-shadow: 0 2px 16px rgba(0,0,0,0.3);
}

.ub-bar-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.ub-logo {
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.ub-bar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ===== TOGGLE SWITCH ===== */
.ub-toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
}
.ub-toggle-wrap input { display: none; }
.ub-toggle-track {
  width: 44px;
  height: 24px;
  background: #444;
  border-radius: 50px;
  position: relative;
  transition: background 0.3s;
}
.ub-toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
}
.ub-toggle-wrap input:checked ~ .ub-toggle-track { background: #B5563E; }
.ub-toggle-wrap input:checked ~ .ub-toggle-track .ub-toggle-thumb { transform: translateX(20px); }
.ub-toggle-label {
  color: rgba(255,255,255,0.75);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
}

/* ===== BUTTONS ===== */
.ub-btn {
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.ub-btn-primary {
  background: #B5563E;
  color: #fff;
}
.ub-btn-primary:hover { background: #8B3A26; transform: translateY(-1px); }
.ub-btn-ghost {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.15);
}
.ub-btn-ghost:hover { background: rgba(255,255,255,0.15); }
.ub-btn-danger {
  background: rgba(220,53,69,0.15);
  color: #ff6b7a;
  border: 1px solid rgba(220,53,69,0.3);
}
.ub-btn-danger:hover { background: rgba(220,53,69,0.3); }
.ub-full { width: 100%; text-align: center; padding: 0.65rem; font-size: 0.88rem; margin-top: 0.5rem; }

/* ===== EDITABLE ELEMENT HIGHLIGHTS ===== */
.ub-edit-active .ub-editable {
  outline: 2px dashed rgba(181,86,62,0.4);
  outline-offset: 3px;
  cursor: pointer !important;
  transition: outline 0.2s;
  border-radius: 3px;
}
.ub-edit-active .ub-editable:hover {
  outline: 2px solid #B5563E;
  background: rgba(181,86,62,0.06);
}
.ub-edit-active .ub-selected {
  outline: 2px solid #B5563E !important;
  background: rgba(181,86,62,0.1) !important;
}

/* ===== FLOATING EDITOR PANEL ===== */
#ub-panel {
  position: fixed;
  top: 72px;
  right: -340px;
  width: 320px;
  max-height: calc(100vh - 80px);
  background: #fff;
  border-radius: 12px 0 0 12px;
  box-shadow: -4px 0 32px rgba(0,0,0,0.15);
  z-index: 99998;
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Outfit', sans-serif;
  overflow: hidden;
  border: 1px solid #e8d5c4;
  border-right: none;
}
#ub-panel.open { right: 0; }

.ub-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: #1a1a2e;
  color: #fff;
  flex-shrink: 0;
}
#ub-panel-title {
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
}
.ub-panel-close {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.ub-panel-close:hover { background: #B5563E; }

.ub-panel-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
}

/* ===== PANEL FIELDS ===== */
.ub-field {
  margin-bottom: 1.1rem;
}
.ub-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #3D2B1F;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.4rem;
}
.ub-field code {
  background: #f2e6d9;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
  color: #B5563E;
}
.ub-field input[type="text"],
.ub-field input[type="number"],
.ub-field textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 2px solid #e8d5c4;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  color: #2C1A0E;
  background: #fdfaf7;
  transition: border-color 0.2s;
  resize: vertical;
}
.ub-field input:focus,
.ub-field textarea:focus {
  outline: none;
  border-color: #B5563E;
  box-shadow: 0 0 0 3px rgba(181,86,62,0.12);
}
.ub-field input[type="color"] {
  width: 40px; height: 36px;
  border: 2px solid #e8d5c4;
  border-radius: 8px;
  cursor: pointer;
  padding: 2px;
  background: #fdfaf7;
}
.ub-field input[type="range"] {
  flex: 1;
  accent-color: #B5563E;
}
.ub-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.ub-row span {
  font-size: 0.8rem;
  color: #7A6055;
  min-width: 36px;
}

/* ALIGN BUTTONS */
.ub-align-btns {
  display: flex;
  gap: 0.4rem;
}
.ub-align-btn {
  flex: 1;
  padding: 0.4rem;
  border: 2px solid #e8d5c4;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #7A6055;
  background: #fdfaf7;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Outfit', sans-serif;
}
.ub-align-btn:hover {
  border-color: #B5563E;
  color: #B5563E;
  background: #f2e6d9;
}

/* QUICK IMAGE PICKS */
.ub-quick-imgs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}
.ub-quick-imgs img {
  width: 100%;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}
.ub-quick-imgs img:hover {
  border-color: #B5563E;
  transform: scale(1.04);
}

/* HINT TEXT */
.ub-hint {
  color: #7A6055;
  font-size: 0.85rem;
  text-align: center;
  padding: 1.5rem 0;
  line-height: 1.6;
}

/* ===== TOAST NOTIFICATION ===== */
#ub-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a1a2e;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 999999;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  pointer-events: none;
}
#ub-toast.ub-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#ub-toast.ub-toast-warn {
  background: #B5563E;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  #ub-editor-bar { padding: 0 0.75rem; }
  .ub-logo { display: none; }
  #ub-panel { width: 290px; }
  .ub-btn-ghost { display: none; }
}