﻿.toolbox {
    padding: 1rem;
    background: #f8f9fa;
    border-right: 1px solid #dee2e6;
    height: 100%;
    overflow-y: auto;
}

.component-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.component-item {
    padding: 0.5rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: grab;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.canvas {
    padding: 1rem;
    flex: 1;
    overflow-y: auto;
}

.section-card {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 1rem;
    padding: 1rem;
}

.section-card .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.section-card.selected {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.drop-zone {
    min-height: 100px;
    border: 2px dashed #dee2e6;
    border-radius: 4px;
    margin-top: 0.5rem;
    padding: 0.3rem 1rem;
    transition: border-color 0.2s;
}

.drop-zone:hover {
    border-color: #007bff;
}

.element-item {
    padding: 0.2rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.element-item.selected {
    background: #e7f3ff;
    border-color: #007bff;
}

.empty-state {
    text-align: center;
    padding: 0.8rem;
    color: #6c757d;
}

.placeholder {
    text-align: center;
    color: #adb5bd;
    font-style: italic;
}

.property-editor {
    padding: 0;
    background: #f8f9fa;
    border-left: 1px solid #dee2e6;
    height: 100%;
    overflow-y: auto;
}

.property-editor .form-group {
    width: 100%;
    margin-bottom: 0.5rem;
}

.property-editor .form-text {
    font-size: 0.875rem;
    color: #6c757d;
}

.property-editor .validation-section,
.property-editor .condition-section {
    padding: 1rem;
    background: #e9ecef;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.property-editor .empty-state {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.property-editor h5, .property-editor h6 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.form-actions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
    text-align: center;
}

.preview-panel {
    padding: 1rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-top: 1rem;
}

.preview-container {
    background: #f8f9fa;
    border-radius: 4px;
}

.empty-preview {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    font-style: italic;
}

.preview-panel h4 {
    margin-top: 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.preview-layout {
    display: flex;
    flex: 1;
    background: #f1f3f5;
    overflow: hidden;
}

.main-preview {
    flex: 1;
    /*max-width: 800px;*/
    margin: 0 auto;
}

.form-builder-container {
    display: flex;
    flex-direction: column;
    height: 98vh;
}

.toolbar {
    padding: 0.5rem 1rem 0 1rem;
    background: white;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.toolbar-info {
    display: flex;
    flex-direction: column;
}

.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.left-panel, .right-panel {
    width: 300px;
    overflow-y: auto;
    background: white;
}

.center-panel {
    flex: 1;
    overflow-y: auto;
    background: #f1f3f5;
    padding: 0;
}

.center-panel-toolbar {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.center-panel-toolbar-middle {
    width: fit-content;
    border: 1px solid #dee2e6;
    border-top: none;
    background-color: var(--rz-body-background-color);
    border-radius: 24px;
    padding: 0.5rem;
}

/* Para el indicador al final de la sección */
.section-end-drop {
    margin-top: 12px;
}

.canvas-toolbar {
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    text-align: end;
}

/* CONTENEDOR PRINCIPAL */
.dynamic-form-container {
    display: flex;
    flex-direction: column;
    height: 95vh;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.dynamic-form-container .rz-form {
    display: flex;
    overflow: hidden;
}

/* LAYOUT: TOC + NAV + FORM CONTENT */
.form-with-toc {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f8f9fa;
}

/* CONTENEDOR DE TOC + NAV (FIJO, SIN SCROLL) */
.toc-and-nav {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: white;
    border-right: 1px solid #e9ecef;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

/* BARRA LATERAL DEL TOC (PanelMenu) */
.toc-sidebar {
    width: 280px; /* Ancho fijo y generoso */
    flex-shrink: 0;
    background: white;
    border-right: 1px solid #e9ecef;
    padding: 1rem 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
}

.toc-sidebar h5 {
    margin: 0 0 0 0;
    padding: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0rem;
}

/* ESTILOS PARA RadzenPanelMenu */
.rz-panelmenu {
    width: 100% !important;
    flex: 1;
}

.rz-panelmenu .rz-menuitem {
    margin-bottom: 4px;
}

.rz-panelmenu .rz-menuitem-link {
    padding: 0.75rem 1rem !important;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
    color: #495057;
}

.rz-panelmenu .rz-menuitem-link:hover {
    background: #e9ecef;
    color: #007bff;
}

.rz-panelmenu .rz-menuitem-link.rz-state-active {
    background: #007bff !important;
    color: white !important;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

/* NAVEGACIÓN DEBAJO DEL TOC */
.toc-nav {
    padding: 1rem;
    background: white;
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toc-nav .rz-button {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    width: 100% !important;
}

/* CONTENEDOR PRINCIPAL DEL FORMULARIO (SCROLLABLE) */
.form-content {
    flex: 1;
    padding-top: 1rem;
    overflow-y: auto;
    background: #ffffff;
    display: flex;
    flex-direction: column;
}

/* SECCIONES DEL FORMULARIO */
.form-section {
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.form-section.active-section {
    border-color: #a7cfe9;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
    /*background: #f8fbff;*/
}

.form-section h3 {
    margin: 0 0 1.5rem 0;
    padding: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #212529;
    border-bottom: 2px solid #007bff;
    padding-bottom: 0.5rem;
}

/* ELEMENTOS DENTRO DE LA SECCIÓN */
.section-elements > * {
    margin-bottom: 1.5rem;
}

/* RESPONSIVE */
@media (max-width: 992px) {
    .form-with-toc {
        flex-direction: column;
    }

    .toc-and-nav {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        flex-direction: row;
        align-items: center;
        padding: 1rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }

    .toc-sidebar {
        flex: 1;
        padding: 0 1rem 0 0;
        margin-right: 1rem;
        border-right: 1px solid #e9ecef;
    }

    .toc-nav {
        flex: 0 0 auto;
        padding: 0;
        border-top: none;
        flex-direction: row;
        gap: 0.5rem;
    }

    .form-content {
        padding: 1.5rem;
    }
}

.rz-invalid-message {
    color: #e53935;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: block;
}

/* ZONAS DE DROP */
/* Asegurar que las zonas de drop sean clickeables */
.drop-indicator {
    display: flex;
    justify-content: end;
    height: 8px;
    margin: 2px 0;
    background: transparent;
    transition: background 0.2s ease;
    pointer-events: all !important;
    border: 1px dashed transparent;
    border-radius: 2px;
    position: relative;
    z-index: 10;
    min-width: 100%; /* Ocupa todo el ancho */
}

.drop-indicator:hover,
.drop-indicator.drop-active {
    background: rgba(0, 123, 255, 0.3);
    border-color: #007bff;
}

/* SECCIÓN ANIDADA */
.nested-section {
    position: relative;
    border: 2px dashed #6c757d;
    border-radius: 8px;
    padding: 0.4rem 0.4rem;
    margin: 0.5rem 0;
    background: #f8f9fa;
}

.nested-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.nested-section .section-header h5 {
    margin: 0;
    font-size: 1rem;
    color: #495057;
}

/* DROP ZONE DENTRO DE SECCIÓN ANIDADA */
.nested-section .drop-zone {
    position: relative;
    z-index: 1;
    min-height: 50px;
    border: 2px dashed #dee2e6;
    border-radius: 4px;
    padding: 0.3rem 1rem;
    background: #ffffff;
}

.nested-section .drop-zone:hover {
    border-color: #007bff;
}

/* ELEMENTOS DENTRO DE SECCIÓN ANIDADA */
.nested-section .element-item {
    position: relative;
    z-index: 2;
    padding: 0.2rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin: 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nested-section .element-item.selected {
    background: #e7f3ff;
    border-color: #007bff;
}

.nested-section .element-item:hover {
    background: #e9ecef;
}

.nested-section .element-item .rz-button {
    margin-left: auto;
    opacity: 0.7;
}

.nested-section .element-item .rz-button:hover {
    opacity: 1;
}

.span-overflow {
    display: inline-block;
    max-width: 500px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.paste-button-float {
    z-index: 1000;
    display: flex;
    align-items: center;
    margin-right: -1rem
}

