/* MediaCircle Chat Test Styles */

body {
    font-family: 'DM Sans', system-ui, sans-serif;
    background: #000000;
}

.glass-card {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.gradient-text {
    background: linear-gradient(135deg, #60a5fa 0%, #a855f7 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.event-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.event-assistant-delta { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.event-assistant-complete { background: rgba(16, 185, 129, 0.2); color: #10b981; }
.event-intent-question { background: rgba(168, 85, 247, 0.2); color: #a855f7; }
.event-intent-complete { background: rgba(236, 72, 153, 0.2); color: #ec4899; }
.event-tool-call { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.event-tool-result { background: rgba(20, 184, 166, 0.2); color: #14b8a6; }
.event-artifact { background: rgba(139, 92, 246, 0.2); color: #8b5cf6; }
.event-status { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }
.event-llm-status { background: rgba(168, 85, 247, 0.2); color: #a855f7; }
.event-error { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.event-done { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.event-rag-search { background: rgba(99, 102, 241, 0.2); color: #818cf8; }
.event-rag-search-result { background: rgba(34, 211, 238, 0.2); color: #22d3ee; }

.chat-message {
    animation: fadeIn 0.2s ease-out;
}

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

.typing-indicator span {
    animation: bounce 1.4s infinite ease-in-out;
}
.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

.debug-panel {
    overflow-y: auto;
    min-height: 0; /* Required for flex child to allow shrinking/scrolling */
}

.json-content {
    font-size: 11px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Media Card Styles */
.media-card {
    background: #111;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.2s ease;
}

.media-card:hover {
    border-color: rgba(96, 165, 250, 0.4);
    transform: translateY(-2px);
}

.media-card-inner {
    display: flex;
    gap: 12px;
}

.media-poster {
    width: 90px;
    height: 135px;
    border-radius: 8px;
    object-fit: cover;
    background: #1a1a1a;
    flex-shrink: 0;
}

.media-poster-placeholder {
    width: 90px;
    height: 135px;
    border-radius: 8px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #444;
    font-size: 32px;
    flex-shrink: 0;
}

.media-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.media-title {
    font-size: 17px;
    font-weight: 600;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.media-pill {
    font-size: 12px;
    color: #ccc;
    background: #1f1f1f;
    padding: 3px 7px;
    border-radius: 6px;
    display: inline-block;
    width: fit-content;
}

.media-meta {
    font-size: 13px;
    color: #aaa;
}

.media-meta-label {
    color: #999;
}

.media-meta-value {
    color: #ccc;
}

.media-overview {
    font-size: 14px;
    color: #ccc;
    line-height: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 8px;
}

.media-click-hint {
    font-size: 11px;
    color: #555;
    text-align: right;
    margin-top: 8px;
}

/* Why You Will Like It section */
.media-reason {
    margin-top: 8px;
    margin-bottom: 16px;
    padding-left: 20px;
    border-left: 2px solid rgba(96, 165, 250, 0.3);
}

.media-reason-header {
    font-size: 13px;
    color: #666;
    font-weight: 500;
    margin-bottom: 4px;
}

.media-reason-text {
    font-size: 14px;
    color: #999;
    line-height: 20px;
}

/* Final summary text */
.final-summary {
    background: #111;
    border-radius: 14px;
    padding: 14px;
    margin-top: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.final-summary-text {
    font-size: 14px;
    color: #ccc;
    line-height: 22px;
}

/* Response container */
.response-wrapper .streaming-bubble.hidden {
    display: none;
}

.rendered-content:empty + .streaming-bubble {
    margin-top: 0;
}

.rendered-content:not(:empty) + .streaming-bubble {
    margin-top: 8px;
}

/* History Sidebar */
.history-sidebar {
    width: 280px;
    background: rgba(15, 23, 42, 0.8);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.history-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all 0.15s ease;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.history-item.active {
    background: rgba(59, 130, 246, 0.15);
    border-left: 3px solid #3b82f6;
}

.history-item-title {
    font-size: 14px;
    font-weight: 500;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item-meta {
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
}

.history-item-actions {
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.15s;
}

.history-item:hover .history-item-actions {
    opacity: 1;
}

.history-item-action {
    cursor: pointer;
    transition: color 0.15s;
}

.history-item-edit {
    color: #60a5fa;
}

.history-item-edit:hover {
    color: #93c5fd;
}

.history-item-delete {
    color: #ef4444;
}

.history-item-delete:hover {
    color: #f87171;
}

.history-empty {
    padding: 24px 16px;
    text-align: center;
    color: #64748b;
    font-size: 13px;
}

/* JSON Modal */
.json-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.json-modal-content {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.json-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.json-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.json-modal pre {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
    color: #e2e8f0;
    white-space: pre-wrap;
    word-break: break-word;
    margin: 0;
}

/* Inline status indicator (like ChatGPT/Claude) */
.inline-status {
    display: flex;
    align-items: center;
    padding: 12px 0;
    color: #64748b;
    font-size: 14px;
    font-style: italic;
}

.inline-status .typing-indicator span {
    animation: bounce 1.4s infinite ease-in-out;
}
.inline-status .typing-indicator span:nth-child(1) { animation-delay: 0s; }
.inline-status .typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.inline-status .typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

/* Debug Fullscreen Modal */
.debug-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.debug-modal-content {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.debug-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.debug-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    font-size: 12px;
    line-height: 1.5;
}

.debug-modal-body .text-xs {
    font-size: 12px;
}

.debug-modal-body .json-content {
    font-size: 11px;
    white-space: pre-wrap;
    word-break: break-word;
}
