/* Componentes arrastrables */
.component-placeholder {
    border: 3px dashed #dee2e6;
    padding: 50px 30px;
    border-radius: 12px;
    text-align: center;
    color: #adb5bd;
    font-size: 16px;
    margin: 20px 0;
    background: #f8f9fa;
    transition: all 0.3s;
}

.component-placeholder:hover {
    border-color: var(--primary);
    background: #e9ecef;
}

.draggable-component {
    border: 2px solid transparent;
    padding: 20px;
    margin: 15px 0;
    border-radius: 12px;
    transition: all 0.3s;
    background: white;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.draggable-component:hover {
    border-color: var(--primary);
    box-shadow: 0 5px 20px rgba(67, 97, 238, 0.15);
    transform: translateY(-2px);
}

.draggable-component:hover .component-toolbar {
    opacity: 1;
    transform: translateY(0);
}

.component-toolbar {
    position: absolute;
    top: -45px;
    right: 10px;
    background: var(--dark);
    padding: 8px;
    border-radius: 8px 8px 0 0;
    display: flex;
    gap: 5px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
    z-index: 10;
}

.toolbar-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s;
}

.toolbar-btn:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

/* Panel de diseño */
.design-panel {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    border: 2px solid var(--primary);
}

.style-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 15px 0;
}

.style-control {
    margin-bottom: 12px;
}

.style-control label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.style-control input,
.style-control select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.color-picker {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-preview {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 2px solid #ddd;
}

.design-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Estilos para el modal de fondos */
.bg-option {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin: 5px 0;
    cursor: pointer;
    transition: all 0.3s;
}

.bg-option:hover {
    border-color: var(--primary);
    background: #f0f4ff;
}

.bg-color-preview {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
}

.bg-image-preview {
    width: 50px;
    height: 30px;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
    border: 1px solid #ddd;
}

/* Estilos para opciones de alineación de texto */
.text-align-options {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.text-align-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.text-align-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.text-align-btn:hover {
    border-color: var(--primary);
}

/* Opciones de ancho para elementos */
.width-options {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.width-btn {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.width-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.width-btn:hover {
    border-color: var(--primary);
}

/* Clases para ancho de elementos */
.width-full {
    width: 100% !important;
    max-width: 100% !important;
}

.width-boxed {
    width: auto !important;
    max-width: 100% !important;
}

/* Clases para alineación de texto */
.text-left {
    text-align: left !important;
}

.text-center {
    text-align: center !important;
}

.text-right {
    text-align: right !important;
}

/* Mejoras para el panel de diseño */
.advanced-options {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.option-group {
    margin-bottom: 15px;
}

.option-group-title {
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    font-size: 14px;
}

/* Estilos para elementos de ancho completo */
.full-width-element {
    width: 100vw !important;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

/* Espaciado mejorado */
.spacing-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Mejoras para componentes */
.draggable-component.width-full {
    border-radius: 0;
    margin: 15px -20px;
    padding: 20px;
}

.draggable-component.width-boxed {
    margin: 15px 0;
}