/* CLUBPRO PREDICTION DETAIL - Estilos del Detalle de Pronóstico.
   Archivo nuevo, independiente de css/feed.css (no se toca el feed).
   Restricción de diseño: border-radius máximo 8px en todo el sistema
   (excepto avatares, que son circulares por convención, no "cards"). */

.prediction-detail {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 720px;
}

.pd-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem 1.25rem;
}

/* ---------- CAPA 1: IDENTIDAD ---------- */
.pd-tipster-bar {
    border-top: 3px solid var(--sport-accent, #6366f1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.pd-tipster-identity {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    min-width: 0;
}
.pd-avatar, .pd-avatar-fallback {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}
.pd-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
}
.pd-tipster-name-block {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}
.pd-tipster-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #111827;
}
.pd-rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: #92400e;
    width: fit-content;
}
.pd-rank-badge img { width: 14px; height: 14px; object-fit: contain; }

.pd-tipster-tags {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.pd-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    background: #f1f5f9;
    color: #475569;
}
.pd-tag-vip { background: #fef3c7; color: #92400e; }
.pd-link-profile {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4f46e5;
    text-decoration: none;
    white-space: nowrap;
}
.pd-link-profile:hover { text-decoration: underline; }

/* ---------- CAPA 2: EL PRONÓSTICO PRINCIPAL ---------- */
.pd-headline-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.pd-visibility-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.pd-visibility-badge.is-public { background: #dcfce7; color: #166534; }
.pd-visibility-badge.is-private { background: #fef3c7; color: #92400e; }
.pd-kicker {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 500;
}
.pd-kicker i { margin-right: 0.3rem; color: var(--sport-accent, #6366f1); }

.pd-pick-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}
.pd-pick-text {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.3;
    text-wrap: balance;
}
.pd-odds-box {
    flex-shrink: 0;
    background: #0f172a;
    color: #00ff88;
    border-radius: 8px;
    padding: 0.5rem 0.9rem;
    text-align: center;
    min-width: 76px;
}
.pd-odds-value { display: block; font-size: 1.3rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.pd-odds-label { display: block; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; margin-top: 0.2rem; }

.pd-odds-alt {
    display: flex;
    gap: 1rem;
    margin-top: 0.75rem;
    padding-top: 0.6rem;
    border-top: 1px solid #f1f5f9;
    font-size: 0.75rem;
    color: #64748b;
    flex-wrap: wrap;
}
.pd-odds-alt b { color: #0f172a; font-variant-numeric: tabular-nums; }

.pd-locked {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 0.9rem 1rem;
}
.pd-locked i { font-size: 1.3rem; color: #d97706; }
.pd-locked strong { display: block; color: #92400e; font-size: 0.85rem; }
.pd-locked span { display: block; color: #92400e; font-size: 0.75rem; opacity: 0.85; margin-top: 0.15rem; }

/* ---------- CAPA 3: EVENTO ---------- */
.pd-event-context {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: #475569;
}
.pd-event-country, .pd-event-league { display: inline-flex; align-items: center; gap: 0.4rem; }
.pd-flag { width: 16px; height: 12px; object-fit: cover; border-radius: 2px; }
.pd-league-logo { width: 18px; height: 18px; object-fit: contain; }

.pd-matchup {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}
.pd-team { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; text-align: center; min-width: 0; }
.pd-team-logo { width: 48px; height: 48px; object-fit: contain; }
.pd-team-name { font-size: 0.82rem; font-weight: 600; color: #0f172a; }
.pd-matchup-vs { font-size: 0.75rem; font-weight: 700; color: #94a3b8; }

.pd-event-date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 0.75rem;
    padding-top: 0.6rem;
    border-top: 1px solid #f1f5f9;
    font-variant-numeric: tabular-nums;
}

/* ---------- COUNTDOWN / ESTADO ---------- */
.pd-timeline {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    font-weight: 600;
    font-size: 0.9rem;
}
.pd-timeline i { font-size: 1rem; }
.pd-timeline-countdown { border-left: 3px solid #6366f1; color: #4338ca; }
.pd-timeline-live { border-left: 3px solid #ef4444; color: #b91c1c; }
.pd-timeline-result { border-left: 3px solid #10b981; }
.pd-timeline-review { border-left: 3px solid #f59e0b; color: #92400e; }
.pd-timeline-cancelled { border-left: 3px solid #94a3b8; color: #475569; }

.pd-timeline-rail {
    flex-basis: 100%;
    height: 3px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}
.pd-timeline-rail i {
    display: block;
    height: 100%;
    width: 4%;
    background: #6366f1;
    border-radius: 2px;
    transition: width 1s linear;
}
.pd-live-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ef4444;
    animation: pdPulse 1.5s ease-in-out infinite;
}
@keyframes pdPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .pd-live-dot { animation: none; } }

.pd-timeline-points {
    flex-basis: 100%;
    font-size: 0.75rem;
    font-weight: 500;
    color: #64748b;
}

/* ---------- DETALLES DE LA APUESTA ---------- */
.pd-wager {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.pd-wager-item { display: flex; flex-direction: column; gap: 0.25rem; }
.pd-wager-label { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: #94a3b8; }
.pd-wager-value { font-size: 0.9rem; font-weight: 600; color: #0f172a; }
.pd-bookmaker { display: inline-flex; align-items: center; gap: 0.4rem; }
.pd-bookmaker img { width: 20px; height: 20px; object-fit: contain; border-radius: 4px; }

/* ---------- SECCIONES DE TEXTO GENÉRICAS ---------- */
.pd-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #334155;
    margin: 0 0 0.7rem;
}
.pd-analysis-text {
    font-size: 0.88rem;
    line-height: 1.6;
    color: #1e293b;
    margin: 0;
    white-space: pre-line;
}
.pd-empty-note {
    font-size: 0.8rem;
    color: #94a3b8;
    font-style: italic;
    margin: 0;
}

.pd-evidence-trigger {
    display: block;
    width: 100%;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: none;
    cursor: pointer;
    overflow: hidden;
}
.pd-evidence-trigger img { display: block; width: 100%; max-height: 340px; object-fit: cover; }

/* ---------- CONTEXTO DEL TIPSTER ---------- */
.pd-form-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
}
.pd-form-caption { font-size: 0.72rem; color: #94a3b8; }
.pd-form-chips { display: flex; gap: 0.25rem; }
.pd-form-chip {
    width: 20px; height: 20px;
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 0.62rem; font-weight: 700;
}
.pd-reliability-chip {
    margin-left: auto;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border: 1px solid;
    border-radius: 4px;
}

.pd-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}
.pd-stat { display: flex; flex-direction: column; gap: 0.15rem; text-align: center; }
.pd-stat .v { font-size: 1rem; font-weight: 700; color: #0f172a; font-variant-numeric: tabular-nums; }
.pd-stat .l { font-size: 0.62rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.02em; }

/* ---------- INTERACCIÓN ---------- */
.pd-reactions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
}
.pd-react-form { display: inline-flex; }
.pd-react-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
    color: #64748b;
    cursor: pointer;
    text-decoration: none;
}
.pd-react-btn:hover { border-color: #cbd5e1; }
.pd-react-btn.active { background: #eef2ff; }
.pd-reactions-total { font-size: 0.72rem; color: #94a3b8; }
.pd-share-btn {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #0f172a;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
}
.pd-report-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    color: #94a3b8;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
}
.pd-report-btn:hover { color: #ef4444; border-color: #fca5a5; }

.pd-comment-form { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.pd-comment-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
}
.pd-comment-submit {
    background: #0f172a;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
.pd-comment-list { display: flex; flex-direction: column; gap: 0.85rem; }
.pd-comment-item { display: flex; gap: 0.6rem; }
.pd-comment-avatar, .pd-comment-avatar-fallback {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    object-fit: cover;
}
.pd-comment-avatar-fallback {
    display: flex; align-items: center; justify-content: center;
    background: #e2e8f0; color: #475569; font-size: 0.68rem; font-weight: 700;
}
.pd-comment-body p { margin: 0.15rem 0; font-size: 0.82rem; color: #1e293b; }
.pd-comment-author { font-size: 0.78rem; font-weight: 700; color: #0f172a; }
.pd-comment-time { font-size: 0.68rem; color: #94a3b8; }

/* INST27: texto de comentario (conserva saltos de línea de una edición) y
   controles Editar / Ocultar del autor, integrados en el bloque actual */
.pd-comment-body { min-width: 0; flex: 1 1 auto; }
.pd-comment-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.pd-comment-text[hidden],
.pd-comment-own[hidden],
.pd-comment-status[hidden] { display: none; }
.pd-comment-own { display: flex; gap: 0.75rem; margin-top: 0.15rem; }
.pd-comment-own-btn {
    padding: 0.1rem 0;
    border: 0;
    background: none;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
}
.pd-comment-own-btn:hover { color: #4f46e5; text-decoration: underline; }
.pd-comment-own-btn:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; border-radius: 2px; }
.pd-comment-own-btn:disabled { opacity: 0.6; cursor: progress; text-decoration: none; }
.pd-comment-edit { margin: 0.3rem 0; }
.pd-comment-edit-input {
    display: block;
    width: 100%;
    min-height: 68px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font: inherit;
    font-size: 0.82rem;
    line-height: 1.45;
    resize: vertical;
    box-sizing: border-box;
}
.pd-comment-edit-input:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }
.pd-comment-edit-input.is-invalid { border-color: #fca5a5; }
.pd-comment-edit-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.4rem; }
.pd-comment-edit-actions { display: inline-flex; align-items: center; gap: 0.75rem; }
.pd-comment-count { font-size: 0.72rem; color: #94a3b8; font-variant-numeric: tabular-nums; }
.pd-comment-count.is-over { color: #b91c1c; font-weight: 700; }
.pd-comment-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.pd-comment-item[aria-busy="true"] .pd-comment-edit-input { opacity: 0.75; }
.pd-comment-status { margin: 0.5rem 0 0 0; font-size: 0.74rem; color: #047857; }
.pd-comment-status.is-error { color: #b91c1c; font-weight: 600; }
.pd-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.pd-meta {
    text-align: center;
    font-size: 0.72rem;
    color: #94a3b8;
    padding: 0.5rem 0 1rem;
}

.pd-not-found {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 4rem 2rem;
    text-align: center;
    color: #64748b;
}
.pd-not-found i { font-size: 2.5rem; color: #cbd5e1; margin-bottom: 1rem; display: block; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 575.98px) {
    .pd-card { padding: 0.85rem 1rem; }
    .pd-pick-text { font-size: 1.1rem; }
    .pd-odds-value { font-size: 1.1rem; }
    .pd-team-logo { width: 36px; height: 36px; }
    .pd-team-name { font-size: 0.72rem; }
    .pd-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .pd-share-btn span { display: none; }
    .pd-tipster-bar { flex-direction: column; align-items: flex-start; }
    .pd-comment-edit-input { font-size: 16px; }   /* evita el zoom automático de iOS */
    .pd-comment-own-btn { min-height: 36px; }
}
