/**
 * Alert Timeline Styles for PascoWeather.com
 * Provides visual timeline for historical weather alerts
 */

/* Timeline Container */
.alert-timeline {
    position: relative;
    margin: 2rem 0;
    padding: 1rem 0;
}

/* Timeline Line */
.timeline-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background-color: var(--border-color);
    transform: translateX(-50%);
    z-index: 1;
}

/* Timeline Items */
.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    z-index: 2;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

/* Timeline Content */
.timeline-content {
    position: relative;
    width: calc(50% - 30px);
    padding: 1rem;
    border-radius: 0.375rem;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Timeline Item Positioning */
.timeline-item:nth-child(odd) .timeline-content {
    margin-left: auto;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-right: auto;
}

/* Timeline Connector */
.timeline-connector {
    position: absolute;
    top: 20px;
    width: 20px;
    height: 2px;
    background-color: var(--border-color);
}

.timeline-item:nth-child(odd) .timeline-connector {
    left: calc(50% - 20px);
}

.timeline-item:nth-child(even) .timeline-connector {
    right: calc(50% - 20px);
}

/* Timeline Dot */
.timeline-dot {
    position: absolute;
    top: 16px;
    left: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 2px solid white;
    transform: translateX(-50%);
    z-index: 3;
}

/* Timeline Date */
.timeline-date {
    position: absolute;
    top: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.timeline-item:nth-child(odd) .timeline-date {
    left: calc(50% + 20px);
}

.timeline-item:nth-child(even) .timeline-date {
    right: calc(50% + 20px);
    text-align: right;
}

/* Timeline Content Header */
.timeline-header {
    padding: 0.5rem;
    margin: -1rem -1rem 1rem -1rem;
    border-radius: 0.375rem 0.375rem 0 0;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Timeline Content Body */
.timeline-body {
    font-size: 0.9rem;
}

.timeline-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.timeline-description {
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.timeline-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Timeline Severity Colors */
.timeline-dot.severe {
    background-color: #dc3545;
}

.timeline-dot.moderate {
    background-color: #ffc107;
}

.timeline-dot.minor {
    background-color: #17a2b8;
}

.timeline-dot.expired {
    background-color: #6c757d;
}

.timeline-header.severe {
    background-color: #dc3545;
}

.timeline-header.moderate {
    background-color: #ffc107;
    color: #212529;
}

.timeline-header.minor {
    background-color: #17a2b8;
}

.timeline-header.expired {
    background-color: #6c757d;
}

/* Timeline Actions */
.timeline-actions {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
}

.timeline-actions .btn {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

/* Timeline Navigation */
.timeline-navigation {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
    gap: 0.5rem;
}

.timeline-navigation .btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.9rem;
}

/* Timeline Period Selector */
.timeline-period {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    gap: 0.5rem;
}

.timeline-period .btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.9rem;
}

/* Timeline Empty State */
.timeline-empty {
    text-align: center;
    padding: 2rem;
    background-color: var(--bg-secondary);
    border-radius: 0.375rem;
    margin: 1rem 0;
}

.timeline-empty i {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: block;
}

/* Timeline Loading State */
.timeline-loading {
    text-align: center;
    padding: 2rem;
}

.timeline-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .timeline-line {
        left: 30px;
    }
    
    .timeline-content {
        width: calc(100% - 60px);
        margin-left: 60px !important;
    }
    
    .timeline-connector {
        width: 30px;
    }
    
    .timeline-item:nth-child(odd) .timeline-connector,
    .timeline-item:nth-child(even) .timeline-connector {
        left: 30px;
    }
    
    .timeline-dot {
        left: 30px;
    }
    
    .timeline-date {
        left: 0 !important;
        right: auto !important;
        text-align: left !important;
        top: -20px;
    }
}

/* Dark Mode Adjustments */
[data-theme="dark"] .timeline-dot {
    border-color: var(--bg-color);
}

/* Animation for timeline items */
.timeline-item {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Staggered animation delay for timeline items */
.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.2s; }
.timeline-item:nth-child(3) { animation-delay: 0.3s; }
.timeline-item:nth-child(4) { animation-delay: 0.4s; }
.timeline-item:nth-child(5) { animation-delay: 0.5s; }
.timeline-item:nth-child(6) { animation-delay: 0.6s; }
.timeline-item:nth-child(7) { animation-delay: 0.7s; }
.timeline-item:nth-child(8) { animation-delay: 0.8s; }
.timeline-item:nth-child(9) { animation-delay: 0.9s; }
.timeline-item:nth-child(10) { animation-delay: 1.0s; }