/* ===========================================================================
   OctoHtmlEditor — HTML Şablon Tasarımcısı
   DxPopup portal'a render olduğu için stiller global (CSS isolation çalışmaz).
   Renium marka paleti: #4040FF (primary), #3577FF, #29AEFF, gradient 24AAFF→4040FF
   =========================================================================== */

/* ---- Alan içi: memo + Tasarla butonu ---- */
.octo-html-field {
    display: flex;
    width: 100%;
    gap: 6px;
    align-items: flex-start;
    min-width: 0;
}
.octo-html-field__memo { flex: 1 1 auto; min-width: 0; }
.octo-html-field__btn { flex: 0 0 auto; white-space: nowrap; }

/* ---- Popup kabuğu — gövde tam yüksekliği doldursun ---- */
.octo-html-popup .dxbl-popup-body,
.octo-html-popup .dxbl-popup-content {
    padding: 0 !important;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.octo-html-popup .dxbl-popup-body > * { flex: 1 1 auto; min-height: 0; }

.octo-hd {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #f4f6fb;
    font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
    letter-spacing: -0.01em;
}

/* ---- Header ---- */
.octo-hd__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(110deg, #4040FF 0%, #3577FF 55%, #29AEFF 100%);
    color: #fff;
    flex-shrink: 0;
}
.octo-hd__title { display: flex; align-items: center; gap: 12px; }
.octo-hd__icon {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    background: rgba(255,255,255,0.18);
    border-radius: 10px;
    font-size: 17px;
}
.octo-hd__title-main { font-size: 16px; font-weight: 700; line-height: 1.1; }
.octo-hd__title-sub { font-size: 12px; opacity: 0.85; margin-top: 2px; }
.octo-hd__close {
    width: 34px; height: 34px;
    border: none; cursor: pointer;
    background: rgba(255,255,255,0.14);
    color: #fff; border-radius: 9px;
    font-size: 16px;
    transition: background 0.15s;
}
.octo-hd__close:hover { background: rgba(255,255,255,0.30); }

/* ---- Değişken paleti ---- */
.octo-hd__vars {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 18px;
    background: #fff;
    border-bottom: 1px solid #e6e9f2;
    flex-shrink: 0;
}
.octo-hd__vars-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; color: #6b7280;
    white-space: nowrap; display: flex; align-items: center; gap: 6px;
}
.octo-hd__vars-label i { color: #4040FF; }
.octo-hd__vars-chips { display: flex; flex-wrap: wrap; gap: 6px; overflow: hidden; }
.octo-hd__chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 11px;
    border: 1px solid #d4ddff;
    background: #eef2ff;
    color: #3538cd;
    border-radius: 999px;
    font-size: 12px; font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}
.octo-hd__chip:hover {
    background: #4040FF; color: #fff; border-color: #4040FF;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(64,64,255,0.28);
}
.octo-hd__chip-icon { font-size: 9px; opacity: 0.7; }
.octo-hd__chip:hover .octo-hd__chip-icon { opacity: 1; }

/* ---- Split body ---- */
.octo-hd__body {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: #e6e9f2;
    min-height: 0;
    overflow: hidden;
}
.octo-hd__pane {
    display: flex; flex-direction: column;
    background: #fff;
    min-width: 0; min-height: 0;
}
.octo-hd__pane-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    background: #fafbff;
    border-bottom: 1px solid #eceff7;
    flex-shrink: 0;
    min-height: 46px;
}
.octo-hd__pane-body { flex: 1 1 auto; min-height: 0; overflow: hidden; position: relative; }

/* Segmented toggle (Görsel / Kod) */
.octo-hd__seg {
    display: inline-flex;
    background: #eef0f6;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}
.octo-hd__seg-btn {
    border: none; cursor: pointer;
    background: transparent;
    color: #5b6478;
    font-size: 12.5px; font-weight: 600;
    padding: 5px 14px;
    border-radius: 6px;
    display: inline-flex; align-items: center; gap: 6px;
    transition: all 0.15s;
}
.octo-hd__seg-btn:hover { color: #4040FF; }
.octo-hd__seg-btn.is-active {
    background: #fff; color: #4040FF;
    box-shadow: 0 1px 3px rgba(20,30,80,0.12);
}
.octo-hd__hint {
    font-size: 11px; color: #b45309;
    display: inline-flex; align-items: center; gap: 5px;
    background: #fffbeb; border: 1px solid #fde68a;
    padding: 3px 9px; border-radius: 6px;
}
.octo-hd__pane-title {
    font-size: 12.5px; font-weight: 700; color: #374151;
    display: inline-flex; align-items: center; gap: 7px;
}
.octo-hd__pane-title i { color: #29AEFF; }
.octo-hd__pane-note { font-size: 10.5px; color: #9aa3b5; }

/* WYSIWYG editör — pane'i doldur */
.octo-hd__wysiwyg { height: 100%; border: none !important; }
.octo-hd__wysiwyg .dxbl-html-editor { border: none !important; height: 100%; }

/* Kod editörü */
.octo-hd__code {
    width: 100%; height: 100%;
    border: none; resize: none;
    padding: 14px 16px;
    font-family: "SF Mono", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
    font-size: 13px; line-height: 1.6;
    color: #1f2937;
    background: #fcfcfe;
    outline: none;
    tab-size: 2;
}
.octo-hd__code::placeholder { color: #c0c6d4; }

/* Canlı önizleme */
.octo-hd__preview {
    height: 100%; overflow: auto;
    padding: 18px;
    background:
        linear-gradient(45deg, #f7f8fb 25%, transparent 25%) -8px 0/16px 16px,
        linear-gradient(-45deg, #f7f8fb 25%, transparent 25%) -8px 0/16px 16px,
        linear-gradient(45deg, transparent 75%, #f7f8fb 75%) -8px 0/16px 16px,
        linear-gradient(-45deg, transparent 75%, #f7f8fb 75%) -8px 0/16px 16px,
        #ffffff;
}
.octo-hd__preview-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 10px; height: 100%;
    color: #aab2c5; font-size: 13px;
}
.octo-hd__preview-empty i { font-size: 30px; opacity: 0.5; }

/* Önizlemede değişken token vurgusu */
.octo-hd__token {
    background: linear-gradient(180deg, #eef2ff, #e0e7ff);
    border: 1px dashed #818cf8;
    border-radius: 4px;
    padding: 0 5px;
    font-size: 0.85em; font-weight: 600;
    color: #4338ca;
    white-space: nowrap;
}

/* ---- Footer ---- */
.octo-hd__footer {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px;
    padding: 12px 18px;
    background: #fff;
    border-top: 1px solid #e6e9f2;
    flex-shrink: 0;
}
.octo-hd__footer-info { font-size: 11.5px; color: #8a93a6; flex: 1 1 auto; min-width: 0; }
.octo-hd__footer-info i { color: #29AEFF; margin-right: 5px; }
.octo-hd__footer-info code {
    background: #f1f3f9; border-radius: 4px; padding: 1px 5px;
    color: #4040FF; font-size: 11px;
}
.octo-hd__footer-actions { display: flex; gap: 10px; flex-shrink: 0; }
.octo-hd__btn {
    border: none; cursor: pointer;
    font-size: 13px; font-weight: 600;
    padding: 9px 20px;
    border-radius: 9px;
    display: inline-flex; align-items: center; gap: 7px;
    font-family: inherit;
    transition: all 0.15s;
}
.octo-hd__btn--ghost {
    background: #f1f3f9; color: #5b6478;
}
.octo-hd__btn--ghost:hover { background: #e6e9f2; color: #374151; }
.octo-hd__btn--primary {
    background: linear-gradient(110deg, #4040FF, #3577FF);
    color: #fff;
    box-shadow: 0 3px 10px rgba(64,64,255,0.30);
}
.octo-hd__btn--primary:hover {
    box-shadow: 0 5px 16px rgba(64,64,255,0.42);
    transform: translateY(-1px);
}

/* Dar ekran: split'i alt alta yığ */
@media (max-width: 760px) {
    .octo-hd__body { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
}
