/* ================================================================
   liquid-glass-v5.css — Integration & Polish
   - Page content premium (no plano).
   - Emojis sin círculos pesados por defecto, con lift 3D.
   - Selects/dropdowns arreglados (bg + chevron separados).
   - Workspace menu V5 polish.
   - Coherencia visual completa.
   ================================================================ */

/* ================================================================
   TOKENS V5 — extiende V4
   ================================================================ */
html[data-visual="liquid-glass"] {
  --lgv5-content-surface: rgba(255,255,255,0.42);
  --lgv5-content-edge: rgba(255,255,255,0.85);
  --lgv5-block-hover: rgba(255,255,255,0.55);
  --lgv5-page-radius: 22px;
  --lgv5-card-radius: 14px;
  --lgv5-block-radius: 10px;
  --lgv5-content-shadow: 0 1px 2px rgba(20,20,30,0.04),
                        0 8px 24px rgba(20,20,30,0.06);
}

html[data-visual="liquid-glass"][data-theme="dark"] {
  --lgv5-content-surface: rgba(255,255,255,0.045);
  --lgv5-content-edge: rgba(255,255,255,0.16);
  --lgv5-block-hover: rgba(255,255,255,0.06);
  --lgv5-content-shadow: 0 1px 2px rgba(0,0,0,0.40),
                        0 8px 28px rgba(0,0,0,0.55);
}

/* ================================================================
   PAGE CONTENT V5 — premium, con profundidad
   ================================================================ */

/* Page wrapper / container con surface sutil */
html[data-visual="liquid-glass"] .editor-content,
html[data-visual="liquid-glass"] .page-wrap {
  position: relative;
}

/* Page header con cápsula premium (cover + título + iconos) */
html[data-visual="liquid-glass"] .page-header {
  padding-top: 24px !important;
  padding-bottom: 18px !important;
}

@media (min-width: 1024px) {
  html[data-visual="liquid-glass"] .page-header {
    padding-top: 32px !important;
    padding-bottom: 24px !important;
  }
  html[data-visual="liquid-glass"] #page-title {
    font-size: 42px !important;
    font-weight: 700 !important;
    letter-spacing: -0.02em !important;
    line-height: 1.1 !important;
  }
}

/* Cover area con glass overlay sutil cuando hay portada */
html[data-visual="liquid-glass"] .page-cover {
  border-radius: var(--lgv5-page-radius);
  margin: 8px 16px 0;
}

/* Headings con jerarquía premium */
html[data-visual="liquid-glass"] .editor-blocks h1,
html[data-visual="liquid-glass"] .editor-blocks h2,
html[data-visual="liquid-glass"] .editor-blocks h3,
html[data-visual="liquid-glass"] .editable[data-type="h1"] .editable-content,
html[data-visual="liquid-glass"] .editable[data-type="h2"] .editable-content,
html[data-visual="liquid-glass"] .editable[data-type="h3"] .editable-content {
  letter-spacing: -0.018em;
}

/* Bloques con hover sutil, no plano */
html[data-visual="liquid-glass"] .editor-blocks .block:hover .block-row {
  background: var(--lgv5-block-hover);
  border-radius: var(--lgv5-block-radius);
}

/* Callouts/quotes/code/widgets: glass card */
html[data-visual="liquid-glass"] .block-callout,
html[data-visual="liquid-glass"] .block-quote,
html[data-visual="liquid-glass"] .block-code-wrap,
html[data-visual="liquid-glass"] .block-database,
html[data-visual="liquid-glass"] .block-chart-wrap,
html[data-visual="liquid-glass"] .block-progress,
html[data-visual="liquid-glass"] .block-habit,
html[data-visual="liquid-glass"] .block-mood,
html[data-visual="liquid-glass"] .block-pomodoro,
html[data-visual="liquid-glass"] .block-water,
html[data-visual="liquid-glass"] .block-rating,
html[data-visual="liquid-glass"] .block-kanban-mini,
html[data-visual="liquid-glass"] .block-countdown,
html[data-visual="liquid-glass"] .block-stat,
html[data-visual="liquid-glass"] .block-pricing,
html[data-visual="liquid-glass"] .block-testimonial,
html[data-visual="liquid-glass"] .block-toggle-content,
html[data-visual="liquid-glass"] .block-savings,
html[data-visual="liquid-glass"] .block-weight,
html[data-visual="liquid-glass"] .block-sleep,
html[data-visual="liquid-glass"] .block-reading,
html[data-visual="liquid-glass"] .block-workout,
html[data-visual="liquid-glass"] .block-meditation,
html[data-visual="liquid-glass"] .block-gratitude,
html[data-visual="liquid-glass"] .block-goal-tree,
html[data-visual="liquid-glass"] .block-mini-counter,
html[data-visual="liquid-glass"] .block-daily-goal,
html[data-visual="liquid-glass"] .block-daily-checklist,
html[data-visual="liquid-glass"] .block-tag-cloud {
  background: var(--lgv5-content-surface) !important;
  border: 1px solid var(--lgv5-content-edge) !important;
  border-radius: var(--lgv5-card-radius) !important;
  box-shadow:
    inset 0 1px 0 var(--lgv5-content-edge),
    var(--lgv5-content-shadow) !important;
  padding: 14px 16px;
}

/* Database controls (vista, filtros) */
html[data-visual="liquid-glass"] .db-toolbar,
html[data-visual="liquid-glass"] .db-tabs,
html[data-visual="liquid-glass"] .db-filter,
html[data-visual="liquid-glass"] .db-sort {
  background: var(--lgv4-glass-frost, var(--lgv5-content-surface)) !important;
  border: 1px solid var(--lgv5-content-edge) !important;
  border-radius: 12px !important;
  padding: 6px 10px;
}

/* ================================================================
   FIX SELECT V5 — separar bg color y bg image (chevron)
   ================================================================ */
html[data-visual="liquid-glass"] select {
  /* override V4 que rompía el background */
  background-color: var(--lgv4-glass-clear, rgba(255,255,255,0.78)) !important;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text) 50%),
    linear-gradient(135deg, var(--text) 50%, transparent 50%) !important;
  background-position:
    calc(100% - 14px) 50%,
    calc(100% - 9px) 50% !important;
  background-size: 5px 5px, 5px 5px !important;
  background-repeat: no-repeat !important;
  color: var(--text) !important;
  border: 1px solid var(--lgv4-edge-light, rgba(255,255,255,0.95)) !important;
  border-radius: 10px !important;
  padding: 8px 32px 8px 12px !important;
  font-size: 13.5px !important;
  min-width: 140px;
  cursor: pointer;
  transition: border-color 160ms cubic-bezier(.16,1,.3,1),
              box-shadow 160ms cubic-bezier(.16,1,.3,1),
              transform 120ms cubic-bezier(.34,1.56,.64,1);
  box-shadow:
    inset 0 1px 0 var(--lgv4-edge-light, rgba(255,255,255,0.95)),
    inset 0 -1px 0 var(--lgv4-edge-shadow, rgba(20,20,30,0.10)),
    0 1px 2px rgba(0,0,0,0.04),
    0 4px 10px rgba(0,0,0,0.05) !important;
}
html[data-visual="liquid-glass"] select:hover {
  transform: translateY(-1px);
  border-color: rgba(0,0,0,0.18) !important;
  box-shadow:
    inset 0 1px 0 var(--lgv4-edge-light, rgba(255,255,255,0.95)),
    0 4px 12px rgba(0,0,0,0.10),
    0 8px 24px rgba(0,0,0,0.06) !important;
}
html[data-visual="liquid-glass"] select:focus {
  outline: none;
  border-color: var(--text) !important;
  box-shadow:
    inset 0 1px 0 var(--lgv4-edge-light, rgba(255,255,255,0.95)),
    0 0 0 3px color-mix(in srgb, var(--text) 12%, transparent) !important;
}

html[data-visual="liquid-glass"][data-theme="dark"] select {
  background-color: rgba(255,255,255,0.085) !important;
}
html[data-visual="liquid-glass"][data-theme="dark"] select option {
  background: #1a1a1c !important;
  color: var(--text) !important;
}

/* ================================================================
   WORKSPACE MENU V5 — más visible y premium
   ================================================================ */
html[data-visual="liquid-glass"] #workspace-menu {
  z-index: 10001 !important;
  border-radius: 16px !important;
  padding: 8px !important;
  min-width: 280px;
  background: var(--lgv4-glass-clear, rgba(255,255,255,0.85)) !important;
  border: 1px solid var(--lgv4-edge-light, rgba(255,255,255,0.95)) !important;
  box-shadow:
    inset 0 1.5px 0 var(--lgv4-edge-light, rgba(255,255,255,0.95)),
    inset 0 -1px 0 var(--lgv4-edge-shadow, rgba(20,20,30,0.10)),
    var(--lgv4-neutral-shadow, 0 12px 40px rgba(20,20,30,0.12)) !important;
}
html[data-visual="liquid-glass"] #workspace-menu .wm-item {
  padding: 9px 12px !important;
  border-radius: 10px !important;
  transition: background 160ms cubic-bezier(.16,1,.3,1),
              transform 120ms cubic-bezier(.34,1.56,.64,1);
}
html[data-visual="liquid-glass"] #workspace-menu .wm-item:hover {
  background: var(--lgv4-glass-frost, rgba(255,255,255,0.62)) !important;
  transform: translateX(1px);
}
html[data-visual="liquid-glass"] #workspace-menu .wm-divider {
  background: var(--lgv4-edge-shadow, rgba(20,20,30,0.10)) !important;
  height: 1px;
  margin: 6px 0;
}

/* ================================================================
   TOPBAR ACTION BUTTONS V5
   ================================================================ */
html[data-visual="liquid-glass"] .topbar-actions button.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}
@media (min-width: 1024px) {
  html[data-visual="liquid-glass"] .topbar-actions button.icon-btn {
    width: 36px;
    height: 36px;
  }
}

/* ================================================================
   DATABASE TABLE V5
   ================================================================ */
html[data-visual="liquid-glass"] .db-table {
  background: var(--lgv5-content-surface) !important;
  border: 1px solid var(--lgv5-content-edge) !important;
  border-radius: var(--lgv5-card-radius) !important;
  overflow: hidden;
  box-shadow: var(--lgv5-content-shadow) !important;
}
html[data-visual="liquid-glass"] .db-table th {
  background: var(--lgv4-glass-frost, rgba(255,255,255,0.62)) !important;
  border-bottom: 1px solid var(--lgv4-edge-light, rgba(255,255,255,0.95)) !important;
}

/* ================================================================
   MOTION V5
   ================================================================ */
@keyframes lgv5-pop {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
html[data-visual="liquid-glass"] #workspace-menu:not(.hidden),
html[data-visual="liquid-glass"] #context-menu:not(.hidden),
html[data-visual="liquid-glass"] #slash-menu:not(.hidden) {
  animation: lgv5-pop 220ms cubic-bezier(.16,1,.3,1) both;
}

@media (prefers-reduced-motion: reduce) {
  html[data-visual="liquid-glass"] * {
    animation-duration: 1ms !important;
    transition-duration: 1ms !important;
  }
}
