/* Base Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
}

.editor-container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Toolbar Styles */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    padding: 5px;
    background-color: #f0f0f0;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 100;
}

.toolbar-group {
    display: flex;
    margin-right: 10px;
    padding: 5px;
    border-right: 1px solid #ccc;
}

.toolbar-group:last-child {
    border-right: none;
}

.toolbar button, .toolbar select {
    margin: 0 2px;
    padding: 5px 8px;
    font-size: 14px;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 3px;
    cursor: pointer;
}

.toolbar button:hover, .toolbar select:hover {
    background-color: #e6e6e6;
}

.toolbar input[type="color"] {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid #ccc;
}

/* Document Area */
#document-container {
    padding: 20px;
    min-height: 800px;
    outline: none;
}

.container {
    border: 1px dashed #ccc;
    margin-bottom: 20px;
    position: relative;
    padding: 10px;
}

.container:hover {
    border-color: #999;
}

.container-handle {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 20px;
    height: 20px;
    background-color: #eee;
    border: 1px solid #ccc;
    cursor: move;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.container-toolbar {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
}

.container-toolbar button {
    margin-left: 5px;
    padding: 2px 5px;
    font-size: 12px;
    background-color: #eee;
    border: 1px solid #ccc;
    cursor: pointer;
}

.columns {
    display: flex;
    flex-wrap: wrap;
    margin: 10px 0;
}

.column {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 1px dotted #ddd;
    margin: 5px;
}

/* Content Editable Styles */
[contenteditable="true"] {
    min-height: 20px;
    padding: 10px;
    border: 1px solid transparent;
}

[contenteditable="true"]:focus {
    border: 1px dashed #aaa;
    outline: none;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 20px;
    border-radius: 5px;
    width: 80%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.close {
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #666;
}

/* Table Styles */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 10px 0;
}

table td, table th {
    border: 1px solid #ddd;
    padding: 8px;
}

table th {
    background-color: #f2f2f2;
}

/* Image and Video Styles */
.editor-image, .editor-video {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    cursor: move;
    position: relative;
}

.editor-image img {
    max-width: 100%;
    height: auto;
    display: block;
}

.editor-video video {
    max-width: 100%;
    height: auto;
    display: block;
}

.media-caption {
    text-align: center;
    font-style: italic;
    color: #666;
    margin-top: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .toolbar {
        flex-direction: column;
    }
    
    .toolbar-group {
        margin-bottom: 5px;
        border-right: none;
        border-bottom: 1px solid #ccc;
    }
    
    .columns {
        flex-direction: column;
    }
    
    .column {
        width: 100%;
        margin: 5px 0;
    }
}


/* Add these styles to your existing CSS */
.container-handle {
    cursor: grab;
    width: 20px;
    height: 20px;
    background-color: #eee;
    border: 1px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 5px;
}

.container-handle:active {
    cursor: grabbing;
}

.dragging {
    opacity: 0.7;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.drop-target {
    border: 2px dashed #09f;
    background-color: rgba(0, 153, 255, 0.1);
}



/* Table Modal Styles */
.table-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 15px 0;
}

.table-options label {
    display: block;
    margin-bottom: 5px;
}

.table-options input {
    width: 60px;
    padding: 5px;
}




/* Add to your existing styles */
.modal-open {
    overflow: hidden;
}

/* Table highlight animation */
.table-inserted {
    animation: highlight 1s;
}

@keyframes highlight {
    from { 
        background-color: rgba(0, 200, 0, 0.2);
        box-shadow: 0 0 0 2px rgba(0, 200, 0, 0.3);
    }
    to { 
        background-color: transparent;
        box-shadow: none;
    }
}

/* Container structure */
.container {
    position: relative;
    border: 1px dashed #ccc;
    padding: 10px;
    margin-bottom: 15px;
}

.container > .content {
    min-height: 20px;
    padding: 10px;
}


.editor-table {
    width: 100%;
    margin: 10px 0;
    border-collapse: collapse;
}

.editor-table th, 
.editor-table td {
    border: 1px solid #ddd;
    padding: 8px;
    min-width: 40px;
}
