/* ============================================
   GRAPESJS NEWSLETTER EDITOR - EVENT PRO THEME
   Graphic charter: teal #044f60, Inter font
   ============================================ */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
  --editor-bg: #f1f5f9;
  --panel-bg: #ffffff;
  --border-color: #f1f1f4;
  --border-dark: #dbdfe9;
  --text-primary: #071437;
  --text-primary-dark: #071437;
  --text-secondary: #78829d;
  --hover-bg: #f9f9f9;
  --accent-color: #044f60;
  --accent-light: rgba(4, 79, 96, 0.08);
  --block-bg: #ffffff;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --radius-md: 8px;
  --radius-sm: 6px;
}

/* ============================================
   MAIN EDITOR CONTAINER
   ============================================ */
.gjs-editor {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  background: var(--editor-bg) !important;
}

/* ============================================
   TOP TOOLBAR
   ============================================ */
.gjs-pn-panels {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  height: 46px !important;
  background: #ffffff !important;
  border-bottom: 1px solid var(--border-dark) !important;
}

.gjs-pn-options,
.gjs-pn-views,
.gjs-pn-commands,
.gjs-pn-devices-c {
  background: transparent !important;
}

.gjs-pn-commands {
  box-shadow: none !important;
  padding: 0 !important;
  width: 100% !important;
}

.gjs-pn-buttons {
  display: flex !important;
  gap: 4px !important;
  padding: 8px 12px !important;
  align-items: center !important;
}

.gjs-pn-options {
  right: 0 !important;
}

.gjs-pn-btn {
  background: var(--panel-bg) !important;
  border: 1px solid var(--border-dark) !important;
  color: var(--text-secondary) !important;
  border-radius: var(--radius-sm) !important;
  padding: 6px !important;
  transition: all 0.15s ease !important;
  font-size: 14px !important;
  height: 30px !important;
  min-width: 30px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: none !important;
}

.gjs-pn-btn:hover {
  background: var(--hover-bg) !important;
  color: var(--text-primary) !important;
  border-color: #c4cada !important;
}

.gjs-pn-btn.gjs-pn-active {
  background: var(--accent-light) !important;
  border-color: var(--accent-color) !important;
  color: var(--accent-color) !important;
}

/* ============================================
   CANVAS AREA
   ============================================ */
.gjs-cv-canvas {
  background: var(--editor-bg) !important;
  padding: 30px !important;
  top: 46px !important;
  height: calc(100% - 46px) !important;
  width: calc(100% - 320px) !important;
}

.gjs-frame-wrapper {
  background: transparent !important;
  margin: 0 auto !important;
}

.gjs-frame {
  background: white !important;
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.06) !important;
  border-radius: 8px !important;
  border: none !important;
}

/* ============================================
   RIGHT SIDEBAR
   ============================================ */
.gjs-pn-views-container {
  background: var(--panel-bg) !important;
  border-left: 1px solid var(--border-dark) !important;
  width: 320px !important;
  right: 0 !important;
  left: auto !important;
  position: absolute !important;
  top: 47px !important;
  height: calc(100% - 47px) !important;
  box-shadow: none !important;
  padding-top: 0 !important;
}

.gjs-pn-views {
  display: none !important;
}

.gjs-blocks-c {
  background: var(--panel-bg) !important;
  padding: 0 !important;
  height: 100% !important;
  overflow-y: auto !important;
}

/* ============================================
   BLOCK CATEGORIES
   ============================================ */
.gjs-block-categories {
  background: #ffffff !important;
}

.gjs-block-category {
  background: transparent !important;
  margin-bottom: 0 !important;
  border-bottom: 1px solid var(--border-color) !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

.gjs-block-category .gjs-title {
  background: #f9f9f9 !important;
  color: var(--text-primary-dark) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  text-transform: none !important;
  border-bottom: 1px solid var(--border-color) !important;
  flex-direction: row-reverse;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 12px 16px !important;
  margin: 0 !important;
  font-family: 'Inter', sans-serif !important;
}

.gjs-block-category .gjs-title:hover {
  background: var(--hover-bg) !important;
}

.gjs-block-category .gjs-caret-icon {
  font-size: 11px !important;
  color: var(--text-secondary) !important;
  margin-right: -4px !important;
  margin-left: auto !important;
  transition: transform 0.2s ease !important;
  opacity: 0.7 !important;
}

.gjs-block-category.gjs-open .gjs-caret-icon {
  transform: rotate(90deg) !important;
}

.gjs-block-category .gjs-blocks-c {
  padding: 8px 12px 16px 12px !important;
  background: transparent !important;
  margin-top: 0 !important;
}

/* ============================================
   BLOCKS CARDS
   ============================================ */
.gjs-block {
  background: var(--block-bg) !important;
  border: 1px solid var(--border-dark) !important;
  border-radius: var(--radius-md) !important;
  padding: 12px 8px !important;
  margin: 4px !important;
  width: calc(50% - 8px) !important;
  min-height: 85px !important;
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.15s ease !important;
  cursor: grab !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
}

.gjs-block:hover {
  background: #ffffff !important;
  border-color: var(--accent-color) !important;
  box-shadow: var(--shadow-sm) !important;
  transform: translateY(-1px) !important;
}

.gjs-block:active {
  cursor: grabbing !important;
  transform: scale(0.98) translateY(0) !important;
}

/* ============================================
   BLOCK ICONS & MEDIA
   ============================================ */
.gjs-block-media {
  color: #99a1b7 !important;
  font-size: 24px !important;
  margin-bottom: 8px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
}

.gjs-block-media svg {
  width: 24px !important;
  height: 24px !important;
  color: inherit !important;
}

.gjs-block-media .fa {
  font-size: 20px !important;
  color: inherit !important;
}

.gjs-block-media img {
  max-width: 100% !important;
  max-height: 54px !important;
  border-radius: var(--radius-sm) !important;
  object-fit: contain !important;
  display: block !important;
  border: 1px solid var(--border-dark) !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

.gjs-block-label {
  color: var(--text-primary) !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  text-align: center !important;
  line-height: 1.2 !important;
  max-width: 100% !important;
  font-family: 'Inter', sans-serif !important;
}

.gjs-blocks-c > div {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-start !important;
}

/* ============================================
   STYLE MANAGER
   ============================================ */
.gjs-sm-sectors {
  background: var(--panel-bg) !important;
}

.gjs-sm-sector {
  background: var(--panel-bg) !important;
  border-bottom: 1px solid var(--border-color) !important;
}

.gjs-sm-sector-title {
  font-family: 'Inter', sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--text-primary) !important;
  background: #f9f9f9 !important;
  border-bottom: 1px solid var(--border-color) !important;
  padding: 10px 16px !important;
}

.gjs-sm-sector .gjs-sm-properties {
  padding: 8px 12px !important;
  background: var(--panel-bg) !important;
}

.gjs-sm-sector .gjs-sm-property {
  font-family: 'Inter', sans-serif !important;
}

.gjs-sm-label {
  font-size: 11px !important;
  color: var(--text-secondary) !important;
  font-weight: 500 !important;
}

/* ============================================
   SELECTOR MANAGER
   ============================================ */
.gjs-clm-tags {
  padding: 8px 12px !important;
  background: var(--panel-bg) !important;
}

.gjs-clm-tag {
  background: var(--accent-light) !important;
  color: var(--accent-color) !important;
  border-radius: 4px !important;
}

.gjs-clm-sels-ctn {
  background: var(--panel-bg) !important;
}

/* ============================================
   INPUT FIELDS
   ============================================ */
.gjs-field {
  background: var(--panel-bg) !important;
  border: 1px solid var(--border-dark) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text-primary) !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 12px !important;
  transition: border-color 0.15s ease !important;
}

.gjs-field:focus-within {
  border-color: var(--accent-color) !important;
  box-shadow: 0 0 0 2px rgba(4, 79, 96, 0.12) !important;
}

.gjs-field input,
.gjs-field select,
.gjs-field textarea {
  color: var(--text-primary) !important;
  font-family: 'Inter', sans-serif !important;
  background: transparent !important;
}

.gjs-field .gjs-sel-arrow {
  color: var(--text-secondary) !important;
}

.gjs-field-arrows {
  color: var(--text-secondary) !important;
}

/* ============================================
   LAYER MANAGER
   ============================================ */
.gjs-layers {
  background: var(--panel-bg) !important;
}

.gjs-layer {
  background: var(--panel-bg) !important;
  border-bottom: 1px solid var(--border-color) !important;
}

.gjs-layer-title {
  font-family: 'Inter', sans-serif !important;
  font-size: 12px !important;
  color: #4b5675 !important;
  background: var(--panel-bg) !important;
  padding: 8px 10px !important;
}

.gjs-layer-title:hover {
  background: var(--hover-bg) !important;
}

.gjs-layer.gjs-selected > .gjs-layer-title {
  color: var(--accent-color) !important;
  background: var(--accent-light) !important;
}

.gjs-layer-caret,
.gjs-layer-count,
.gjs-layer-vis {
  color: var(--text-secondary) !important;
}

/* ============================================
   TRAIT MANAGER
   ============================================ */
.gjs-trt-traits {
  padding: 8px 12px !important;
  background: var(--panel-bg) !important;
}

.gjs-trt-trait {
  font-family: 'Inter', sans-serif !important;
  padding: 6px 0 !important;
  border-bottom: 1px solid var(--border-color) !important;
}

.gjs-trt-trait .gjs-label {
  font-size: 11px !important;
  color: var(--text-secondary) !important;
  font-weight: 500 !important;
}

/* ============================================
   COMPONENT TOOLBAR (floating)
   ============================================ */
.gjs-toolbar {
  background: var(--accent-color) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-md) !important;
  padding: 2px 4px !important;
}

.gjs-toolbar-item {
  color: #ffffff !important;
  padding: 3px 5px !important;
  border-radius: 4px !important;
}

.gjs-toolbar-item:hover {
  background: rgba(255, 255, 255, 0.15) !important;
}

/* ============================================
   SELECTION & HIGHLIGHT
   ============================================ */
.gjs-selected {
  outline: 2px solid var(--accent-color) !important;
  outline-offset: -2px !important;
}

.gjs-hovered {
  outline: 1px dashed var(--accent-color) !important;
  outline-offset: -1px !important;
}

.gjs-badge {
  background: var(--accent-color) !important;
  color: #ffffff !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 10px !important;
  border-radius: 3px !important;
  padding: 2px 6px !important;
}

.gjs-ghost {
  background: var(--accent-light) !important;
  border: 2px dashed var(--accent-color) !important;
}

.gjs-placeholder {
  border-color: var(--accent-color) !important;
}

/* ============================================
   RTE (Rich Text Editor toolbar)
   ============================================ */
.gjs-rte-toolbar {
  background: #ffffff !important;
  border: 1px solid var(--border-dark) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-md) !important;
  padding: 2px !important;
}

.gjs-rte-action {
  color: #4b5675 !important;
  border-radius: 4px !important;
}

.gjs-rte-action:hover {
  background: var(--hover-bg) !important;
  color: var(--accent-color) !important;
}

.gjs-rte-active {
  background: var(--accent-light) !important;
  color: var(--accent-color) !important;
}

/* ============================================
   EMPTY CANVAS PLACEHOLDER
   ============================================ */
.gjs-dashed > div::before,
.gjs-cv-canvas__frames > div[data-gjs-type="wrapper"]:empty::before {
  content: "Drag components here" !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  color: var(--text-secondary) !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  font-family: 'Inter', sans-serif !important;
  display: block !important;
  text-align: center !important;
  pointer-events: none !important;
  z-index: 1 !important;
  margin-top: 24px !important;
}

/* ============================================
   SCROLLBARS
   ============================================ */
.gjs-editor ::-webkit-scrollbar {
  width: 6px !important;
  height: 6px !important;
}

.gjs-editor ::-webkit-scrollbar-track {
  background: transparent !important;
}

.gjs-editor ::-webkit-scrollbar-thumb {
  background: #cecece !important;
  border-radius: 3px !important;
}

.gjs-editor ::-webkit-scrollbar-thumb:hover {
  background: #b0b0b0 !important;
}

/* ============================================
   MODAL (import/export code)
   ============================================ */
.gjs-mdl-dialog {
  border-radius: var(--radius-md) !important;
  font-family: 'Inter', sans-serif !important;
}

.gjs-mdl-header {
  background: var(--panel-bg) !important;
  border-bottom: 1px solid var(--border-dark) !important;
  color: var(--text-primary) !important;
  font-family: 'Inter', sans-serif !important;
}

.gjs-mdl-title {
  font-weight: 600 !important;
}

.gjs-mdl-content {
  background: var(--panel-bg) !important;
}

.gjs-mdl-btn-import {
  background: var(--accent-color) !important;
  color: #ffffff !important;
  border-radius: var(--radius-sm) !important;
  border: none !important;
  font-family: 'Inter', sans-serif !important;
  font-weight: 500 !important;
  padding: 8px 16px !important;
}

.gjs-mdl-btn-import:hover {
  opacity: 0.9 !important;
}
