/* ============================================================
   LYL Comments — Hoja de estilos completa
   Dark theme, sin referencias a WordPress
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
.lylc-wrap {
    --lylc-bg:          #020617;
    --lylc-surface:     rgba(15, 23, 42, 0.95);
    --lylc-border:      rgba(59, 130, 246, 0.18);
    --lylc-border-hover:rgba(59, 130, 246, 0.45);
    --lylc-text:        #e2e8f0;
    --lylc-muted:       #64748b;
    --lylc-subtle:      #94a3b8;
    --lylc-accent:      #3b82f6;
    --lylc-accent-h:    #2563eb;
    --lylc-cyan:        #06b6d4;
    --lylc-danger:      #f87171;
    --lylc-success:     #6ee7b7;
    --lylc-radius:      .75rem;
    --lylc-radius-sm:   .5rem;
    --lylc-font:        inherit;
}

/* ── Contenedor principal ───────────────────────────────────── */
.lylc-wrap {
    padding: 2.5rem 0;
    font-family: var(--lylc-font);
    color: var(--lylc-text);
}

/* ── Encabezado ─────────────────────────────────────────────── */
.lylc-title {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--lylc-text);
    margin: 0 0 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--lylc-border);
}
.lylc-title-icon {
    color: var(--lylc-accent);
    flex-shrink: 0;
}

/* ── Lista de comentarios ───────────────────────────────────── */
.lylc-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.lylc-empty {
    color: var(--lylc-muted);
    font-style: italic;
    padding: 1rem 0;
    margin: 0;
}

/* ── Comentario individual ──────────────────────────────────── */
.lylc-comment {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: .75rem;
    align-items: start;
}
.lylc-comment--reply {
    margin-top: .5rem;
}

/* ── Avatar ─────────────────────────────────────────────────── */
.lylc-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    /* El color de fondo se aplica via JS con data-name/data-email */
    background: #3b82f6;
    user-select: none;
    letter-spacing: .01em;
}
.lylc-avatar--bar {
    width: 36px;
    height: 36px;
    font-size: .9rem;
    border: 2px solid rgba(59, 130, 246, .4);
}
.lylc-comment--reply .lylc-avatar {
    width: 34px;
    height: 34px;
    font-size: .85rem;
}

/* ── Cuerpo del comentario ──────────────────────────────────── */
.lylc-body {
    background: var(--lylc-surface);
    border: 1px solid var(--lylc-border);
    border-radius: var(--lylc-radius);
    padding: .9rem 1.1rem;
    position: relative;
}
.lylc-meta {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: .5rem;
    flex-wrap: wrap;
}
.lylc-author {
    font-weight: 600;
    font-size: .9375rem;
    color: var(--lylc-text);
}
.lylc-date {
    font-size: .8rem;
    color: var(--lylc-muted);
}
.lylc-content {
    font-size: .9375rem;
    line-height: 1.65;
    color: #cbd5e1;
    margin: 0 0 .6rem;
    white-space: pre-line;
    word-break: break-word;
}
.lylc-content:last-child {
    margin-bottom: 0;
}

/* ── Botón responder ─────────────────────────────────────────── */
.lylc-reply-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: none;
    border: none;
    color: var(--lylc-muted);
    font-size: .8125rem;
    font-weight: 500;
    cursor: pointer;
    padding: .25rem 0;
    transition: color .2s;
    font-family: inherit;
}
.lylc-reply-btn:hover {
    color: var(--lylc-accent);
}

/* ── Respuestas anidadas ─────────────────────────────────────── */
.lylc-replies {
    margin-top: .5rem;
    margin-left: 42px;  /* alinea con el cuerpo del padre */
    padding-left: 1rem;
    border-left: 2px solid var(--lylc-border);
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

/* ── Mini-form de respuesta ─────────────────────────────────── */
.lylc-reply-form-slot {
    margin-top: .75rem;
}
.lylc-reply-inline-form {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.lylc-reply-inline-form .lylc-textarea {
    min-height: 80px;
}
.lylc-reply-actions {
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.lylc-cancel-reply {
    background: none;
    border: 1px solid var(--lylc-border);
    color: var(--lylc-muted);
    padding: .45rem .9rem;
    border-radius: var(--lylc-radius-sm);
    font-size: .875rem;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s;
}
.lylc-cancel-reply:hover {
    border-color: var(--lylc-border-hover);
    color: var(--lylc-subtle);
}

/* ── Auth box (Login / Registro / Reset) ────────────────────── */
.lylc-auth-box {
    background: var(--lylc-surface);
    border: 1px solid var(--lylc-border);
    border-radius: var(--lylc-radius);
    padding: 2rem;
    max-width: 480px;
}

/* Tabs */
.lylc-tabs {
    display: flex;
    border-bottom: 1px solid var(--lylc-border);
    margin-bottom: 1.75rem;
    gap: 0;
}
.lylc-tab {
    flex: 1;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    padding: .75rem 0;
    color: var(--lylc-muted);
    font-size: .9375rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s;
    text-align: center;
}
.lylc-tab:hover:not(.active) {
    color: var(--lylc-subtle);
}
.lylc-tab.active {
    color: var(--lylc-text);
    border-bottom-color: var(--lylc-accent);
}

.lylc-auth-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--lylc-text);
    margin: 0 0 .35rem;
}
.lylc-auth-sub {
    font-size: .9rem;
    color: var(--lylc-muted);
    margin: 0 0 1.25rem;
    line-height: 1.5;
}

/* ── Alertas ─────────────────────────────────────────────────── */
.lylc-alert {
    padding: .8rem 1rem;
    border-radius: var(--lylc-radius-sm);
    font-size: .875rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}
.lylc-alert-err {
    background: rgba(239, 68, 68, .12);
    border: 1px solid rgba(239, 68, 68, .3);
    color: #fca5a5;
}
.lylc-alert-ok {
    background: rgba(16, 185, 129, .12);
    border: 1px solid rgba(16, 185, 129, .3);
    color: var(--lylc-success);
}

/* ── Campos de formulario ───────────────────────────────────── */
.lylc-form,
.lylc-comment-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}
.lylc-field {
    display: flex;
    flex-direction: column;
    gap: .4rem;
}
.lylc-field label {
    font-size: .875rem;
    font-weight: 500;
    color: #cbd5e1;
}
.lylc-field input,
.lylc-textarea {
    padding: .7rem 1rem;
    background: rgba(30, 41, 59, .9);
    border: 1px solid rgba(71, 85, 105, .55);
    border-radius: var(--lylc-radius-sm);
    color: var(--lylc-text);
    font-size: .9375rem;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    -webkit-appearance: none;
}
.lylc-field input:focus,
.lylc-textarea:focus {
    border-color: var(--lylc-accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .15);
}
.lylc-field input::placeholder,
.lylc-textarea::placeholder {
    color: #475569;
}
.lylc-textarea {
    resize: vertical;
    min-height: 110px;
    line-height: 1.6;
}

/* ── Toggle contraseña ──────────────────────────────────────── */
.lylc-pass-wrap {
    position: relative;
}
.lylc-pass-wrap input {
    padding-right: 2.75rem;
}
.lylc-eye {
    position: absolute;
    right: .75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--lylc-muted);
    padding: 0;
    line-height: 1;
    transition: color .2s;
}
.lylc-eye:hover {
    color: var(--lylc-subtle);
}

/* ── Footer del form de login ───────────────────────────────── */
.lylc-form-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: -.35rem;
}
.lylc-link-btn {
    background: none;
    border: none;
    color: #60a5fa;
    font-size: .875rem;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    text-decoration: none;
    transition: color .2s;
}
.lylc-link-btn:hover {
    color: var(--lylc-accent);
    text-decoration: underline;
}
.lylc-back-btn {
    display: block;
    text-align: left;
    margin-top: .25rem;
    width: fit-content;
}

/* ── Nota legal ─────────────────────────────────────────────── */
.lylc-legal {
    font-size: .8rem;
    color: var(--lylc-muted);
    line-height: 1.5;
    margin: -.35rem 0 0;
}
.lylc-req {
    color: var(--lylc-danger);
}

/* ── Botón de envío ─────────────────────────────────────────── */
.lylc-submit {
    padding: .8rem 1rem;
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--lylc-radius-sm);
    cursor: pointer;
    width: 100%;
    font-family: inherit;
    letter-spacing: .01em;
    transition: all .25s;
}
.lylc-submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #3b82f6, #06b6d4);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, .35);
}
.lylc-submit:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}
.lylc-submit--inline {
    width: auto;
    padding: .65rem 1.4rem;
    font-size: .9375rem;
}

/* ── Barra de usuario logueado ──────────────────────────────── */
.lylc-user-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .7rem 1rem;
    background: rgba(15, 23, 42, .7);
    border: 1px solid var(--lylc-border);
    border-radius: var(--lylc-radius-sm);
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.lylc-user-bar-left {
    display: flex;
    align-items: center;
    gap: .6rem;
}
.lylc-user-name {
    font-size: .9rem;
    color: var(--lylc-subtle);
}
.lylc-user-name strong {
    color: var(--lylc-text);
    font-weight: 600;
}
.lylc-logout-btn {
    background: none;
    border: 1px solid rgba(71, 85, 105, .4);
    color: var(--lylc-muted);
    font-size: .8rem;
    padding: .3rem .7rem;
    border-radius: .35rem;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s;
    white-space: nowrap;
}
.lylc-logout-btn:hover {
    color: var(--lylc-danger);
    border-color: rgba(248, 113, 113, .4);
    background: rgba(239, 68, 68, .08);
}

/* ── Footer del form de comentario ─────────────────────────── */
.lylc-comment-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    flex-wrap: wrap;
}
.lylc-char-count {
    font-size: .8125rem;
    color: var(--lylc-muted);
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
    .lylc-replies {
        margin-left: 20px;
    }
    .lylc-auth-box {
        padding: 1.5rem 1rem;
    }
    .lylc-comment {
        grid-template-columns: 36px 1fr;
    }
    .lylc-avatar {
        width: 36px;
        height: 36px;
        font-size: .875rem;
    }
    .lylc-tab {
        font-size: .875rem;
        padding: .6rem 0;
    }
    .lylc-comment-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    .lylc-submit--inline {
        width: 100%;
    }
}
