/* ============================================
   BEAUTIFUL TIMELINE STYLING
   ============================================ */

/* Main Timeline Container */
.timeline {
    position: relative;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #4f46e5, #7c3aed, #db2777);
    border-radius: 3px;
}

.timeline ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Timeline Items */
.timeline li.note_public {
    position: relative;
    margin-bottom: 2.5rem;
    padding-left: 70px;
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
}

.timeline li.note_public:nth-child(odd) {
    animation-delay: 0.1s;
}

.timeline li.note_public:nth-child(even) {
    animation-delay: 0.2s;
}

/* Timeline Bullet */
.timeline li.note_public::before {
    content: '';
    position: absolute;
    left: 24px;
    top: 5px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 4px solid;
    z-index: 2;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.9),
                0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.timeline li.note_public:hover::before {
    transform: scale(1.2);
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.9),
                0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Color coding for different types of notes */
.timeline li.note_public[class*="status"]::before {
    border-color: #10b981; /* Green for status changes */
}

.timeline li.note_public:contains("Customer")::before {
    border-color: #8b5cf6; /* Purple for customer changes */
}

.timeline li.note_public:contains("Model")::before,
.timeline li.note_public:contains("Device")::before {
    border-color: #f59e0b; /* Amber for device updates */
}

.timeline li.note_public:contains("Payment")::before {
    border-color: #ef4444; /* Red for payment changes */
}

.timeline li.note_public:contains("Feedback")::before {
    border-color: #3b82f6; /* Blue for feedback */
}

.timeline li.note_public:contains("Converted")::before {
    border-color: #06b6d4; /* Cyan for conversions */
}

/* Note Content Card */
.timeline .note_content {
    background: white;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    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 #e5e7eb;
    position: relative;
    transition: all 0.3s ease;
}

.timeline .note_content::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 15px;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid white;
}

.timeline .note_content::after {
    content: '';
    position: absolute;
    left: -11px;
    top: 15px;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-right: 10px solid #e5e7eb;
    z-index: -1;
}

.timeline li.note_public:hover .note_content {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
                0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-color: #d1d5db;
}

/* Content Styling */
.timeline .note_content p {
    margin: 0;
    color: #374151;
    line-height: 1.6;
    font-size: 0.8125rem;
}

.timeline .note_content strong {
    color: #1f2937;
    font-weight: 600;
    background: linear-gradient(120deg, rgba(79, 70, 229, 0.1) 0%, rgba(124, 58, 237, 0.1) 100%);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    display: inline-block;
    margin: 0.125rem;
}

.timeline .note_content br + strong {
    margin-top: 0.5rem;
}

/* Meta Information */
.timeline .meta {
    margin-top: 0.75rem;
    padding-left: 1.5rem;
    font-size: 0.75rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.timeline .meta::before {
    content: '🕒';
    font-size: 0.75rem;
}

.timeline .meta strong {
    color: #4f46e5;
    font-weight: 600;
    background: rgba(79, 70, 229, 0.1);
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-delivered {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.status-new {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.status-pending {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

/* Timeline Date Styling */
.timeline-date {
    position: absolute;
    left: -120px;
    top: 5px;
    width: 90px;
    text-align: right;
    font-size: 0.8125rem;
    color: #6b7280;
    font-weight: 500;
}

/* Highlight important events */
.timeline li.note_public:first-child .note_content {
    border-left: 4px solid #10b981;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.05) 0%, rgba(255, 255, 255, 1) 10%);
}

.timeline li.note_public:last-child {
    margin-bottom: 0;
}

.timeline li.note_public:last-child .note_content {
    border-left: 4px solid #3b82f6;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.05) 0%, rgba(255, 255, 255, 1) 10%);
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .timeline {
        padding-left: 0;
    }
    
    .timeline::before {
        left: 20px;
    }
    
    .timeline li.note_public {
        padding-left: 50px;
    }
    
    .timeline li.note_public::before {
        left: 14px;
        width: 14px;
        height: 14px;
    }
    
    .timeline-date {
        position: relative;
        left: 0;
        top: 0;
        width: auto;
        text-align: left;
        margin-bottom: 0.5rem;
    }
    
    .timeline .meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .timeline .note_content {
        padding: 1rem;
    }
    
    .timeline .note_content::before,
    .timeline .note_content::after {
        display: none;
    }
}

/* Hover Effects */
.timeline li.note_public:hover {
    padding-left: 75px;
    transition: padding-left 0.3s ease;
}

/* Scrollbar for timeline */
.timeline {
    max-height: 900px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #c7d2fe #f3f4f6;
}

.timeline::-webkit-scrollbar {
    width: 6px;
}

.timeline::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
}

.timeline::-webkit-scrollbar-thumb {
    background: #c7d2fe;
    border-radius: 3px;
}

.timeline::-webkit-scrollbar-thumb:hover {
    background: #a5b4fc;
}

/* Loading Animation */
.timeline-loading {
    display: flex;
    justify-content: center;
    padding: 2rem;
}

.timeline-loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Empty State */
.timeline-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.timeline-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #d1d5db;
}

/* Print Styles */
@media print {
    .timeline {
        max-height: none;
        overflow: visible;
    }
    
    .timeline::before {
        background: #d1d5db;
    }
    
    .timeline .note_content {
        box-shadow: none;
        border: 1px solid #d1d5db;
    }
}

/* File Preview */
.file-preview-item {
    display: inline-flex;
    align-items: center;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.5rem;
    margin: 0.25rem;
    font-size: 0.8125rem;
}

.file-preview-item .remove-file {
    margin-left: 0.5rem;
    cursor: pointer;
    color: #dc3545;
}

/* Animation */
.collapsing {
    transition: height 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .timeline {
        padding-left: 20px;
    }
    
    .timeline-item::before {
        left: -18px;
    }
}