/* ????????????????????????????????????????????????????
   website-editor.css  —  Styles for Project/WebsiteEditor
   PDPortal / PublicDial Services
???????????????????????????????????????????????????? */

/* ?? Reset ?? */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; font-family: 'Poppins', sans-serif; background: #0f1117; color: #e0e0e0; }

/* ??????????????????????????????????????
   SHELL LAYOUT
?????????????????????????????????????? */
/* ?? Shell layout — height accounts for single-row _HeaderProj (52px) ?? */
.we_shell { display: flex; height: calc(100vh - 52px); overflow: hidden; }

/* ??????????????????????????????????????
   SIDEBAR
?????????????????????????????????????? */
.we_sidebar {
  width: 220px;
    flex-shrink: 0;
    background: #161b27;
    border-right: 1px solid #1e2640;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width .25s;
}
.we_sidebar.collapsed { width: 0; border: none; }

.we_sidebar_head {
    padding: 16px 14px 12px;
  background: linear-gradient(135deg, #1a237e, #283593);
    display: flex;
    align-items: center;
 gap: 10px;
    flex-shrink: 0;
}
.we_sidebar_head .logo_icon {
  width: 32px;
    height: 32px;
    border-radius: 8px;
background: #e65100;
  display: flex;
    align-items: center;
justify-content: center;
    flex-shrink: 0;
}
.we_sidebar_head .logo_icon i { font-size: 14px; color: #fff; }
.we_sidebar_head h1    { font-size: 13px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; }
.we_sidebar_head small { display: block; font-size: 10px; color: rgba(255,255,255,.5); }

/* ?? File list ?? */
.we_file_list { flex: 1; overflow-y: auto; padding: 10px 0; }

.we_file_item {
  display: flex;
    align-items: center;
  gap: 9px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 12.5px;
    color: #aaa;
    border-left: 3px solid transparent;
    transition: all .18s;
    white-space: nowrap;
    overflow: hidden;
}
.we_file_item:hover  { background: #1e2640; color: #fff; }
.we_file_item.active { background: #1e2640; color: #4fc3f7; border-left-color: #4fc3f7; font-weight: 600; }
.we_file_item i { font-size: 13px; flex-shrink: 0; color: #e65100; }
.we_file_item .fi_label { overflow: hidden; text-overflow: ellipsis; }
.we_file_item .fi_badge {
    margin-left: auto;
    flex-shrink: 0;
    background: #e65100;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
}

/* ??????????????????????????????????????
   MAIN AREA
?????????????????????????????????????? */
.we_main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ?? Topbar ?? */
.we_topbar {
    height: 50px;
    flex-shrink: 0;
    background: #161b27;
    border-bottom: 1px solid #1e2640;
    display: flex;
    align-items: center;
gap: 8px;
  padding: 0 14px;
}
.we_toggle { background: none; border: none; color: #aaa; font-size: 16px; cursor: pointer; padding: 4px 6px; border-radius: 5px; }
.we_toggle:hover { background: #1e2640; color: #fff; }

.we_breadcrumb { font-size: 12px; color: #666; margin-right: auto; }
.we_breadcrumb span { color: #4fc3f7; font-weight: 600; }

.we_tb_btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    font-family: 'Poppins', sans-serif;
    transition: all .18s;
}
.we_btn_save{ background: #1a237e; color: #fff; }
.we_btn_save:hover        { background: #e65100; }
.we_btn_save:disabled{ opacity: .5; cursor: not-allowed; }
.we_btn_prev        { background: #1e2640; color: #aaa; border: 1px solid #2a3050; }
.we_btn_prev:hover        { background: #2a3050; color: #fff; }
.we_btn_nav             { background: #1e2640; color: #aaa; border: 1px solid #2a3050; width: 30px; height: 30px; padding: 0; justify-content: center; }
.we_btn_nav:hover:not(:disabled) { background: #4fc3f7; color: #000; border-color: #4fc3f7; }
.we_btn_nav:disabled      { opacity: .3; cursor: not-allowed; }

.we_file_counter { font-size: 11px; color: #555; padding: 0 6px; }

/* ??????????????????????????????????????
   SPLIT PANE
?????????????????????????????????????? */
.we_split {
    flex: 1;
    display: flex;
    overflow: hidden;
    padding-left: 5px;
    padding-right: 200px;
}

/* ?? Editor pane ?? */
.we_editor_pane {
    width: 50%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #1e2640;
    overflow: hidden;
}

.we_pane_head {
    padding: 7px 12px;
    background: #1a1f2e;
    display: flex;
 align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #666;
    flex-shrink: 0;
    border-bottom: 1px solid #1e2640;
}
.we_pane_head i { color: #e65100; }
.we_pane_head .dot { width: 8px; height: 8px; border-radius: 50%; background: #e65100; display: inline-block; margin-left: auto; }
.we_pane_head .dot.clean { background: #43a047; }

#codeEditor {
    flex: 1;
    resize: none;
    border: none;
    outline: none;
    background: #0d1117;
  color: #abb2bf;
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    line-height: 1.7;
    padding: 16px 18px;
    tab-size: 2;
    overflow: auto;
    white-space: pre;
}
#codeEditor::selection { background: #264f78; }

/* ?? Preview pane ?? */
.we_preview_pane { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.we_preview_pane .we_pane_head .we_refresh { margin-left: auto; background: none; border: none; color: #aaa; font-size: 13px; cursor: pointer; }
.we_preview_pane .we_pane_head .we_refresh:hover { color: #4fc3f7; }
#previewFrame { flex: 1; border: none; background: #fff; }

/* ?? Resizer ?? */
.we_resizer { width: 5px; flex-shrink: 0; background: #1e2640; cursor: col-resize; transition: background .2s; }
.we_resizer:hover, .we_resizer.dragging { background: #4fc3f7; }

/* ??????????????????????????????????????
   STATUS BAR
?????????????????????????????????????? */
.we_statusbar {
    height: 26px;
    flex-shrink: 0;
    background: #0a0e1a;
    border-top: 1px solid #1e2640;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 14px;
    font-size: 10.5px;
    color: #555;
}
.we_statusbar span { display: flex; align-items: center; gap: 4px; }
.we_statusbar i    { font-size: 10px; }
.sb_ok   { color: #43a047; }
.sb_warn { color: #e65100; }

/* ??????????????????????????????????????
   TOAST
?????????????????????????????????????? */
#we_toast {
    position: fixed;
    bottom: 40px;
    right: 24px;
    background: #2e7d32;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    display: none;
    align-items: center;
 gap: 10px;
    z-index: 9999;
    box-shadow: 0 6px 24px rgba(0,0,0,.4);
}
#we_toast.err { background: #c62828; }
#we_toast i   { font-size: 16px; }

/* ??????????????????????????????????????
   LOADING OVERLAY
?????????????????????????????????????? */
#we_loading {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 8888;
}
#we_loading .spin { font-size: 32px; color: #4fc3f7; animation: we-spin .8s linear infinite; }

@keyframes we-spin { to { transform: rotate(360deg); } }
