/* Debug Panel Styles */

.debug-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 400px;
    max-height: 60vh;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: var(--shadow);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.debug-panel.hidden {
    transform: translateY(100%);
}

.debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--surface-light);
}

.debug-header h3 {
    margin: 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-debug {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.25rem;
}

.close-debug:hover {
    color: var(--text-primary);
}

.debug-tabs {
    display: flex;
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
}

.debug-tab {
    flex: 1;
    padding: 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
}

.debug-tab:hover {
    background: var(--surface-light);
}

.debug-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--primary-color);
}

.debug-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.debug-pane {
    display: none;
}

.debug-pane.active {
    display: block;
}

.debug-pane pre {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Debug Toggle Button */
.debug-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface-light);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: all 0.2s;
    z-index: 999;
}

.debug-toggle:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

/* Reranking Display */
#reranking-content {
    font-size: 0.875rem;
}

.rerank-comparison {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.25rem;
}

.rerank-comparison .before,
.rerank-comparison .after {
    margin-bottom: 0.5rem;
}

.rerank-comparison strong {
    color: var(--primary-color);
}

/* Token Usage Display */
#tokens-content {
    font-size: 0.875rem;
}

.token-stat {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.token-stat:last-child {
    border-bottom: none;
}

.token-stat .label {
    color: var(--text-secondary);
}

.token-stat .value {
    color: var(--text-primary);
    font-weight: 600;
}

/* Performance Timing */
#timing-content {
    font-size: 0.875rem;
}

.timing-bar {
    margin-bottom: 0.75rem;
}

.timing-bar .label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.timing-bar .bar {
    height: 4px;
    background: var(--surface-light);
    border-radius: 2px;
    overflow: hidden;
}

.timing-bar .fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .debug-panel {
        width: 100%;
        max-height: 50vh;
    }
}