/* Enhanced Date Labels and Time Display for Conversations */

/* ==================== DATE LABELS ==================== */

/* Date separator in conversation list */
.tk-list > div.tk-label-date,
.tk-label-date-top {
    text-align: center !important;
    margin: 25px 0 !important;
    position: relative !important;
    clear: both !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Remove any decorative lines - clean look */
.tk-list > div.tk-label-date::before,
.tk-list > div.tk-label-date::after,
.tk-label-date::before,
.tk-label-date::after {
    content: none !important;
    display: none !important;
    background: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Date label styling */
.tk-list > div.tk-label-date span,
.tk-label-date-top span {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

/* Hover effect for date labels */
.tk-list > div.tk-label-date span:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

/* Alternative style - Minimal */
.tk-list > div.tk-label-date.minimal span {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
    box-shadow: none;
}

/* Alternative style - Dark */
.tk-list > div.tk-label-date.dark span {
    background: #2d3748;
    color: #e2e8f0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Top date label (sticky date) */
.tk-label-date-top {
    position: sticky;
    top: 60px;
    z-index: 10;
    background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(255,255,255,0.95) 50%, rgba(255,255,255,0) 100%);
    padding: 10px 0 20px 0;
    margin: 0 !important;
}

.tk-label-date-top span {
    background: #ffffff;
    color: #495057;
    border: 2px solid #e1e4e8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ==================== TIME STAMPS ==================== */

/* Base time styling */
.tk-list .tk-time {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: #6c757d;
    letter-spacing: 0.3px;
    margin-top: 8px;
    transition: all 0.2s ease;
    position: relative;
}

/* Time hover effect */
.tk-list .tk-time:hover {
    background: rgba(0, 0, 0, 0.08);
    transform: translateX(2px);
}

/* Time for sent messages (right side) */
.tk-list > div.tk-right .tk-time {
    justify-content: flex-end;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.tk-list > div.tk-right .tk-time:hover {
    background: rgba(102, 126, 234, 0.15);
    transform: translateX(-2px);
}

/* Time for received messages (left side) */
.tk-list > div:not(.tk-right) .tk-time {
    justify-content: flex-start;
}

/* Today's time - special styling */
.tk-list .tk-time span:first-child:contains("Today") {
    font-weight: 600;
    color: #28a745;
}

/* Time with status icons */
.tk-list .tk-time i {
    font-size: 10px;
    opacity: 0.8;
}

/* Delivered status */
.tk-list .tk-time .tk-icon-check {
    color: #6c757d;
}

/* Read status */
.tk-list .tk-time .tk-icon-check-double {
    color: #667eea;
}

/* Sending status */
.tk-list [data-id="sending"] .tk-time {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

.tk-list [data-id="sending"] .tk-time i {
    animation: pulse 1.5s infinite;
}

/* Failed status */
.tk-list .tk-error .tk-time {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* Time in conversation list sidebar */
.tk-board > .tk-admin-list .tk-scroll-area li .tk-profile .tk-time {
    background: transparent;
    padding: 0;
    font-size: 12px;
    color: #868e96;
    font-weight: 400;
}

/* Unread conversation time - bold */
.tk-board > .tk-admin-list .tk-scroll-area li[data-conversation-status="2"] .tk-time {
    font-weight: 600;
    color: #495057;
}

/* ==================== ANIMATIONS ==================== */

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

/* Fade in animation for new dates/times */
.tk-label-date,
.tk-time {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
    /* Smaller date labels on mobile */
    .tk-list > div.tk-label-date span,
    .tk-label-date-top span {
        font-size: 11px;
        padding: 4px 14px;
    }
    
    /* Ensure no line decorations on mobile */
    .tk-list > div.tk-label-date::before,
    .tk-list > div.tk-label-date::after,
    .tk-label-date::before,
    .tk-label-date::after {
        display: none !important;
    }
    
    /* Smaller time stamps */
    .tk-list .tk-time {
        font-size: 10px;
        padding: 2px 6px;
    }
}

/* ==================== DARK MODE SUPPORT ==================== */

.tk-dark-mode .tk-list > div.tk-label-date span {
    background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
    color: #e2e8f0;
}

.tk-dark-mode .tk-list .tk-time {
    background: rgba(255, 255, 255, 0.05);
    color: #a0aec0;
}

.tk-dark-mode .tk-list > div.tk-right .tk-time {
    background: rgba(102, 126, 234, 0.2);
    color: #9ca3ea;
}

/* ==================== SPECIAL CASES ==================== */

/* Compact mode */
.tk-compact .tk-label-date {
    margin: 15px 0 !important;
}

.tk-compact .tk-label-date span {
    font-size: 10px;
    padding: 3px 12px;
}

.tk-compact .tk-time {
    font-size: 9px;
    padding: 1px 5px;
}

/* High contrast mode */
.tk-high-contrast .tk-label-date span {
    background: #000000;
    color: #ffffff;
    border: 2px solid #ffffff;
}

.tk-high-contrast .tk-time {
    background: #000000;
    color: #ffffff;
    border: 1px solid #ffffff;
}