/**
 * ZZZCMS 前端可视化编辑器样式
 */

/* 编辑器工具栏样式 */
.visual-editor-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: #fff;
    border-bottom: 1px solid #e5e5e5;
    padding: 10px 20px;
    z-index: 999999;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toolbar-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-right: 20px;
}

.toolbar-components {
    display: flex;
    gap: 10px;
    flex: 1;
}

.component-btn {
    padding: 6px 12px;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.component-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.toolbar-actions {
    display: flex;
    gap: 10px;
}

.save-btn,
.view-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
}

.save-btn {
    background-color: #007bff;
    color: white;
}

.save-btn:hover {
    background-color: #0056b3;
}

.view-btn {
    background-color: #28a745;
    color: white;
}

.view-btn:hover {
    background-color: #1e7e34;
}

/* 可编辑内容区域样式 */
.visual-editor-active {
    min-height: 400px;
    padding: 20px;
    background-color: #fff;
    border: 2px dashed #007bff;
    border-radius: 4px;
    margin-top: 70px;
}

/* 可视化组件基础样式 */
.visual-component {
    position: relative;
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 4px;
    transition: all 0.3s;
}

.visual-component:hover {
    background-color: #f8f9fa;
}

.visual-component-selected {
    background-color: #e3f2fd !important;
    border: 2px solid #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

/* 文本组件样式 */
.text-component {
    min-height: 40px;
}

.text-component p,
.text-component h1,
.text-component h2,
.text-component h3,
.text-component blockquote {
    margin: 0 0 10px 0;
}

/* 图片组件样式 */
.image-component {
    text-align: center;
}

.editable-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.image-caption {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* 视频组件样式 */
.video-component {
    text-align: center;
}

.video-component video {
    max-width: 100%;
    border-radius: 4px;
}

/* 分隔线组件样式 */
.divider-component {
    padding: 0;
    text-align: center;
}

.editable-divider {
    border: none;
    height: 2px;
    background-color: #ddd;
    margin: 20px 0;
}

/* 按钮组件样式 */
.button-component {
    text-align: center;
}

.editable-button {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.editable-button:hover {
    background-color: #0056b3;
}

/* 相册组件样式 */
.gallery-component {
    padding: 10px;
}

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.gallery-item {
    overflow: hidden;
    border-radius: 4px;
}

.gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-item img:hover {
    transform: scale(1.05);
}

/* 属性编辑面板样式 */
.visual-property-panel {
    position: fixed;
    top: 70px;
    right: 20px;
    width: 300px;
    background-color: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 999998;
}

.panel-title {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    border-bottom: 1px solid #e5e5e5;
}

.panel-content {
    padding: 16px;
}

.property-group {
    margin-bottom: 16px;
}

.property-group:last-child {
    margin-bottom: 0;
}

.property-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.property-group input,
.property-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.property-group input:focus,
.property-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* 拖拽时的样式 */
.dragging {
    opacity: 0.5;
    cursor: move;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .visual-editor-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .toolbar-components {
        flex-wrap: wrap;
    }
    
    .visual-editor-active {
        margin-top: 150px;
    }
    
    .visual-property-panel {
        width: calc(100% - 40px);
        right: 20px;
        left: 20px;
        top: auto;
        bottom: 20px;
    }
}

/* 临时图片输入框样式 */
#temp_image {
    display: none;
}