/* Timeline-specific styles for Epoch game */

.timeline-container {
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #4B5563 #1F2937;
    -webkit-overflow-scrolling: touch;
    /* Allow both panning and manipulation for better touch experience */
    touch-action: manipulation;
}

.timeline-container::-webkit-scrollbar {
    height: 6px;
}

.timeline-container::-webkit-scrollbar-track {
    background: #1F2937;
}

.timeline-container::-webkit-scrollbar-thumb {
    background: #4B5563;
    border-radius: 3px;
}

.event-card {
    transition: all 0.2s ease;
    cursor: grab;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    aspect-ratio: 3/4;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
    max-width: 180px;
    min-width: 160px;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Prevent touch actions only during active dragging */
.event-card[data-event-id="current"] {
    touch-action: manipulation;
}

.event-card[data-event-id="current"]:active {
    touch-action: none;
}

/* Mobile-specific event card styles */
@media (max-width: 768px) {
    .event-card {
        min-height: 160px;
        max-width: 140px;
        min-width: 120px;
        margin: 0 4px;
    }
}

.event-card:active {
    cursor: grabbing;
}

.event-card.dragging {
    transform: scale(1.05);
    z-index: 50;
    opacity: 0.9;
}

.drop-zone {
    min-height: 200px;
    transition: all 0.2s ease;
}

.drop-zone.drag-over {
    background-color: #1E40AF;
    border-color: #3B82F6;
}

.timeline-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, #4B5563, #6B7280, #4B5563);
    z-index: 0;
}

/* Text truncation utility for long descriptions */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 12px;
}

/* Timeline event transitions */
.timeline-event {
    transition: border-left 0.2s ease-in-out, margin-left 0.2s ease-in-out;
}


.timeline-events {
    transition: all 0.3s ease-in-out;
}

/* Drag clone styles */
.drag-clone {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    transform-origin: center;
    transition: none !important;
    /* Better mobile performance */
    will-change: transform;
}

.event-card:active {
    cursor: grabbing !important;
}

.timeline-container {
    min-height: 220px;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .timeline-container {
        min-height: 180px;
        padding: 16px 8px;
        margin: 0 -8px;
        /* Better mobile scrolling */
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        /* Prevent scrolling conflicts during drag */
        overscroll-behavior-x: contain;
    }
    
    .timeline-events {
        gap: 8px;
    }
    
    .card-content {
        padding: 8px;
    }
    
    .event-card h4 {
        font-size: 0.75rem;
        line-height: 1.2;
    }
    
    .event-card p {
        font-size: 0.65rem;
        line-height: 1.3;
    }
    
    .event-card .font-mono {
        font-size: 0.6rem;
        padding: 4px 6px;
    }
}
