/* DigiSense Timeline Grid - Styles */

.timeline-grid-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Timeline Slider Styles */
.timeline-slider-container {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 25px;
    color: #2d3748;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.timeline-header h3 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
    color: #2d3748;
}

.timeline-current-date {
    text-align: right;
    font-size: 1.0em;
    color: #4a5568;
}

.timeline-current-date .current-month {
    font-weight: 700;
    font-size: 1.2em;
    display: block;
}

.timeline-current-date .current-year {
    opacity: 0.8;
    font-size: 0.9em;
}

.timeline-slider-wrapper {
    position: relative;
}

.timeline-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.8em;
    color: #718096;
}

.timeline-slider {
    position: relative;
    margin: 8px 0 10px 0;
    height: 30px;
}

.timeline-date-tooltip {
    position: absolute;
    top: -35px;
    left: 0;
    background: #2d3748;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75em;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    transform: translateX(-50%);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
}

.timeline-date-tooltip:before {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid #2d3748;
}

.timeline-date-tooltip.active {
    opacity: 1;
}

.timeline-input {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.timeline-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 18px;
    border-radius: 3px;
    background: #4299e1;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(66, 153, 225, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.timeline-input::-webkit-slider-thumb:before {
    content: "🚗";
    position: absolute;
    top: -3px;
    left: 1px;
    font-size: 14px;
}

.timeline-input::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(66, 153, 225, 0.4);
}

.timeline-input::-moz-range-thumb {
    width: 24px;
    height: 18px;
    border-radius: 3px;
    background: #4299e1;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(66, 153, 225, 0.3);
}

.timeline-reset {
    background: #667eea;
    border: 1px solid #667eea;
    color: white;
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 0.8em;
    transition: all 0.3s ease;
    font-weight: 500;
}

.timeline-reset:hover {
    background: #5a67d8;
    border-color: #5a67d8;
    transform: translateY(-1px);
}

/* Articles Grid */
.timeline-articles-grid {
    display: grid;
    gap: 25px;
    grid-template-columns: repeat(5, 1fr);
    margin-bottom: 30px;
}

/* For very large screens */
@media (min-width: 1600px) {
    .timeline-articles-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 25px;
    }
}

/* Articles Cards */
.timeline-article-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
}

.timeline-article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.article-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.article-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.card-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.timeline-article-card:hover .card-thumbnail {
    transform: scale(1.05);
}

.no-thumbnail {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
}

.article-date-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.article-content {
    padding: 20px;
}

.article-title {
    margin: 0 0 10px 0;
    font-size: 1.1em;
    font-weight: 600;
    line-height: 1.4;
    color: #2d3748;
}

.article-excerpt {
    color: #718096;
    font-size: 0.9em;
    line-height: 1.5;
    margin: 0;
}

/* Loading & Load More */
.timeline-loading {
    text-align: center;
    padding: 40px;
    color: #718096;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.timeline-load-more-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.timeline-load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.timeline-load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.no-articles {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #718096;
    font-size: 1.1em;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #e2e8f0;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .timeline-articles-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

@media (max-width: 1024px) {
    .timeline-articles-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .timeline-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .timeline-articles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .timeline-slider-container {
        padding: 12px 15px;
        margin-bottom: 18px;
    }
    
    .timeline-header h3 {
        font-size: 1.2em;
    }
    
    .article-image {
        height: 160px;
    }
    
    .article-content {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .timeline-articles-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .timeline-grid-wrapper {
        padding: 15px;
    }
    
    .timeline-slider-container {
        padding: 15px;
        margin-bottom: 25px;
    }
    
    .timeline-labels {
        font-size: 0.8em;
    }
    
    .timeline-current-date {
        font-size: 1em;
    }
}

/* Animation d'entrée */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.timeline-article-card {
    animation: fadeInUp 0.6s ease-out;
}

.timeline-article-card:nth-child(odd) {
    animation-delay: 0.1s;
}

.timeline-article-card:nth-child(even) {
    animation-delay: 0.2s;
}
