/* ==========================================================================
   TAMQEEN ADVISORY - CMS & Visual Live Builder Styles
   ========================================================================== */

:root {
  --knt-cms-navy: #091E36;
  --knt-cms-navy-panel: #102C4E;
  --knt-cms-sky: #0095D9;
  --knt-cms-sky-light: #38BDF8;
  --knt-cms-gold: #D97706;
  --knt-cms-gold-light: #FBBF24;
  --knt-cms-text: #F8FAFC;
  --knt-cms-muted: #CBD5E1;
  --knt-cms-border: rgba(255, 255, 255, 0.14);
  --knt-cms-danger: #EF4444;
  --knt-cms-success: #10B981;
  --knt-admin-bar-height: 48px;
}

/* ==========================================================================
   1. FLOATING TOP ADMIN BAR
   ========================================================================== */
#knt-admin-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--knt-admin-bar-height);
  background: rgba(9, 30, 54, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--knt-cms-sky);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-family: 'Cairo', 'Tajawal', sans-serif;
  color: var(--knt-cms-text);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  direction: rtl;
  user-select: none;
}

body.knt-admin-logged-in {
  padding-top: var(--knt-admin-bar-height) !important;
}

body.knt-admin-logged-in .site-header {
  top: var(--knt-admin-bar-height) !important;
}

.knt-bar-left, .knt-bar-right, .knt-bar-center {
  display: flex;
  align-items: center;
  gap: 12px;
}

.knt-bar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 14px;
  color: #FFFFFF;
}

.knt-bar-badge {
  background: var(--knt-cms-sky);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.knt-bar-user {
  font-size: 13px;
  color: var(--knt-cms-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.knt-bar-user b {
  color: var(--knt-cms-text);
}

.knt-bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none;
  font-family: inherit;
}

.knt-btn-edit-toggle {
  background: rgba(0, 149, 217, 0.2);
  color: var(--knt-cms-sky-light);
  border-color: rgba(0, 149, 217, 0.5);
}

.knt-btn-edit-toggle:hover {
  background: rgba(0, 149, 217, 0.35);
  box-shadow: 0 0 12px rgba(0, 149, 217, 0.4);
}

.knt-btn-edit-toggle.active {
  background: #0095D9;
  color: #FFFFFF;
  box-shadow: 0 0 15px rgba(0, 149, 217, 0.7);
}

.knt-btn-save {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: #FFFFFF;
  border: none;
}

.knt-btn-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.knt-btn-dashboard {
  background: rgba(255, 255, 255, 0.08);
  color: #E2E8F0;
  border-color: var(--knt-cms-border);
}

.knt-btn-dashboard:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

.knt-btn-logout {
  background: transparent;
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.knt-btn-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #FCA5A5;
}

.knt-save-status {
  font-size: 12px;
  color: var(--knt-cms-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.knt-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--knt-cms-success);
}

.knt-status-dot.dirty {
  background: var(--knt-cms-gold);
  animation: pulseDot 1s infinite alternate;
}

@keyframes pulseDot {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

/* ==========================================================================
   2. VISUAL EDITOR INTERACTIVE HIGHLIGHTS (In Edit Mode)
   ========================================================================== */
body.knt-edit-mode-active h1,
body.knt-edit-mode-active h2,
body.knt-edit-mode-active h3,
body.knt-edit-mode-active h4,
body.knt-edit-mode-active p,
body.knt-edit-mode-active li,
body.knt-edit-mode-active a,
body.knt-edit-mode-active img,
body.knt-edit-mode-active .info-node-card,
body.knt-edit-mode-active .pillar-chamfer-card,
body.knt-edit-mode-active .advisory-col-card,
body.knt-edit-mode-active .chevron-flow-step,
body.knt-edit-mode-active .hero-badge-chamfer,
body.knt-edit-mode-active .section-tag-chamfer,
body.knt-edit-mode-active .about-lead {
  transition: outline 0.15s ease, box-shadow 0.15s ease;
}

body.knt-edit-mode-active h1:hover,
body.knt-edit-mode-active h2:hover,
body.knt-edit-mode-active h3:hover,
body.knt-edit-mode-active h4:hover,
body.knt-edit-mode-active p:hover,
body.knt-edit-mode-active li:hover,
body.knt-edit-mode-active a:hover,
body.knt-edit-mode-active img:hover,
body.knt-edit-mode-active .info-node-card:hover,
body.knt-edit-mode-active .chevron-flow-step:hover,
body.knt-edit-mode-active .hero-badge-chamfer:hover,
body.knt-edit-mode-active .section-tag-chamfer:hover,
body.knt-edit-mode-active .about-lead:hover {
  outline: 2px dashed #0095D9 !important;
  outline-offset: 3px;
  cursor: pointer !important;
}

body.knt-edit-mode-active .knt-element-selected {
  outline: 2.5px solid #0095D9 !important;
  outline-offset: 4px;
  box-shadow: 0 0 20px rgba(0, 149, 217, 0.4) !important;
}

/* ==========================================================================
   3. LEFT SIDEBAR BUILDER (#knt-editor-sidebar)
   ========================================================================== */
#knt-editor-sidebar {
  position: fixed;
  top: var(--knt-admin-bar-height);
  left: -400px;
  width: 380px;
  height: calc(100vh - var(--knt-admin-bar-height));
  background: rgba(16, 44, 78, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1.5px solid rgba(0, 149, 217, 0.4);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.45);
  z-index: 999990;
  display: flex;
  flex-direction: column;
  transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Cairo', 'Tajawal', sans-serif;
  color: var(--knt-cms-text);
  direction: rtl;
  user-select: none;
}

#knt-editor-sidebar.open {
  left: 0;
}

body.knt-sidebar-pushed {
  margin-left: 380px !important;
  transition: margin-left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.knt-sidebar-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--knt-cms-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(9, 30, 54, 0.7);
}

.knt-sidebar-title {
  font-size: 16px;
  font-weight: 800;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 8px;
}

.knt-sidebar-close {
  background: transparent;
  border: none;
  color: var(--knt-cms-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  border-radius: 6px;
}

.knt-sidebar-close:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.1);
}

.knt-sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--knt-cms-border);
  background: rgba(9, 30, 54, 0.4);
}

.knt-tab-btn {
  flex: 1;
  padding: 10px 8px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--knt-cms-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.knt-tab-btn.active {
  color: var(--knt-cms-sky-light);
  border-bottom-color: var(--knt-cms-sky);
  background: rgba(0, 149, 217, 0.1);
}

.knt-sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.knt-panel-section {
  display: none;
}

.knt-panel-section.active {
  display: block;
}

/* Sidebar Form Controls */
.knt-field-group {
  margin-bottom: 18px;
}

.knt-field-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #E2E8F0;
  margin-bottom: 6px;
}

.knt-field-help {
  font-size: 11px;
  color: var(--knt-cms-muted);
  margin-top: 4px;
}

.knt-input, .knt-textarea {
  width: 100%;
  background: rgba(9, 30, 54, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 10px 12px;
  color: #FFFFFF;
  font-size: 14px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.knt-input:focus, .knt-textarea:focus {
  border-color: var(--knt-cms-sky);
  box-shadow: 0 0 0 2px rgba(0, 149, 217, 0.25);
}

.knt-textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

/* Image Preview in Sidebar */
.knt-img-preview-box {
  width: 100%;
  height: 140px;
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
  margin-bottom: 10px;
  position: relative;
}

.knt-img-preview-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.knt-btn-upload {
  width: 100%;
  background: rgba(0, 149, 217, 0.2);
  border: 1px solid var(--knt-cms-sky);
  color: #BAE6FD;
  padding: 8px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  margin-top: 6px;
}

.knt-btn-upload:hover {
  background: rgba(0, 149, 217, 0.35);
  color: #FFFFFF;
}

/* Section Visibility Item */
.knt-section-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(9, 30, 54, 0.55);
  border: 1px solid var(--knt-cms-border);
  border-radius: 10px;
  margin-bottom: 10px;
  transition: all 0.2s;
}

.knt-section-item:hover {
  border-color: rgba(0, 149, 217, 0.45);
  background: rgba(9, 30, 54, 0.85);
}

.knt-section-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #FFFFFF;
}

.knt-section-id {
  font-size: 11px;
  color: var(--knt-cms-muted);
  direction: ltr;
}

/* Switch Toggle Component */
.knt-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.knt-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.knt-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #334155;
  transition: .3s;
  border-radius: 24px;
}

.knt-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .knt-slider {
  background-color: var(--knt-cms-sky);
}

input:checked + .knt-slider:before {
  transform: translateX(20px);
}

/* Block Actions inside sidebar */
.knt-block-tool-btn {
  width: 100%;
  padding: 10px;
  margin-bottom: 8px;
  border-radius: 8px;
  border: 1px solid var(--knt-cms-border);
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}

.knt-block-tool-btn:hover {
  background: rgba(0, 149, 217, 0.25);
  border-color: var(--knt-cms-sky);
}

.knt-block-tool-btn.danger {
  color: #F87171;
  border-color: rgba(239, 68, 68, 0.35);
}

.knt-block-tool-btn.danger:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #FCA5A5;
}

/* Toast Notifications */
#knt-cms-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(9, 30, 54, 0.96);
  border: 1px solid var(--knt-cms-sky);
  color: #FFFFFF;
  padding: 12px 24px;
  border-radius: 30px;
  font-family: 'Cairo', 'Tajawal', sans-serif;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 20px rgba(0, 149, 217, 0.4);
  z-index: 1000000;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 10px;
  direction: rtl;
}

#knt-cms-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==========================================================================
   VISUAL BOX MODEL (SPACING: MARGIN & PADDING)
   ========================================================================== */
.knt-bm-reset-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #CBD5E1;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.knt-bm-reset-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #EF4444;
  color: #FCA5A5;
}

.knt-box-model-container {
  direction: ltr !important;
  user-select: none;
  font-family: 'Cairo', sans-serif;
  margin-top: 8px;
  width: 100%;
  box-sizing: border-box;
}

.knt-bm-margin-box {
  background: rgba(245, 158, 11, 0.06);
  border: 1.5px dashed #F59E0B;
  border-radius: 8px;
  padding: 8px 6px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
}

.knt-bm-header-row {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  padding: 0 4px;
}

.knt-bm-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.knt-bm-label-margin {
  color: #F59E0B;
}

.knt-bm-label-padding {
  color: #10B981;
}

.knt-bm-middle-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 6px;
}

.knt-bm-padding-box {
  background: rgba(16, 185, 129, 0.06);
  border: 1.5px dashed #10B981;
  border-radius: 6px;
  padding: 6px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  box-sizing: border-box;
}

.knt-bm-element-box {
  background: rgba(0, 149, 217, 0.22);
  border: 1.5px solid var(--knt-cms-sky);
  border-radius: 4px;
  padding: 6px 8px;
  min-width: 64px;
  min-height: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.knt-bm-element-title {
  font-size: 11px;
  font-weight: 700;
  color: #38BDF8;
  line-height: 1.2;
}

.knt-bm-element-size {
  font-size: 9.5px;
  color: #CBD5E1;
  font-weight: 600;
  margin-top: 1px;
  line-height: 1.2;
}

.knt-bm-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.knt-bm-input {
  width: 48px;
  height: 25px;
  background: #091E36;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  padding: 1px 13px 1px 2px;
  outline: none;
  transition: all 0.2s;
  -moz-appearance: textfield;
}

.knt-bm-input::-webkit-outer-spin-button,
.knt-bm-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.knt-bm-input:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: #102C4E;
}

.knt-bm-input:focus {
  border-color: #38BDF8;
  background: #061426;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.3);
}

.knt-bm-unit {
  position: absolute;
  right: 3px;
  font-size: 8px;
  color: #94A3B8;
  pointer-events: none;
  font-weight: 700;
}

.knt-bm-center-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0, 149, 217, 0.14);
  border: 1px dashed #38BDF8;
  border-radius: 6px;
  color: #BAE6FD;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s ease;
}

.knt-bm-center-btn:hover {
  background: rgba(0, 149, 217, 0.28);
  color: #FFFFFF;
  border-color: #60A5FA;
}
