/* Explorador de Referencias */
.references-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.reference-card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-sm);
}

.reference-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.reference-photo-container {
    height: 180px;
    background: #f1f5f9;
    position: relative;
    overflow: hidden;
}

.reference-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.reference-card:hover .reference-photo {
    transform: scale(1.05);
}

.reference-no-photo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 0.8rem;
    gap: 10px;
}

.reference-no-photo span {
    font-size: 2rem;
}

.reference-badge-zona {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: bold;
    backdrop-filter: blur(4px);
}

.reference-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reference-address {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-main);
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.reference-address i {
    color: var(--primary);
    margin-top: 3px;
}

.reference-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.reference-obs {
    font-size: 0.85rem;
    color: var(--text-main);
    background: var(--bg-body);
    padding: 10px;
    border-radius: 8px;
    border-left: 3px solid var(--primary);
    margin: 5px 0;
    line-height: 1.4;
}

.reference-transcription {
    font-size: 0.85rem;
    color: var(--text-main);
    background: #fdf2f8;
    /* Light pink background to differentiate */
    padding: 10px;
    border-radius: 8px;
    border-left: 3px solid #db2777;
    /* Pink border */
    margin: 5px 0;
    line-height: 1.4;
    font-style: italic;
}

.reference-footer {
    padding: 12px 15px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(var(--primary-rgb), 0.02);
}

.reference-ujier {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.reference-date {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.btn-map-ref {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 640px) {
    .references-grid {
        grid-template-columns: 1fr;
    }
}

/* Timeline Styles */
.timeline-container {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.timeline-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-steps {
    position: relative;
    padding-left: 10px;
    /* Ensure line connects steps */
    display: flex;
    flex-direction: column;
}

/* Vertical line connecting steps */
.timeline-steps::before {
    content: '';
    position: absolute;
    left: 23px;
    /* Center of the marker (10px padding + 13px radius) */
    top: 15px;
    bottom: 30px;
    width: 2px;
    background: var(--border-color);
    z-index: 0;
}

.timeline-step {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

/* Circle Number Marker */
.step-marker {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    /* Background color set inline by JS */
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid var(--bg-card);
    /* White border to separate from line */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.step-content {
    background: var(--bg-body);
    padding: 12px 15px;
    border-radius: 8px;
    flex-grow: 1;
    border: 1px solid var(--border-color);
}

.step-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    align-items: baseline;
}

.step-time {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8rem;
}

.step-status {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

.step-address {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 500;
}

/* Map Icon Fixes */
.custom-map-icon {
    background: transparent;
    border: none;
}

/* Ensure timeline is responsive */
@media (max-width: 480px) {
    .timeline-container {
        padding: 15px;
    }

    .step-content {
        padding: 10px;
    }

    .step-address {
        font-size: 0.85rem;
    }
}