/* Highlight Reel Modal Styles */

.highlight-modal .modal-content {
    height: 90vh;
    max-height: 900px;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

/* Header */
.highlight-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: var(--bg-secondary);
}

.highlight-header-content {
    flex: 1;
}

.highlight-modal-header h2 {
    margin: 0 0 4px 0;
    font-size: 1.5em;
}

.highlight-subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9em;
}

/* Chat Log Tabs Container (Top) */
.highlight-log-tabs-container {
    padding: 12px 24px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    overflow-x: auto;
}

.highlight-log-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
}

.log-tab {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 6px;
}

.log-tab:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.log-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.log-tab .platform-icon {
    font-size: 1em;
}

/* Main Layout */
.highlight-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* Sidebar */
.highlight-sidebar {
    width: 220px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
}

.sidebar-label {
    padding: 16px 16px 12px;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
    flex-shrink: 0;
}

.value-tabs {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 16px;
}

.value-tab {
    padding: 14px 16px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.value-tab:hover {
    background: var(--bg-tertiary);
}

.value-tab.active {
    background: var(--bg-tertiary);
    border-left-color: var(--primary);
}

.value-tab-name {
    font-weight: 500;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.value-tab-direction {
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.value-tab-direction.high {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.value-tab-direction.low {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.value-tab-zscore {
    font-size: 0.8em;
    color: var(--text-secondary);
}

/* Main Area */
.highlight-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

/* Info Banner */
.highlight-info-banner {
    padding: 14px 24px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.highlight-badge {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.highlight-badge.high {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.highlight-badge.low {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.highlight-stat {
    font-size: 0.9em;
    color: var(--text-secondary);
}

.highlight-stat strong {
    color: var(--text-primary);
}

/* Conversation Display */
.highlight-conversation-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg-primary);
    position: relative;
    min-height: 0;
}

.conversation-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Summary Box */
.conversation-summary {
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border-left: 4px solid var(--primary);
}

.conversation-summary-label {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
}

.conversation-summary-text {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 0.95em;
}

/* Value Analysis Box */
.conversation-analysis {
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.conversation-analysis-label {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.conversation-analysis-text {
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 0.9em;
}

/* Messages Section */
.messages-section {
    margin-top: 20px;
}

.messages-section-label {
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

/* Message bubbles */
.msg-row {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.msg-meta {
    font-size: 0.75em;
    color: var(--text-secondary);
    margin-bottom: 4px;
    margin-left: 12px;
}

.msg-bubble {
    padding: 12px 16px;
    border-radius: 16px;
    max-width: 85%;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
}

.msg-row.target .msg-bubble {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.msg-row.partner .msg-bubble {
    background: var(--bg-secondary);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

.msg-row.target {
    align-items: flex-end;
}

.msg-row.target .msg-meta {
    margin-left: 0;
    margin-right: 12px;
    text-align: right;
}

.msg-row.partner {
    align-items: flex-start;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 200px;
    color: var(--text-secondary);
    gap: 12px;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 200px;
    color: var(--text-secondary);
    text-align: center;
    padding: 40px;
}

.empty-icon {
    font-size: 3em;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    margin: 0;
    font-size: 1em;
}

.empty-hint {
    margin-top: 8px !important;
    font-size: 0.85em !important;
    opacity: 0.7;
}

/* Navigation Footer */
.highlight-nav-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;
}

.nav-btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--primary);
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.nav-arrow {
    font-size: 1.1em;
}

.nav-counter {
    color: var(--text-secondary);
    font-size: 0.9em;
    min-width: 80px;
    text-align: center;
}

/* Conversation detail layout within highlight reel */
.highlight-conversation-container .conversation-detail {
    height: 100%;
}

.highlight-pinned-value {
    border-left: 3px solid var(--primary);
    padding-left: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    padding: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .highlight-sidebar {
        width: 180px;
    }

    .highlight-log-tabs-container {
        padding: 10px 16px;
    }

    .highlight-conversation-container .conversation-detail {
        grid-template-columns: 1fr;
    }
}
