/* Live Workspace Session Updates - Dedicated Styles */

/* Popup container - right side, full height, auto-width */
#live-updates-popup {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 400px;
    max-width: calc(35vw - 40px); /* Same width restriction as other popups */
    background: white;
    box-shadow: -5px 0 20px rgba(0,0,0,0.15);
    z-index: 1000;
    display: none; /* Hidden by default */
    flex-direction: column;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.3s ease;
}

#live-updates-popup.open {
    display: flex; /* Show when open */
}

/* Responsive sizing - same as other popups */
@media (max-width: 768px) {
    #live-updates-popup {
        width: 300px;
        max-width: calc(40vw - 20px);
    }
}

@media (max-width: 480px) {
    #live-updates-popup {
        width: calc(100vw - 40px);
        max-width: calc(100vw - 40px);
        right: 10px;
    }
}

.popup-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.popup-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.popup-header-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.popup-minimize-btn,
.popup-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    transition: background 0.2s;
}

.popup-minimize-btn:hover,
.popup-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.popup-status {
    padding: 10px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    flex-shrink: 0;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28a745;
    animation: pulse 2s infinite;
}

.status-dot.disconnected {
    background: #dc3545;
    animation: none;
}

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

.popup-updates-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #ffffff;
}

/* Custom scrollbar */
.popup-updates-container::-webkit-scrollbar {
    width: 6px;
}

.popup-updates-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.popup-updates-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.popup-updates-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.update-item {
    background: #f8f9fa;
    border-left: 3px solid #28a745;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 4px;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.update-item .timestamp {
    font-size: 10px;
    color: #6c757d;
    margin-bottom: 4px;
}

.update-item .type {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 6px;
}

.update-item .content {
    color: #333;
    font-size: 13px;
    word-wrap: break-word;
    line-height: 1.4;
    background: #e6f7f1; /* Very light waterish green */
    padding: 8px;
    border-radius: 4px;
}

/* RTL content styling for Arabic and Hebrew */
.update-item .content.rtl-content {
    text-align: right;
    direction: rtl;
}

/* Analysis HTML Content Styling */
.update-item .analysis-html-content {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

/* RTL support for analysis HTML content */
.update-item .analysis-html-content.rtl-content {
    text-align: right;
    direction: rtl;
}

/* Style common analysis HTML elements */
.update-item .analysis-html-content h1,
.update-item .analysis-html-content h2,
.update-item .analysis-html-content h3,
.update-item .analysis-html-content h4 {
    margin: 8px 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
}

.update-item .analysis-html-content p {
    margin: 4px 0;
    font-size: 14px;
    line-height: 1.4;
}

.update-item .analysis-html-content ul,
.update-item .analysis-html-content ol {
    margin: 4px 0;
    padding-left: 20px;
    font-size: 14px;
}

.update-item .analysis-html-content li {
    margin: 2px 0;
}

.update-item .analysis-html-content strong,
.update-item .analysis-html-content b {
    color: #495057;
    font-weight: 600;
}

.update-item .analysis-html-content em,
.update-item .analysis-html-content i {
    color: #6c757d;
}

.update-item .analysis-html-content code {
    background: #f8f9fa;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 11px;
}

.update-item .analysis-html-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    margin: 4px 0;
}

.update-item .analysis-html-content th,
.update-item .analysis-html-content td {
    border: 1px solid #dee2e6;
    padding: 4px;
    text-align: left;
}

.update-item .analysis-html-content th {
    background: #f8f9fa;
    font-weight: 600;
}

/* Custom scrollbar for analysis content */
.update-item .analysis-html-content::-webkit-scrollbar {
    width: 4px;
}

.update-item .analysis-html-content::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 2px;
}

/* Audio Player Styling */
.update-item .audio-player-content {
    padding: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

.audio-player {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.audio-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.audio-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 4px;
    background: #667eea;
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.audio-btn:hover {
    background: #5568d3;
    transform: scale(1.05);
}

.audio-btn:active {
    transform: scale(0.95);
}

.audio-btn.stop-btn {
    background: #dc3545;
}

.audio-btn.stop-btn:hover {
    background: #c82333;
}

.audio-status {
    font-size: 11px;
    color: #6c757d;
    font-style: italic;
}

.update-item .meta {
    margin-top: 6px;
    font-size: 10px;
    color: #6c757d;
    line-height: 1.3;
}

.no-updates {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.no-updates-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.popup-controls {
    padding: 10px 15px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.popup-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    flex: 1;
}

.popup-btn-clear {
    background: #dc3545;
    color: white;
}

.popup-btn-clear:hover {
    background: #c82333;
}

/* Update counter badge */
.update-counter {
    background: #28a745;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

