/* Content/css/tracking-popup.css
   Estilos del popup de tracking.
   Incluir en el _Layout.cshtml o en las tres vistas que lo usan:
   @Styles.Render("~/Content/css/tracking-popup.css")
*/

/* ── Overlay & modal container ────────────────────────────────────────── */
#trkOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .50);
    z-index: 1050;
    align-items: center;
    justify-content: center;
}
#trkOverlay.trk-open {
    display: flex;
}
#trkOverlay.trk-closing {
    animation: trkFadeOut .15s ease forwards;
}

.trk-modal-wrap {
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 560px;
    margin: 1rem;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0,0,0,.18);
    animation: trkSlideIn .18s ease;
}

@keyframes trkSlideIn {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes trkFadeOut {
    to { opacity: 0; }
}

/* ── Loading skeleton ──────────────────────────────────────────────────── */
.trk-loading {
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: #6B7280;
    font-size: 14px;
}
.trk-skeleton {
    background: #E5E7EB;
    border-radius: 4px;
    animation: trkPulse 1.2s ease-in-out infinite;
    margin-bottom: 10px;
}
@keyframes trkPulse {
    0%,100% { opacity: 1; } 50% { opacity: .45; }
}

/* ── Header ────────────────────────────────────────────────────────────── */
.trk-header {
    background: #1E3A5F;
    padding: .9rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.trk-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.trk-header-icon {
    color: #90B4D6;
    font-size: 22px;
}
.trk-title {
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    margin: 0;
}
.trk-id {
    color: #90B4D6;
    font-size: 13px;
    font-family: monospace;
    margin: 0;
}
.trk-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
.trk-close-btn {
    background: transparent;
    border: none;
    color: #90B4D6;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
}
.trk-close-btn:hover { color: #fff; }

/* ── Badge ─────────────────────────────────────────────────────────────── */
.trk-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}
.trk-badge-entregada  { background: #D1FAE5; color: #065F46; }
.trk-badge-transito   { background: #DBEAFE; color: #1E40AF; }
.trk-badge-incidencia { background: #FEF3C7; color: #92400E; }

/* ── Body ──────────────────────────────────────────────────────────────── */
.trk-body {
    padding: 1.25rem;
}

/* Cuadrícula resumen */
.trk-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 1.25rem;
}
@media (max-width: 420px) {
    .trk-grid { grid-template-columns: 1fr; }
}
.trk-field {
    background: #F9FAFB;
    border-radius: 8px;
    padding: 10px 12px;
}
.trk-label {
    font-size: 11px;
    color: #6B7280;
    margin: 0 0 3px;
    text-transform: uppercase;
    letter-spacing: .4px;
}
.trk-value {
    font-size: 14px;
    color: #111827;
    font-weight: 500;
    margin: 0;
}
.trk-mono { font-family: monospace; font-size: 13px; }

/* Título de sección */
.trk-section-title {
    font-size: 12px;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 0 0 12px;
}

/* ── Timeline ──────────────────────────────────────────────────────────── */
.trk-timeline {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}
.trk-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}
.trk-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 14px;
    left: 50%;
    width: 100%;
    height: 2px;
    z-index: 0;
}
.trk-step.done::after   { background: #1D9E75; }
.trk-step.active::after { background: #D1D5DB; }
.trk-step.pending::after{ background: #D1D5DB; }
.trk-step.warn::after   { background: #F59E0B; }

.trk-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    z-index: 1;
    border: 2px solid;
    position: relative;
}
.trk-dot.done    { background: #D1FAE5; border-color: #1D9E75; color: #1D9E75; }
.trk-dot.active  { background: #DBEAFE; border-color: #185FA5; color: #185FA5; }
.trk-dot.pending { background: #F3F4F6; border-color: #D1D5DB; color: #9CA3AF; }
.trk-dot.warn    { background: #FEF3C7; border-color: #F59E0B; color: #92400E; }

.trk-step-label {
    font-size: 11px;
    color: #6B7280;
    text-align: center;
    margin-top: 6px;
    line-height: 1.3;
}
.trk-step-date {
    font-size: 10px;
    color: #9CA3AF;
    text-align: center;
    font-family: monospace;
}

/* ── Incidencia ────────────────────────────────────────────────────────── */
.trk-incidence {
    background: #FFFBEB;
    border: 1px solid #F59E0B;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 1rem;
    display: flex;
    gap: 10px;
}
.trk-incidence-icon  { color: #D97706; font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.trk-incidence-type  { font-size: 13px; font-weight: 500; color: #92400E; margin: 0 0 2px; }
.trk-incidence-desc  { font-size: 12px; color: #B45309; margin: 0; }

/* ── POD ───────────────────────────────────────────────────────────────── */
.trk-pod {
    background: #F0FDF4;
    border: 1px solid #86EFAC;
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.trk-pod-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.trk-pod-icon  { font-size: 18px; color: #1D9E75; }
.trk-pod-label { font-size: 13px; color: #166534; }

.trk-btn-pdf {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #185FA5;
    color: #185FA5;
    background: transparent;
    text-decoration: none;
    white-space: nowrap;
}
.trk-btn-pdf:hover { background: #EFF6FF; }

/* ── Footer ────────────────────────────────────────────────────────────── */
.trk-footer {
    border-top: 1px solid #F3F4F6;
    padding: 10px 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.trk-updated { font-size: 11px; color: #9CA3AF; }
.trk-btn-close {
    padding: 6px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid #D1D5DB;
    color: #6B7280;
    background: transparent;
}
.trk-btn-close:hover { background: #F9FAFB; }

/* ── Error state ───────────────────────────────────────────────────────── */
.trk-error .trk-body { padding: 2rem 1.25rem; text-align: center; }
