/* ==========================================================================
   WEBIMPULSER EDITOR - SIDEBAR & FULL SCREEN LAYOUT
   ========================================================================== */
:root {
    --w-sidebar: 280px;
    /* Minimum width to fit "Estadísticas" + icons */
    --w-sidebar-collapsed: 72px;
    --h-mobile-header: 64px;
    --bg-sidebar: #ffffff;
    --text-main: #334155;
    --text-muted: #64748b;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --border-sidebar: #f1f5f9;
}

body {
    margin: 0;
    padding: 0;
    background: #f1f5f9;
    height: 100vh;
    overflow: hidden;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* --- MAIN LAYOUT --- */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
}



/* --- MAIN CONTENT AREA --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
    background: #ffffff;
    /* Brighter background */
}

/* Header visible only on mobile/tablet usually, but can be global search bar too */
.top-bar-mobile {
    display: none;
    /* Desktop hidden */
    min-height: 64px;
    height: auto;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
}

.mobile-menu-trigger {
    background: none;
    border: none;
    cursor: pointer;
    color: #1e293b;
}

/* Content Scrollable Area */
.content-scroll-area {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    /* Padding handled inside sections */
}

/* --- OVERRIDES FOR CONFIGURATOR --- */
/* Makes the configurator assume full width/height inside container */
.editor-page-wrapper {
    padding-top: 0 !important;
    padding: 0 !important;
    /* ELIMINAR PADDING PARA APROVECHAR TODO EL ESPACIO */
    min-height: auto !important;
    background: transparent !important;
}

.builder-layout {
    height: calc(100vh - 60px) !important;
    /* Fit to viewport minus padding */
    display: grid !important;
    grid-template-columns: 350px 1fr 400px !important;
    /* Fluid middle! */
    gap: 30px !important;
    align-items: start !important;
}

/* Since the original configurator was 2-col, we need to adapt 3-col logic here */
/* Wait, Configurator was [Dashboard (Nav + Content)] [Preview] */
/* The user asked for "Sidebar Left" + "Workspace Full". */
/* So: Sidebar | [Wizard + Content] | Preview */
/* My CSS above sets Sidebar. Now inside Main Content:  */
/* We have the configurator layout which already handles Content + Preview. */
/* So we just inject the Configurator layout into Main Content div. */

/* Configurator Layout Override */
/* 
.builder-layout {
    display: none !important; 
} 
*/
/* The layout is now handled by .mi-app-container in mi-app-layout.css */

.config-dashboard {
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    /* Internal scroll */
}

.config-content-fluid {
    overflow-y: auto !important;
    flex: 1 !important;
    padding-right: 10px;
    /* Scrollbar space */
}

.phone-preview-col {
    height: 100% !important;
    position: sticky !important;
    top: 0 !important;
}

/* --- URL INPUT STYLING --- */
.input-group-modern {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.input-group-modern label {
    display: block;
    font-size: 0.85rem;
    font-weight: 800;
    color: #64748b;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-wrapper-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper-icon i {
    position: absolute;
    left: 16px;
    color: #94a3b8;
    width: 20px;
    height: 20px;
}

.modern-input-field {
    width: 100%;
    height: 52px;
    padding-left: 48px;
    /* Icon space */
    padding-right: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    color: #1e293b;
    font-weight: 600;
    transition: all 0.2s;
    outline: none;
}

.modern-input-field:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}


/* --- RESPONSIVE MOBILE --- */
@media (max-width: 1024px) {
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        z-index: 5000;
        transform: translateX(-100%);
    }

    .app-sidebar.open {
        transform: translateX(0);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
    }

    .top-bar-mobile {
        display: flex;
    }

    .main-content {
        width: 100%;
    }

    .builder-layout {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
    }

    .phone-preview-col {
        display: none;
        /* Or use overlay logic from editor.html previously */
    }

    .editor-page-wrapper {
        padding: 20px !important;
    }

    /* Configurator Mobile Adapters */
    .config-dashboard {
        height: auto !important;
        overflow: visible !important;
    }
}