/* Enhanced Dashboard Styles */

/* Expandable activity items */
.activity-item.expandable {
    cursor: pointer;
    transition: all 0.3s ease;
}

.activity-item.expandable:hover {
    background: #f8fafc;
    transform: translateX(5px);
}

.activity-item.expanded {
    background: #f0f4ff;
    border-left: 4px solid #667eea;
}

.expand-indicator {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #667eea;
    transition: transform 0.3s ease;
}

.activity-item.expanded .expand-indicator {
    transform: translateY(-50%) rotate(180deg);
}

/* Expanded details */
.activity-expanded {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-top: none;
    padding: 20px;
    margin-top: -1px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

.expanded-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.detail-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row strong {
    min-width: 120px;
    color: #4a5568;
    font-weight: 600;
}

/* Message content */
.message-content {
    margin-top: 15px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.message-text {
    margin-top: 10px;
    padding: 12px;
    background: white;
    border-radius: 6px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
}

/* Notification content */
.notification-content {
    margin-top: 10px;
    padding: 15px;
    background: #fff5f5;
    border-radius: 8px;
    border-left: 4px solid #e53e3e;
}

.notification-title {
    font-size: 16px;
    margin-bottom: 8px;
    color: #2d3748;
}

/* Map container */
.map-container {
    border: 2px solid #e2e8f0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Media preview */
.media-preview {
    margin-top: 15px;
    text-align: center;
}

.media-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.media-preview img:hover {
    transform: scale(1.02);
}

.media-preview audio {
    margin-top: 10px;
}

/* Image viewer modal */
.image-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-viewer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.image-viewer-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 10001;
}

.image-viewer-content img {
    max-width: 100%;
    max-height: 70vh;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e53e3e;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10002;
}

.close-btn:hover {
    background: #c53030;
    transform: rotate(90deg);
}

.image-viewer-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* Enhanced media gallery */
.media-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.media-item:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-4px);
}

.media-thumbnail {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    cursor: pointer;
}

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

.media-thumbnail:hover img {
    transform: scale(1.1);
}

.media-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: white;
    font-weight: 600;
}

.media-thumbnail:hover .media-overlay {
    opacity: 1;
}

.media-audio {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.audio-icon {
    font-size: 48px;
    opacity: 0.7;
}

.media-placeholder {
    height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    color: #a0aec0;
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.media-info {
    padding: 15px;
    border-top: 1px solid #e2e8f0;
}

.media-info strong {
    display: block;
    margin-bottom: 5px;
    color: #2d3748;
}

.media-info small {
    display: block;
    color: #718096;
    margin-bottom: 10px;
}

.media-info .btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    margin-top: 8px;
}

/* Empty state improvements */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #a0aec0;
}

.empty-state .icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #718096;
}

.empty-state small {
    font-size: 14px;
    color: #a0aec0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .detail-row {
        flex-direction: column;
        gap: 5px;
    }
    
    .detail-row strong {
        min-width: auto;
    }
    
    .image-viewer-content {
        max-width: 95vw;
        padding: 15px;
    }
    
    .image-viewer-content img {
        max-height: 60vh;
    }
    
    .media-thumbnail {
        height: 150px;
    }
    
    .expand-indicator {
        right: 10px;
    }
}

/* Loading states */
.activity-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

.activity-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 20px;
    width: 20px;
    height: 20px;
    border: 2px solid #667eea;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Button styles */
.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 6px;
    border: none;
    background: #667eea;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-sm:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* Scrollbar styling */
.message-text::-webkit-scrollbar {
    width: 8px;
}

.message-text::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.message-text::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.message-text::-webkit-scrollbar-thumb:hover {
    background: #555;
}
