/**
 * DIESELNET - Timeline Component
 * Visual timeline pentru istoric reparații și evenimente
 */

/* ============================================ */
/* TIMELINE STYLES                             */
/* ============================================ */

.timeline-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.timeline-header {
    text-align: center;
    margin-bottom: 50px;
}

.timeline-title {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 10px;
}

.timeline-subtitle {
    font-size: 1.1rem;
    color: #64748b;
}

/* Timeline Line */
.timeline {
    position: relative;
    padding: 0;
    list-style: none;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, #06b6d4 0%, #0891b2 100%);
    transform: translateX(-50%);
    border-radius: 2px;
}

/* Timeline Items */
.timeline-item {
    position: relative;
    margin-bottom: 50px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.timeline-item.revealed {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item:nth-child(odd) {
    padding-right: calc(50% + 40px);
    text-align: right;
}

.timeline-item:nth-child(even) {
    padding-left: calc(50% + 40px);
    text-align: left;
}

/* Timeline Dot */
.timeline-dot {
    position: absolute;
    left: 50%;
    top: 0;
    width: 20px;
    height: 20px;
    background: white;
    border: 4px solid #06b6d4;
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 2;
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.2);
    transition: all 0.3s;
}

.timeline-item:hover .timeline-dot {
    transform: translateX(-50%) scale(1.3);
    box-shadow: 0 0 0 8px rgba(6, 182, 212, 0.3);
}

/* Timeline Dot Icons */
.timeline-dot-icon {
    position: absolute;
    left: 50%;
    top: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.4);
    transition: all 0.3s;
}

.timeline-item:hover .timeline-dot-icon {
    transform: translateX(-50%) scale(1.15) rotate(360deg);
}

/* Timeline Content Card */
.timeline-content {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 2px solid #f1f5f9;
    transition: all 0.3s;
    position: relative;
}

.timeline-item:hover .timeline-content {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: #06b6d4;
}

/* Timeline Arrow */
.timeline-content::before {
    content: '';
    position: absolute;
    top: 10px;
    width: 0;
    height: 0;
    border-style: solid;
}

.timeline-item:nth-child(odd) .timeline-content::before {
    right: -20px;
    border-width: 10px 0 10px 20px;
    border-color: transparent transparent transparent white;
}

.timeline-item:nth-child(even) .timeline-content::before {
    left: -20px;
    border-width: 10px 20px 10px 0;
    border-color: transparent white transparent transparent;
}

/* Timeline Date */
.timeline-date {
    display: inline-block;
    padding: 6px 16px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #0891b2;
    margin-bottom: 12px;
}

/* Timeline Title */
.timeline-item-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
}

/* Timeline Description */
.timeline-item-description {
    font-size: 0.95rem;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 16px;
}

/* Timeline Meta */
.timeline-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.timeline-item:nth-child(odd) .timeline-meta {
    justify-content: flex-end;
}

.timeline-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #64748b;
}

.timeline-meta-item i {
    color: #06b6d4;
}

/* Timeline Status Badge */
.timeline-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timeline-status.completed {
    background: #d1fae5;
    color: #065f46;
}

.timeline-status.in-progress {
    background: #fef3c7;
    color: #92400e;
}

.timeline-status.pending {
    background: #e0e7ff;
    color: #3730a3;
}

.timeline-status.cancelled {
    background: #fee2e2;
    color: #991b1b;
}

/* Timeline Actions */
.timeline-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.timeline-item:nth-child(odd) .timeline-actions {
    justify-content: flex-end;
}

.timeline-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.timeline-btn-primary {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    color: white;
}

.timeline-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.timeline-btn-secondary {
    background: white;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.timeline-btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

/* Timeline Types */
.timeline-item.type-repair .timeline-dot-icon {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
}

.timeline-item.type-maintenance .timeline-dot-icon {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.timeline-item.type-diagnostic .timeline-dot-icon {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.timeline-item.type-inspection .timeline-dot-icon {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

/* Dark Mode */
body.dark-mode .timeline-title {
    color: #f1f5f9;
}

body.dark-mode .timeline::before {
    background: linear-gradient(180deg, #06b6d4 0%, #0891b2 100%);
}

body.dark-mode .timeline-content {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .timeline-item-title {
    color: #f1f5f9;
}

body.dark-mode .timeline-date {
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
    color: #06b6d4;
}

body.dark-mode .timeline-meta {
    border-top-color: #334155;
}

body.dark-mode .timeline-btn-secondary {
    background: #334155;
    border-color: #475569;
    color: #cbd5e1;
}

/* Responsive */
@media (max-width: 768px) {
    .timeline::before {
        left: 20px;
    }

    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        padding-left: 60px;
        padding-right: 0;
        text-align: left;
    }

    .timeline-dot-icon {
        left: 20px;
    }

    .timeline-item:nth-child(odd) .timeline-content::before {
        left: -20px;
        right: auto;
        border-width: 10px 20px 10px 0;
        border-color: transparent white transparent transparent;
    }

    .timeline-item:nth-child(odd) .timeline-meta,
    .timeline-item:nth-child(odd) .timeline-actions {
        justify-content: flex-start;
    }

    .timeline-meta {
        flex-direction: column;
        gap: 8px;
    }
}

/* Empty State */
.timeline-empty {
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.timeline-empty i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.timeline-empty-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 10px;
}

.timeline-empty-text {
    font-size: 1rem;
    margin-bottom: 24px;
}

/* Loading State */
.timeline-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.timeline-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f1f5f9;
    border-top-color: #06b6d4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.timeline-loading-text {
    margin-top: 20px;
    color: #64748b;
    font-size: 1rem;
}