/* ============================================================
   Litéfilos – Seguimiento de Antologías | Frontend v1.6
   ============================================================ */

.lf-seg-frontend {
    font-family: inherit;
    max-width: 900px;
    margin: 0 auto;
    padding: 32px 24px 32px;
    --lf-purple:      #6366f1;
    --lf-purple-dark: #4f46e5;
    --lf-purple-light:#ede9fe;
    --lf-border:      #e0e0f0;
    --lf-radius:      14px;
    --lf-shadow:      0 4px 20px rgba(99,102,241,.10);
    /* Fondo sutil estilo pergamino */
    background: linear-gradient(160deg, #fdfcfb 0%, #f7f5f2 100%);
    border-radius: 18px;
    border: 1px solid #ede8e0;
}

/* ── Carrusel ─────────────────────────────────────────────── */
.lf-carousel-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.lf-carousel-viewport { flex: 1; overflow: hidden; }
.lf-carousel-track {
    display: flex;
    gap: 18px;
    transition: transform .38s cubic-bezier(.4,0,.2,1);
    will-change: transform;
}

/* ── Botones prev / next ──────────────────────────────────── */
.lf-carousel-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--lf-purple);
    color: #fff;
    border: none;
    font-size: 22px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(99,102,241,.35);
    transition: background .18s, transform .15s;
    padding: 0;
}
.lf-carousel-btn:hover  { background: var(--lf-purple-dark); transform: scale(1.08); }
.lf-carousel-btn:disabled { opacity: .35; cursor: default; transform: none; }

/* ── Dots ─────────────────────────────────────────────────── */
.lf-carousel-dots {
    display: flex; justify-content: center;
    gap: 8px; margin-bottom: 28px;
}
.lf-dot {
    width: 10px; height: 10px;
    border-radius: 50%; border: none;
    background: #d9d5cf;
    cursor: pointer;
    transition: background .18s, transform .18s;
    padding: 0; font-size: 0; line-height: 0; overflow: hidden;
}
.lf-dot::before, .lf-dot::after { display: none !important; content: none !important; }
.lf-dot:hover   { background: #a09890; transform: scale(1.2); }
.lf-dot-active  { background: var(--lf-purple); transform: scale(1.25); }

/* ── Tarjeta ──────────────────────────────────────────────── */
.lf-card {
    flex: 0 0 auto;
    background: #fff;
    border: 2px solid var(--lf-border);
    border-radius: var(--lf-radius);
    overflow: hidden;
    transition: border-color .22s, box-shadow .22s, transform .22s;
    position: relative;
    display: flex;
    flex-direction: column;

    /* Animación de entrada */
    opacity: 0;
    transform: translateY(18px);
}
.lf-card.lf-card-visible {
    animation: lfCardIn .45s cubic-bezier(.22,1,.36,1) forwards;
}
@keyframes lfCardIn {
    to { opacity: 1; transform: translateY(0); }
}

.lf-card:hover {
    border-color: var(--lf-purple);
    box-shadow: var(--lf-shadow);
    transform: translateY(-3px);
}
.lf-card.lf-card-active {
    border-color: var(--lf-purple);
    box-shadow: 0 6px 24px rgba(99,102,241,.18);
}
.lf-card.lf-card-active::after {
    content: '';
    position: absolute;
    bottom: -12px; left: 50%;
    transform: translateX(-50%);
    width: 0; height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid var(--lf-purple);
    z-index: 2;
}

/* ── Imagen: proporción vertical de libro (2:3) ───────────── */
.lf-card-img-wrap {
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #f3f0eb;
}
.lf-card-img {
    width: 100%; height: 100%;
    object-fit: cover; display: block;
    transition: transform .4s;
}
.lf-card:hover .lf-card-img { transform: scale(1.04); }
.lf-card-img-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 44px;
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
}

.lf-card-body {
    padding: 14px 16px 18px;
    display: flex; flex-direction: column; gap: 8px;
    flex: 1;
}
.lf-card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
}
.lf-card-phase {
    display: flex; flex-direction: column; gap: 3px;
    font-size: 12.5px; color: #374151;
    min-height: 36px;
}
.lf-card-phase strong { color: #1a1a2e; font-weight: 700; }
.lf-card-dates { font-size: 12px; color: #6b7280; line-height: 1.5; }

.lf-card-btn {
    margin-top: auto;
    padding: 9px 0; width: 100%;
    background: var(--lf-purple); color: #fff;
    border: none; border-radius: 8px;
    font-size: 13.5px; font-weight: 700;
    cursor: pointer; letter-spacing: .02em;
    transition: background .18s, transform .15s;
}
.lf-card-btn:hover { background: var(--lf-purple-dark); transform: translateY(-1px); }

/* ── Panel de detalle ─────────────────────────────────────── */
.lf-seg-panel {
    background: #fff;
    border: 2px solid var(--lf-purple);
    border-radius: var(--lf-radius);
    padding: 28px 32px;
    box-shadow: var(--lf-shadow);
    margin-top: 6px;
}
.lf-panel-inner {
    display: flex; gap: 36px; align-items: flex-start;
}

/* ── Libro 3D ─────────────────────────────────────────────── */
.lf-panel-cover-col { flex-shrink: 0; }
.lf-book-wrap { perspective: 700px; }
.lf-book {
    width: 130px; height: 190px;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateY(-20deg);
    transition: transform .45s cubic-bezier(.25,.8,.25,1);
    border-radius: 3px 8px 8px 3px;
}
.lf-book:hover { transform: rotateY(-5deg); }
.lf-book::before {
    content: '';
    position: absolute; left: 0; top: 0;
    width: 16px; height: 100%;
    background: linear-gradient(to right, #888, #bbb, #888);
    transform: rotateY(90deg) translateX(-8px);
    border-radius: 3px 0 0 3px;
}
.lf-book::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(to right, rgba(0,0,0,.2) 0%, rgba(0,0,0,.05) 16%, transparent 38%);
    border-radius: 3px 8px 8px 3px;
    pointer-events: none; z-index: 1;
}
.lf-book img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 3px 8px 8px 3px; display: block;
}
.lf-no-cover-placeholder {
    width: 130px; height: 190px;
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    border-radius: 3px 8px 8px 3px;
    display: flex; align-items: center; justify-content: center;
    font-size: 46px;
    box-shadow: -5px 6px 18px rgba(0,0,0,.16);
}

/* ── Info del panel ───────────────────────────────────────── */
.lf-panel-info-col { flex: 1; min-width: 0; }
.lf-ant-name {
    margin: 0 0 18px;
    font-size: 22px; font-weight: 800;
    color: #1a1a2e; line-height: 1.3;
}
.lf-info-grid {
    display: flex; flex-direction: column;
    gap: 9px; margin-bottom: 18px;
}
.lf-info-row {
    display: flex; align-items: center;
    gap: 10px; font-size: 13.5px; flex-wrap: wrap;
}
.lf-label {
    font-weight: 700; color: #6b7280;
    font-size: 11px; text-transform: uppercase;
    letter-spacing: .07em; min-width: 120px;
}

/* ── Barra de progreso en tarjeta ─────────────────────────── */
.lf-card-progress {
    margin-top: 2px;
}
.lf-card-progress-header {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 5px;
}
.lf-card-progress-label {
    font-size: 10.5px; font-weight: 700;
    text-transform: uppercase; letter-spacing: .06em;
    color: #9ca3af;
}
.lf-card-progress-frac {
    font-size: 11px; font-weight: 700;
    color: var(--lf-purple);
}
.lf-card-progress-track {
    height: 5px;
    background: #e9e8f8;
    border-radius: 20px;
    overflow: hidden;
}
.lf-card-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--lf-purple), #a78bfa);
    border-radius: 20px;
}

/* ── Contador de días ─────────────────────────────────────── */
.lf-days-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 14px;
    background: #fef3c7; color: #92400e;
    border: 1px solid #fcd34d;
    border-radius: 20px;
    font-size: 12.5px; font-weight: 700;
}
.lf-days-badge.lf-days-urgent {
    background: #fee2e2; color: #7f1d1d; border-color: #fca5a5;
}
.lf-days-badge.lf-days-ok {
    background: #dcfce7; color: #14532d; border-color: #86efac;
}
.lf-days-badge.lf-days-past {
    background: #f3f4f6; color: #6b7280; border-color: #e5e7eb;
}

/* ── Badges de estado ─────────────────────────────────────── */
.lf-status-badge {
    display: inline-block;
    padding: 3px 13px; border-radius: 20px;
    font-size: 13px; font-weight: 700; line-height: 1.6;
}
.status-desarrollo { background: #fef9c3; color: #854d0e; }
.status-revision   { background: #dbeafe; color: #1e3a8a; }
.status-diseno     { background: var(--lf-purple-light); color: #4c1d95; }
.status-impresion  { background: #fee2e2; color: #7f1d1d; }
.status-publicada  { background: #dcfce7; color: #14532d; }
.status-pausada    { background: #f3f4f6; color: #374151; }
.status-waiting    { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

.lf-phase-name  { font-weight: 700; color: var(--lf-purple); font-size: 14.5px; }
.lf-time-value  { font-weight: 700; color: #374151; font-size: 14px; }

/* ── Fechas ───────────────────────────────────────────────── */
.lf-dates-value { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lf-date-from   { font-size: 13.5px; font-weight: 600; color: #374151; }
.lf-date-sep    { color: var(--lf-purple); font-size: 16px; font-weight: 700; }
.lf-date-to     { font-size: 14px; font-weight: 800; color: var(--lf-purple);
                  background: var(--lf-purple-light); padding: 3px 12px; border-radius: 20px; }
.lf-date-to-only, .lf-date-from-only { font-size: 13.5px; font-weight: 600; color: #374151; }

/* ── Bloques de fase ──────────────────────────────────────── */
.lf-phase-details { display: flex; flex-direction: column; gap: 10px; }
.lf-phase-block   { border-radius: 10px; padding: 14px 16px; }
.lf-phase-desc    { background: #f5f3ff; border-left: 4px solid var(--lf-purple); }
.lf-phase-next    { background: #f0fdf4; border-left: 4px solid #16a34a; }
.lf-phase-block h4 {
    margin: 0 0 7px; font-size: 11px; font-weight: 800;
    text-transform: uppercase; letter-spacing: .07em; color: #6b7280;
}
.lf-phase-block p {
    margin: 0; font-size: 13.5px;
    line-height: 1.7; color: #374151; white-space: pre-line;
}

.lf-seg-empty { color: #9ca3af; font-style: italic; text-align: center; padding: 32px 0; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 680px) {
    .lf-seg-frontend { padding: 20px 14px; }
    .lf-seg-panel { padding: 20px 16px; }
    .lf-panel-inner { flex-direction: column; align-items: center; gap: 20px; }
    .lf-ant-name { font-size: 19px; text-align: center; }
    .lf-info-row { flex-wrap: wrap; }
    .lf-label { min-width: unset; }
}

/* ── A la espera de agenda (tarjeta) ──────────────────────── */
.lf-card-waiting {
    color: #92400e;
    font-weight: 600;
    font-style: italic;
}
