/* ===== demo.css =====
   Módulo de datos demo — solo accesible para master.
   ================================================= */

/* -----------------------------------------------------------------------
   Secciones
------------------------------------------------------------------------ */
.demo-section {
    background: rgba(255,255,255,.04);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-md);
    padding: 28px;
    margin-bottom: 18px;
}

.demo-section--danger {
    background: rgba(220,40,40,.05);
    border-color: rgba(220,40,40,.22);
}

.demo-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.demo-section-title {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
}

.demo-section-desc {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-soft);
    max-width: 640px;
}

/* -----------------------------------------------------------------------
   Botón de acción principal
------------------------------------------------------------------------ */
.demo-btn-action {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0 22px;
    height: 46px;
    font-size: 14.5px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: opacity var(--transition), transform var(--transition);
}

.demo-btn-action:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.demo-danger-note {
    margin: 14px 0 0;
    font-size: 12.5px;
    color: rgba(220,80,80,.80);
}

.demo-danger-note code {
    font-family: monospace;
    background: rgba(220,40,40,.12);
    padding: 1px 6px;
    border-radius: 4px;
}

/* -----------------------------------------------------------------------
   Formulario de generación
------------------------------------------------------------------------ */
.demo-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

.demo-form-subtitle {
    margin: 0 0 14px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.demo-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Lista de lo que incluye */
.demo-include-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.demo-include-list li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 13px;
    color: var(--text-soft);
    line-height: 1.4;
}

.demo-check {
    flex: 0 0 auto;
    color: #22c9a5;
    font-weight: 700;
    font-size: 14px;
    margin-top: 1px;
}

.demo-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.demo-hint {
    margin: 0;
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.45;
}

/* -----------------------------------------------------------------------
   Links rápidos a módulos
------------------------------------------------------------------------ */
.demo-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.demo-link-card {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 16px;
    background: rgba(255,255,255,.035);
    border: 1px solid var(--stroke);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.demo-link-card:hover {
    background: rgba(255,255,255,.07);
    border-color: var(--stroke-strong);
    transform: translateY(-2px);
}

.demo-link-icon {
    font-size: 24px;
    line-height: 1;
    flex: 0 0 auto;
}

.demo-link-card strong {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.demo-link-card span {
    font-size: 12px;
    color: var(--text-muted);
}

/* -----------------------------------------------------------------------
   Log de operaciones
------------------------------------------------------------------------ */
.demo-log {
    display: none;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(91,170,224,.22) transparent;
}

.demo-log::-webkit-scrollbar { width: 5px; }
.demo-log::-webkit-scrollbar-track { background: transparent; }
.demo-log::-webkit-scrollbar-thumb { background: rgba(91,170,224,.22); border-radius: 999px; }

.demo-log-item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    border: 1px solid transparent;
}

.demo-log-ts {
    flex: 0 0 auto;
    font-size: 11.5px;
    font-family: monospace;
    color: var(--text-muted);
}

.demo-log-success {
    background: rgba(0,180,120,.08);
    border-color: rgba(0,180,120,.22);
    color: #7fe6d6;
}

.demo-log-danger {
    background: rgba(220,40,40,.07);
    border-color: rgba(220,40,40,.20);
    color: rgba(255,140,140,.90);
}

.demo-log-error {
    background: rgba(220,120,40,.07);
    border-color: rgba(220,120,40,.20);
    color: rgba(255,180,100,.90);
}

.demo-log-info {
    background: rgba(91,170,224,.07);
    border-color: rgba(91,170,224,.18);
    color: var(--text-soft);
}

/* -----------------------------------------------------------------------
   Responsive
------------------------------------------------------------------------ */
@media (max-width: 760px) {
    .demo-form-grid {
        grid-template-columns: 1fr;
    }

    .demo-section {
        padding: 18px;
    }
}

/* -----------------------------------------------------------------------
   Light mode
------------------------------------------------------------------------ */
body.light .demo-section {
    background: rgba(255,255,255,.80);
    border-color: var(--stroke);
}

body.light .demo-section--danger {
    background: rgba(220,40,40,.03);
    border-color: rgba(220,40,40,.18);
}

body.light .demo-link-card {
    background: #fff;
    box-shadow: 0 1px 3px rgba(20,30,60,.06);
}

body.light .demo-link-card:hover {
    background: #f4f8fd;
}

body.light .demo-log-success { color: #0a7a5c; }
body.light .demo-log-danger  { color: #b02020; }
body.light .demo-log-error   { color: #a05010; }
