/**
 * NXT Page Builder - Frontend Shared Styles
 * Estilos compartidos entre canvas, preview y publicación
 * Este archivo debe usarse en todos los contextos donde se muestre contenido del builder
 */

/* Reset básico para contenido del builder */
.builder-page *,
.builder-page *::before,
.builder-page *::after {
    box-sizing: border-box;
}

.builder-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333333;
}

/* ═══════════════════════════════════════════════════════════════
   Secciones
   ═══════════════════════════════════════════════════════════════ */
.builder-section {
    position: relative;
    overflow: hidden;
}

.builder-section .section-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
}

.builder-section .section-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
}

.builder-section .section-bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 0;
}

/* ═══════════════════════════════════════════════════════════════
   Tipografía
   ═══════════════════════════════════════════════════════════════ */
.builder-heading {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 0.5em 0;
}

.builder-heading h1, h1.builder-heading { font-size: 3rem; }
.builder-heading h2, h2.builder-heading { font-size: 2.25rem; }
.builder-heading h3, h3.builder-heading { font-size: 1.875rem; }
.builder-heading h4, h4.builder-heading { font-size: 1.5rem; }
.builder-heading h5, h5.builder-heading { font-size: 1.25rem; }
.builder-heading h6, h6.builder-heading { font-size: 1rem; }

.builder-text {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0 0 1em 0;
}

/* ═══════════════════════════════════════════════════════════════
   Botones
   ═══════════════════════════════════════════════════════════════ */
.builder-button {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.builder-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Variantes de botón */
.builder-button.btn-primary,
.btn-primary.builder-button {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #ffffff;
}

.builder-button.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

.builder-button.btn-secondary,
.btn-secondary.builder-button {
    background: #374151;
    color: #ffffff;
}

.builder-button.btn-secondary:hover {
    background: #1f2937;
}

.builder-button.btn-light,
.btn-light.builder-button {
    background: #ffffff;
    color: #333333;
    border: 1px solid #e5e7eb;
}

.builder-button.btn-light:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.builder-button.btn-outline,
.btn-outline.builder-button {
    background: transparent;
    color: #6366f1;
    border: 2px solid #6366f1;
}

.builder-button.btn-outline:hover {
    background: #6366f1;
    color: #ffffff;
}

/* Tamaños de botón */
.builder-button.btn-small,
.btn-small.builder-button {
    padding: 8px 16px;
    font-size: 12px;
}

.builder-button.btn-medium,
.btn-medium.builder-button {
    padding: 12px 24px;
    font-size: 14px;
}

.builder-button.btn-large,
.btn-large.builder-button {
    padding: 16px 32px;
    font-size: 16px;
}

/* ═══════════════════════════════════════════════════════════════
   Imágenes
   ═══════════════════════════════════════════════════════════════ */
.builder-image {
    margin: 0;
    line-height: 0;
}

.builder-image img {
    max-width: 100%;
    height: auto;
    display: block;
}

.builder-image-placeholder {
    background: #f3f4f6;
    padding: 40px;
    text-align: center;
    color: #9ca3af;
    border-radius: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   Videos
   ═══════════════════════════════════════════════════════════════ */
.builder-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
}

.builder-video iframe,
.builder-video video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   Listas
   ═══════════════════════════════════════════════════════════════ */
.builder-list {
    margin: 0 0 1em 0;
    padding-left: 24px;
}

.builder-list li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.builder-list.list-unstyled {
    list-style: none;
    padding-left: 0;
}

/* ═══════════════════════════════════════════════════════════════
   Cards
   ═══════════════════════════════════════════════════════════════ */
.builder-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.builder-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.builder-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.builder-card-content {
    padding: 20px;
}

.builder-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.builder-card p {
    color: #6b7280;
    margin: 0 0 15px 0;
}

.builder-card-btn {
    display: inline-block;
    padding: 8px 16px;
    background: #6366f1;
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

.builder-card-btn:hover {
    background: #4f46e5;
}

/* ═══════════════════════════════════════════════════════════════
   Iconos
   ═══════════════════════════════════════════════════════════════ */
.builder-icon {
    line-height: 1;
}

.builder-icon .material-symbols-rounded {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ═══════════════════════════════════════════════════════════════
   Espaciadores y Divisores
   ═══════════════════════════════════════════════════════════════ */
.builder-spacer {
    width: 100%;
}

.builder-divider {
    border: 0;
    margin: 20px auto;
}

/* ═══════════════════════════════════════════════════════════════
   Layout - Containers, Rows, Columns
   ═══════════════════════════════════════════════════════════════ */
.builder-container {
    width: 100%;
    margin: 0 auto;
}

.builder-row {
    display: grid;
}

.builder-column {
    min-height: 50px;
}

/* ═══════════════════════════════════════════════════════════════
   HTML Block
   ═══════════════════════════════════════════════════════════════ */
.builder-html {
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   Estados vacíos y errores
   ═══════════════════════════════════════════════════════════════ */
.builder-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #9ca3af;
    font-style: italic;
}

.builder-error {
    padding: 20px;
    background: #fef2f2;
    color: #991b1b;
    border-radius: 8px;
    text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .builder-page {
        font-size: 14px;
    }

    .builder-heading h1, h1.builder-heading { font-size: 2rem; }
    .builder-heading h2, h2.builder-heading { font-size: 1.75rem; }
    .builder-heading h3, h3.builder-heading { font-size: 1.5rem; }

    .builder-section .section-content {
        padding-left: 16px;
        padding-right: 16px;
    }

    .builder-row {
        grid-template-columns: 1fr !important;
    }
}
