/* ===== Live Editor Styles ===== */

/* --- Admin Toggle Button --- */
.le-toggle-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    background: #2C3E2D;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    transition: all 0.3s ease;
}
.le-toggle-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(0,0,0,0.35);
}
.le-toggle-btn.active {
    background: #E74C3C;
}
.le-toggle-btn .le-tooltip {
    position: absolute;
    right: 66px;
    background: #1a1a1a;
    color: #fff;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.le-toggle-btn:hover .le-tooltip {
    opacity: 1;
}

/* --- Top Toolbar --- */
.le-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 10001;
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    font-family: 'Inter', sans-serif;
}
.le-toolbar.visible {
    transform: translateY(0);
}
.le-toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.le-toolbar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    color: #a78bfa;
}
.le-toolbar-logo i {
    font-size: 1.1rem;
}
.le-toolbar-divider {
    width: 1px;
    height: 28px;
    background: rgba(255,255,255,0.15);
}
.le-toolbar-status {
    font-size: 0.78rem;
    color: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    gap: 6px;
}
.le-toolbar-status .le-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    display: inline-block;
}
.le-toolbar-center {
    display: flex;
    align-items: center;
    gap: 4px;
}
.le-toolbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.le-tb-btn {
    padding: 7px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.le-tb-btn--tool {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.8);
    padding: 7px 12px;
}
.le-tb-btn--tool:hover, .le-tb-btn--tool.active {
    background: rgba(255,255,255,0.18);
    color: #fff;
}
.le-tb-btn--cancel {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.85);
}
.le-tb-btn--cancel:hover {
    background: rgba(255,255,255,0.2);
}
.le-tb-btn--save {
    background: #4ade80;
    color: #064e3b;
}
.le-tb-btn--save:hover {
    background: #22c55e;
}
.le-tb-btn--save:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Edit Mode Body Shift --- */
body.le-edit-mode {
    padding-top: 52px !important;
}
body.le-edit-mode .header {
    top: 52px !important;
}

/* --- Editable Elements (v2 — contenteditable) --- */
body.le-edit-mode [contenteditable="true"] {
    position: relative;
    outline: 2px dashed transparent;
    outline-offset: 4px;
    transition: outline-color 0.2s, background-color 0.2s;
    cursor: text;
    min-height: 1em;
}
body.le-edit-mode [contenteditable="true"]:hover {
    outline-color: rgba(167, 139, 250, 0.5);
}
body.le-edit-mode [contenteditable="true"]:focus {
    outline-color: #a78bfa;
    outline-style: solid;
    background-color: rgba(167, 139, 250, 0.05);
}
body.le-edit-mode [contenteditable="true"][data-le-label]::before {
    content: attr(data-le-label);
    position: absolute;
    top: -22px;
    left: 0;
    background: #a78bfa;
    color: #fff;
    padding: 1px 8px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    white-space: nowrap;
    z-index: 100;
    font-family: 'Inter', sans-serif;
}
body.le-edit-mode [contenteditable="true"][data-le-label]:hover::before,
body.le-edit-mode [contenteditable="true"][data-le-label]:focus::before {
    opacity: 1;
}

/* --- Image Edit Overlays --- */
body.le-edit-mode .le-image-overlay {
    pointer-events: none;
}
body.le-edit-mode *:hover > .le-image-overlay {
    opacity: 1;
    pointer-events: all;
}
.le-image-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 50;
    border-radius: inherit;
    pointer-events: none;
}
body.le-edit-mode [data-le-image]:hover .le-image-overlay {
    opacity: 1;
    pointer-events: all;
}
.le-image-overlay i {
    font-size: 2rem;
    color: #fff;
}
.le-image-overlay span {
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
}
.le-image-overlay input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* --- Section Controls --- */
.le-section-ctrl {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.2s;
}
body.le-edit-mode section:hover > .le-section-ctrl,
body.le-edit-mode .hero:hover > .le-section-ctrl {
    opacity: 1;
}
.le-section-ctrl-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}
.le-section-ctrl-btn:hover {
    background: rgba(0,0,0,0.85);
    transform: scale(1.1);
}
.le-section-ctrl-btn--hide {
    background: rgba(231, 76, 60, 0.8);
}
.le-section-ctrl-btn--hide:hover {
    background: rgba(231, 76, 60, 1);
}

/* --- Section Labels --- */
body.le-edit-mode section, body.le-edit-mode .hero {
    position: relative;
}
.le-section-label {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.2s;
    font-family: 'Inter', sans-serif;
    backdrop-filter: blur(4px);
}
body.le-edit-mode section:hover > .le-section-label,
body.le-edit-mode .hero:hover > .le-section-label {
    opacity: 1;
}

/* --- Settings Panel --- */
.le-panel {
    position: fixed;
    top: 52px;
    right: -420px;
    width: 420px;
    height: calc(100vh - 52px);
    background: #fff;
    z-index: 10000;
    box-shadow: -4px 0 30px rgba(0,0,0,0.15);
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    font-family: 'Inter', sans-serif;
}
.le-panel.visible {
    right: 0;
}
.le-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.le-panel-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    font-family: 'Inter', sans-serif;
}
.le-panel-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f3f4f6;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: #6b7280;
    transition: all 0.2s;
}
.le-panel-close:hover {
    background: #e5e7eb;
    color: #1f2937;
}
.le-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}
.le-panel-section {
    margin-bottom: 24px;
}
.le-panel-section h4 {
    font-size: 0.82rem;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    font-family: 'Inter', sans-serif;
}
.le-field {
    margin-bottom: 14px;
}
.le-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}
.le-field input[type="text"],
.le-field input[type="url"],
.le-field textarea,
.le-field select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.88rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}
.le-field input:focus,
.le-field textarea:focus,
.le-field select:focus {
    border-color: #a78bfa;
}
.le-field textarea {
    resize: vertical;
    min-height: 60px;
}

/* --- Slide Editor in Panel --- */
.le-slide-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
}
.le-slide-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.le-slide-card-header strong {
    font-size: 0.85rem;
    color: #1f2937;
}
.le-slide-thumb {
    width: 100%;
    height: 80px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    background-color: #e5e7eb;
    margin-bottom: 10px;
    position: relative;
    cursor: pointer;
    overflow: hidden;
}
.le-slide-thumb:hover::after {
    content: 'Click to change';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 600;
}
.le-mini-btn {
    padding: 4px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}
.le-mini-btn--danger {
    background: #fef2f2;
    color: #dc2626;
}
.le-mini-btn--danger:hover {
    background: #fee2e2;
}
.le-mini-btn--add {
    background: #f0fdf4;
    color: #16a34a;
    width: 100%;
    padding: 8px;
    margin-top: 4px;
}
.le-mini-btn--add:hover {
    background: #dcfce7;
}

/* --- Toast --- */
.le-toast {
    position: fixed;
    bottom: 90px;
    right: 24px;
    background: #1f2937;
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-family: 'Inter', sans-serif;
    z-index: 99999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s;
}
.le-toast.visible {
    transform: translateY(0);
    opacity: 1;
}
.le-toast--error {
    background: #dc2626;
}
.le-toast--success {
    background: #16a34a;
}

/* --- Upload progress --- */
.le-uploading {
    position: relative;
}
.le-uploading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit;
    z-index: 51;
}
.le-spinner {
    animation: le-spin 1s linear infinite;
}
@keyframes le-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- Hidden file input --- */
.le-hidden-input {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    opacity: 0;
}

/* --- Mobile Preview --- */
#le-mobile-wrapper {
    position: fixed;
    inset: 0;
    top: 52px;
    background: rgba(15, 23, 42, 0.92);
    z-index: 9998;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
    backdrop-filter: blur(4px);
}
#le-mobile-wrapper.visible {
    display: flex;
}
body.le-mobile-active > *:not(.le-toolbar):not(.le-toggle-btn):not(.le-panel):not(#le-mobile-wrapper):not(.le-toast) {
    visibility: hidden;
}
.le-mobile-device {
    background: #1a1a2e;
    border-radius: 36px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), inset 0 0 0 2px rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    transform-origin: center center;
    transition: all 0.3s ease;
}
.le-mobile-notch {
    height: 30px;
    width: 100%;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.le-mobile-notch::after {
    content: '';
    width: 80px;
    height: 6px;
    background: #2d2d4a;
    border-radius: 3px;
}
#le-mobile-frame {
    border: none;
    background: #fff;
}
.le-mobile-bar {
    height: 24px;
    width: 100%;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
}
.le-mobile-bar::after {
    content: '';
    width: 100px;
    height: 4px;
    background: #2d2d4a;
    border-radius: 2px;
}
.le-mobile-info {
    color: rgba(255,255,255,0.5);
    font-size: 0.78rem;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    letter-spacing: 1px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .le-panel {
        width: 100%;
        right: -100%;
    }
    .le-toolbar {
        padding: 0 10px;
    }
    .le-toolbar-logo span:last-child {
        display: none;
    }
    .le-toolbar-status {
        display: none;
    }
    .le-tb-btn {
        padding: 7px 10px;
        font-size: 0.75rem;
    }
    .le-tb-btn span {
        display: none;
    }
}
