/* ===========================================
   SITEGEN EDITOR - Visual Editor Stylesheet
   =========================================== */

/* -------------------------------------------
   Editor Mode Indicator
   ------------------------------------------- */
.editor-mode body {
    padding-right: 60px; /* Space for hamburger menu */
}

.editor-mode-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    z-index: 10001;
    font-family: 'Segoe UI', sans-serif;
}

/* -------------------------------------------
   Floating Settings Button (for index.html)
   ------------------------------------------- */
.settings-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-btn:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

/* -------------------------------------------
   Hamburger Menu (Right Side)
   ------------------------------------------- */
.editor-hamburger {
    position: fixed;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.editor-hamburger-btn {
    width: 45px;
    height: 45px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-hamburger-btn:hover {
    background: #667eea;
    border-color: #667eea;
    transform: scale(1.1);
}

.editor-hamburger-btn.active {
    background: #667eea;
    border-color: #667eea;
}

.editor-hamburger-btn[data-tooltip] {
    position: relative;
}

.editor-hamburger-btn[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 55px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    font-family: 'Segoe UI', sans-serif;
}

/* -------------------------------------------
   Sidebar Base Styles
   ------------------------------------------- */
.editor-sidebar {
    position: fixed;
    top: 0;
    left: -400px;
    width: 380px;
    height: 100vh;
    background: #1a1a2e;
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 10002;
    transition: left 0.3s ease;
    overflow-y: auto;
    font-family: 'Segoe UI', sans-serif;
}

.editor-sidebar.active {
    left: 0;
}

.editor-sidebar-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.editor-sidebar-header h3 {
    margin: 0;
    color: white;
    font-size: 16px;
    font-weight: 600;
}

.editor-sidebar-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.editor-sidebar-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.editor-sidebar-content {
    padding: 20px;
}

/* -------------------------------------------
   Form Elements
   ------------------------------------------- */
.editor-form-group {
    margin-bottom: 20px;
}

.editor-form-group label {
    display: block;
    color: #b2bec3;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.editor-form-group input[type="text"],
.editor-form-group input[type="url"],
.editor-form-group input[type="email"],
.editor-form-group textarea,
.editor-form-group select {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
}

.editor-form-group input:focus,
.editor-form-group textarea:focus,
.editor-form-group select:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.08);
}

.editor-form-group input[type="color"] {
    width: 100%;
    height: 45px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
}

.editor-form-group textarea {
    min-height: 80px;
    resize: vertical;
}

/* -------------------------------------------
   Editable Elements Highlight
   ------------------------------------------- */
.editable {
    position: relative;
    outline: 2px dashed transparent;
    outline-offset: 5px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.editable:hover {
    outline-color: #667eea;
}

.editable:focus {
    outline-color: #764ba2;
    outline-style: solid;
}

.editable-wrapper {
    position: relative;
    display: inline-block;
}

.editable-wrapper:hover .editable-controls {
    opacity: 1;
    visibility: visible;
}

/* -------------------------------------------
   Editable Element Controls (Floating Icons)
   ------------------------------------------- */
.editable-controls {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    background: rgba(0, 0, 0, 0.9);
    padding: 5px 10px;
    border-radius: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
}

.editable-controls button {
    width: 25px;
    height: 25px;
    border: none;
    background: transparent;
    color: white;
    cursor: pointer;
    border-radius: 50%;
    font-size: 11px;
    transition: all 0.2s ease;
}

.editable-controls button:hover {
    background: #667eea;
}

/* -------------------------------------------
   List Items (Menu, Slides)
   ------------------------------------------- */
.editor-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.editor-list-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.editor-list-item:hover {
    border-color: rgba(102, 126, 234, 0.5);
}

.editor-list-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.editor-list-item-title {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.editor-list-item-actions {
    display: flex;
    gap: 5px;
}

.editor-list-item-actions button {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    border-radius: 5px;
    font-size: 12px;
    transition: all 0.2s ease;
}

.editor-list-item-actions button:hover {
    background: #667eea;
}

.editor-list-item-actions button.delete:hover {
    background: #e74c3c;
}

/* Subitems */
.editor-subitems {
    margin-top: 10px;
    padding-left: 15px;
    border-left: 2px solid rgba(255, 255, 255, 0.1);
}

.editor-subitem {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 5px;
    margin-bottom: 5px;
}

.editor-subitem span {
    color: #b2bec3;
    font-size: 13px;
}

/* -------------------------------------------
   Add Button
   ------------------------------------------- */
.editor-add-btn {
    width: 100%;
    padding: 15px;
    background: rgba(102, 126, 234, 0.2);
    border: 2px dashed rgba(102, 126, 234, 0.5);
    border-radius: 10px;
    color: #667eea;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.editor-add-btn:hover {
    background: rgba(102, 126, 234, 0.3);
    border-color: #667eea;
}

/* -------------------------------------------
   Publish Button
   ------------------------------------------- */
.editor-publish-btn {
    position: fixed;
    bottom: 30px;
    right: 80px;
    padding: 15px 30px;
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    border: none;
    border-radius: 30px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.4);
    transition: all 0.3s ease;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
}

.editor-publish-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 184, 148, 0.6);
}

.editor-publish-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.editor-publish-btn .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* -------------------------------------------
   Toast Notifications
   ------------------------------------------- */
.editor-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Segoe UI', sans-serif;
    z-index: 10003;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.editor-toast.success {
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
}

.editor-toast.error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

/* -------------------------------------------
   Image Gallery Modal
   ------------------------------------------- */
.editor-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10004;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.editor-modal {
    background: #1a1a2e;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: all 0.3s ease;
}

.editor-modal-overlay.active .editor-modal {
    transform: scale(1);
}

.editor-modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.editor-modal-header h3 {
    margin: 0;
    color: white;
    font-size: 18px;
}

.editor-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.editor-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.editor-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Image Gallery Grid */
.editor-image-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.editor-image-item {
    position: relative;
    aspect-ratio: 16/9;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
}

.editor-image-item:hover {
    border-color: #667eea;
    transform: scale(1.02);
}

.editor-image-item.selected {
    border-color: #00b894;
}

.editor-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.editor-image-item .image-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    font-size: 11px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

/* Upload Zone */
.editor-upload-zone {
    border: 2px dashed rgba(102, 126, 234, 0.5);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.editor-upload-zone:hover,
.editor-upload-zone.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.editor-upload-zone i {
    font-size: 40px;
    color: #667eea;
    margin-bottom: 10px;
}

.editor-upload-zone p {
    color: #b2bec3;
    margin: 0;
    font-size: 14px;
}

.editor-upload-zone input[type="file"] {
    display: none;
}

/* -------------------------------------------
   Section Divider
   ------------------------------------------- */
.editor-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 20px 0;
}

.editor-section-title {
    color: #667eea;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.editor-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(102, 126, 234, 0.3);
}

/* -------------------------------------------
   Color Picker Group
   ------------------------------------------- */
.editor-color-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.editor-color-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.editor-color-item input[type="color"] {
    width: 40px;
    height: 40px;
    padding: 2px;
    border-radius: 8px;
    flex-shrink: 0;
}

.editor-color-item span {
    color: #b2bec3;
    font-size: 12px;
}

/* -------------------------------------------
   Responsive
   ------------------------------------------- */
@media (max-width: 768px) {
    .editor-sidebar {
        width: 100%;
        left: -100%;
    }
    
    .editor-modal {
        width: 95%;
        margin: 10px;
    }
    
    .editor-image-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .editor-publish-btn {
        right: 20px;
        bottom: 20px;
        padding: 12px 20px;
        font-size: 13px;
    }
}
/* Editor styles for 3-level menu */
.editor-granditems {
    margin-top: 5px;
    padding-left: 30px;
    border-left: 2px solid rgba(255, 255, 255, 0.05);
}

.editor-granditem {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 5px;
    margin-bottom: 4px;
    font-size: 12px;
}

.editor-granditem span {
    color: #b2bec3;
}