/* Prompt list container */
.prompt-list {
    background: #1e293b;
    border-radius: 8px;
    border: 1px solid #334155;
    overflow: hidden;
    transition: background 0.3s, border-color 0.3s;
}

.prompt-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #334155;
    cursor: pointer;
    transition: background 0.2s;
}

.prompt-item:hover {
    background: #334155;
}

.prompt-item:last-child {
    border-bottom: none;
}

.prompt-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: #38bdf8;
}

.prompt-meta {
    color: #94a3b8;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Search and filter controls */
#search-input,
#sort-select {
    padding: 0.5rem 1rem;
    border-radius: 4px;
    border: 1px solid #334155;
    background: #1e293b;
    color: #e2e8f0;
    font-size: 0.875rem;
}

#search-input {
    flex: 1;
    min-width: 200px;
}

#sort-select {
    cursor: pointer;
}

/* Light mode */
body.light-mode .prompt-list {
    background: #ffffff;
    border-color: #e2e8f0;
}

body.light-mode .prompt-item {
    border-bottom-color: #e2e8f0;
}

body.light-mode .prompt-item:hover {
    background: #f1f5f9;
}

body.light-mode .prompt-name {
    color: #0284c7;
}

body.light-mode .prompt-meta {
    color: #64748b;
}

body.light-mode #search-input,
body.light-mode #sort-select {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #1e293b;
}

/* Version metrics styling */
.version-metrics {
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 6px;
}

.metrics-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.metrics-row:last-child {
    margin-bottom: 0;
}

.metric-item {
    font-size: 0.7rem;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.6);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    white-space: nowrap;
}

.model-tag {
    font-size: 0.75rem;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(251, 191, 36, 0.2);
}

.no-metrics {
    color: #64748b;
    font-size: 0.75rem;
    font-style: italic;
    margin: 0.5rem 0;
    text-align: center;
}

/* Light mode versions */
body.light-mode .version-metrics {
    background: rgba(59, 130, 246, 0.05);
    border-color: rgba(59, 130, 246, 0.15);
}

body.light-mode .metric-item {
    color: #475569;
    background: rgba(248, 250, 252, 0.8);
}

body.light-mode .model-tag {
    color: #d97706;
    background: rgba(251, 191, 36, 0.1);
}

body.light-mode .no-metrics {
    color: #94a3b8;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
}

.modal-content {
    background: #1e293b;
    border-radius: 12px;
    padding: 2rem;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid #334155;
    color: #f1f5f9;
    position: relative;
}

.modal-close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.25rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s ease;
    z-index: 10;
}

.modal-close-btn:hover {
    background: #dc2626;
}

.modal-header {
    margin-bottom: 2rem;
    padding-right: 4rem;
}

.modal-title {
    margin: 0 0 1rem 0;
    color: #3b82f6;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 1.5rem;
}

.modal-version-number {
    color: #94a3b8;
    font-size: 1.2rem;
}

.modal-model-badge {
    background: #3b82f6;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.modal-body {
    display: grid;
    gap: 2rem;
}

.section-title {
    margin: 0 0 0 0;
    color: #3b82f6;
    padding-bottom: 0;
    font-size: 1.1rem;
}

.prompt-content {
    background: #0f172a;
    padding: 1.5rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    line-height: 1.6;
    font-size: 0.9rem;
}

.system-prompt-content {
    border-left: 4px solid #3b82f6;
}

.user-prompt-content {
    border-left: 4px solid #10b981;
    background: #0f172a;
}

.metadata-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.metadata-item h4 {
    margin: 0 0 0.75rem 0;
    color: #f59e0b;
    font-size: 1rem;
}

.metadata-item p {
    margin: 0;
    color: #cbd5e1;
    font-size: 0.9rem;
}

.git-commit,
.metadata-json {
    background: #0f172a;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 0;
    overflow-x: auto;
    color: var(--text-secondary);
    font-size: 0.85rem;
    border-left: 4px solid var(--accent-info);
    line-height: 1.5;
    font-family: 'Courier New', monospace;
}

/* Modal Metrics Grid */
.modal-metrics-section {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent-secondary);
}

.metrics-title {
    color: var(--accent-secondary);
}

.metrics-grid {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: space-between;
}

.metric-card {
    text-align: center;
    padding: 0.75rem;
    border-radius: 6px;
    flex: 1;
    min-width: 140px;
}

.metric-card.metric-calls {
    background: rgba(16, 185, 129, 0.1);
}

.metric-card.metric-tokens {
    background: rgba(59, 130, 246, 0.1);
}

.metric-card.metric-cost {
    background: rgba(251, 191, 36, 0.1);
}

.metric-card.metric-latency {
    background: rgba(139, 92, 246, 0.1);
}

.metric-card.metric-quality {
    background: rgba(236, 72, 153, 0.1);
}

.metric-card.metric-success {
    background: rgba(34, 197, 94, 0.1);
}

.metric-card .metric-icon {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.metric-card.metric-calls .metric-icon {
    color: #10b981;
}

.metric-card.metric-tokens .metric-icon {
    color: #3b82f6;
}

.metric-card.metric-cost .metric-icon {
    color: #fbbf24;
}

.metric-card.metric-latency .metric-icon {
    color: #8b5cf6;
}

.metric-card.metric-quality .metric-icon {
    color: #ec4899;
}

.metric-card.metric-success .metric-icon {
    color: #22c55e;
}

.metric-card .metric-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
}

.metric-card .metric-label {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* State Templates */
.empty-state,
.loading-state,
.error-state {
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.empty-icon,
.loading-icon,
.error-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.empty-title,
.error-title {
    margin-bottom: 0.5rem;
    color: #94a3b8;
}

.retry-btn {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.retry-btn:hover {
    background: #2563eb;
}

/* Light mode modal adjustments */
body.light-mode .modal-overlay {
    background: rgba(0, 0, 0, 0.6) !important;
}

body.light-mode .modal-content {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #1e293b !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25) !important;
}

body.light-mode .modal-close-btn {
    background: #dc2626 !important;
    color: white !important;
}

body.light-mode .modal-close-btn:hover {
    background: #b91c1c !important;
}

body.light-mode .modal-title {
    color: #0284c7 !important;
}

body.light-mode .modal-version-number {
    color: #64748b !important;
}

body.light-mode .modal-model-badge {
    background: #0284c7 !important;
    color: white !important;
}

body.light-mode .section-title {
    color: #0284c7 !important;
}

body.light-mode .prompt-content {
    background: #f8fafc !important;
    color: #1e293b !important;
}

body.light-mode .system-prompt-content {
    border-left-color: #0284c7 !important;
    background: #f1f5f9 !important;
}

body.light-mode .user-prompt-content {
    border-left-color: #059669 !important;
    background: #f1f5f9 !important;
}

body.light-mode .metadata-grid .metadata-item h4 {
    color: #d97706 !important;
}

body.light-mode .metadata-grid .metadata-item p {
    color: #64748b !important;
}

body.light-mode .git-commit,
body.light-mode .metadata-json {
    background: #f1f5f9 !important;
    color: #475569 !important;
    border-left-color: #3b82f6 !important;
}

body.light-mode .modal-metrics-section {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light-mode .metric-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

body.light-mode .metric-card .metric-value {
    color: #1e293b !important;
}

body.light-mode .metric-card .metric-label {
    color: #64748b !important;
}

body.light-mode .metric-card.metric-calls {
    background: rgba(16, 185, 129, 0.05) !important;
    border-color: rgba(16, 185, 129, 0.2) !important;
}

body.light-mode .metric-card.metric-tokens {
    background: rgba(59, 130, 246, 0.05) !important;
    border-color: rgba(59, 130, 246, 0.2) !important;
}

body.light-mode .metric-card.metric-cost {
    background: rgba(251, 191, 36, 0.05) !important;
    border-color: rgba(251, 191, 36, 0.2) !important;
}

body.light-mode .metric-card.metric-latency {
    background: rgba(139, 92, 246, 0.05) !important;
    border-color: rgba(139, 92, 246, 0.2) !important;
}

body.light-mode .metric-card.metric-quality {
    background: rgba(236, 72, 153, 0.05) !important;
    border-color: rgba(236, 72, 153, 0.2) !important;
}

body.light-mode .metric-card.metric-success {
    background: rgba(34, 197, 94, 0.05) !important;
    border-color: rgba(34, 197, 94, 0.2) !important;
}

body.light-mode .metric-card.metric-calls .metric-icon {
    color: #059669 !important;
}

body.light-mode .metric-card.metric-tokens .metric-icon {
    color: #2563eb !important;
}

body.light-mode .metric-card.metric-cost .metric-icon {
    color: #d97706 !important;
}

body.light-mode .metric-card.metric-latency .metric-icon {
    color: #7c3aed !important;
}

body.light-mode .metric-card.metric-quality .metric-icon {
    color: #db2777 !important;
}

body.light-mode .metric-card.metric-success .metric-icon {
    color: #16a34a !important;
}

/* Enhanced Action Buttons */
.view-details-btn,
.delete-version-btn,
.delete-prompt-btn {
    padding: 0.25rem 0.5rem !important;
    border-radius: 6px !important;
    border: 1px solid transparent !important;
    transition: all 0.2s ease !important;
    background: transparent !important;
    font-size: 0.875rem !important;
}

.view-details-btn {
    color: #64748b !important;
}

.view-details-btn:hover {
    background: rgba(59, 130, 246, 0.1) !important;
    color: #3b82f6 !important;
    border-color: rgba(59, 130, 246, 0.2) !important;
}

.delete-version-btn,
.delete-prompt-btn {
    color: #64748b !important;
}

.delete-version-btn:hover,
.delete-prompt-btn:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    color: #ef4444 !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
}

/* Light mode action buttons */
body.light-mode .view-details-btn {
    color: #64748b !important;
}

body.light-mode .view-details-btn:hover {
    background: rgba(59, 130, 246, 0.08) !important;
    color: #2563eb !important;
    border-color: rgba(59, 130, 246, 0.15) !important;
}

body.light-mode .delete-version-btn,
body.light-mode .delete-prompt-btn {
    color: #64748b !important;
}

body.light-mode .delete-version-btn:hover,
body.light-mode .delete-prompt-btn:hover {
    background: rgba(239, 68, 68, 0.08) !important;
    color: #dc2626 !important;
    border-color: rgba(239, 68, 68, 0.15) !important;
}

/* Enhanced visibility for version actions */
.version-actions {
    display: flex !important;
    gap: 0.5rem !important;
    align-items: center !important;
    opacity: 0.6 !important;
    transition: opacity 0.2s ease !important;
}

.version-item-clean:hover .version-actions {
    opacity: 1 !important;
}

.version-item-clean:hover .version-actions .btn-icon {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1) !important;
}

body.light-mode .version-item-clean:hover .version-actions .btn-icon {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08) !important;
}

/* Enhanced visibility for prompt actions */
.prompt-actions-minimal {
    display: flex !important;
    gap: 0.5rem !important;
    align-items: center !important;
    opacity: 0.6 !important;
    transition: opacity 0.2s ease !important;
}

.prompt-item-minimal:hover .prompt-actions-minimal {
    opacity: 1 !important;
}

.prompt-item-minimal:hover .prompt-actions-minimal .btn-icon {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.1) !important;
}

body.light-mode .prompt-item-minimal:hover .prompt-actions-minimal .btn-icon {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08) !important;
}

/* Enhanced Import/Export Buttons */
.section-actions .btn.btn-icon {
    padding: 0.625rem 0.875rem !important;
    border-radius: 8px !important;
    border: 2px solid rgba(59, 130, 246, 0.3) !important;
    transition: all 0.2s ease !important;
    background: rgba(59, 130, 246, 0.05) !important;
    font-size: 1.125rem !important;
    color: #3b82f6 !important;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.1) !important;
}

.section-actions .btn.btn-icon:hover {
    background: rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(59, 130, 246, 0.5) !important;
    color: #2563eb !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2) !important;
    transform: translateY(-1px) !important;
}

/* Light mode import/export buttons */
body.light-mode .section-actions .btn.btn-icon {
    background: rgba(59, 130, 246, 0.08) !important;
    border-color: rgba(59, 130, 246, 0.25) !important;
    color: #2563eb !important;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.15) !important;
}

body.light-mode .section-actions .btn.btn-icon:hover {
    background: rgba(59, 130, 246, 0.12) !important;
    border-color: rgba(59, 130, 246, 0.4) !important;
    color: #1d4ed8 !important;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25) !important;
}

/* Modern Tab Navigation */
.tab-navigation {
    display: flex;
    background: #1e293b;
    border-radius: 12px;
    padding: 0.5rem;
    margin: 2rem 0;
    border: 1px solid #334155;
    gap: 0.25rem;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    position: relative;
}

.tab-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.tab-btn.active {
    background: #3b82f6;
    color: white;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.tab-icon {
    font-size: 1rem;
}

.tab-label {
    font-weight: 600;
}

.tab-badge {
    background: #ef4444;
    color: white;
    border-radius: 10px;
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.25rem;
    min-width: 1.25rem;
    text-align: center;
}

/* Light mode tab navigation */
body.light-mode .tab-navigation {
    background: #f8fafc;
    border-color: #e2e8f0;
}

body.light-mode .tab-btn {
    color: #64748b;
}

body.light-mode .tab-btn:hover {
    background: rgba(59, 130, 246, 0.08);
    color: #2563eb;
}

body.light-mode .tab-btn.active {
    background: #2563eb;
    color: white;
}

/* Tab Content Container */
.tab-content-container {
    min-height: 60vh;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeInUp 0.3s ease;
}

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

/* Enhanced Setup Rows */
.ab-test-setup,
.compare-setup {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.setup-row {
    display: flex;
    align-items: end;
    gap: 1rem;
    flex-wrap: wrap;
}

.setup-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 200px;
    flex: 1;
}

.setup-field label {
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 500;
}

.setup-field select {
    padding: 0.75rem;
    border: 1px solid #334155;
    border-radius: 8px;
    background: #0f172a;
    color: #f1f5f9;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.setup-field select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.setup-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    font-size: 1.25rem;
    font-weight: 600;
    padding: 0 0.5rem;
    margin-top: 1.5rem;
}

.setup-action {
    display: flex;
    align-items: end;
}

/* Light mode setup */
body.light-mode .ab-test-setup,
body.light-mode .compare-setup {
    background: #ffffff;
    border-color: #e2e8f0;
}

body.light-mode .setup-field label {
    color: #64748b;
}

body.light-mode .setup-field select {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #1e293b;
}

body.light-mode .setup-field select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

body.light-mode .setup-vs {
    color: #64748b;
}

/* Alert Filters */
.alert-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 8px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 500;
}

.filter-group select {
    padding: 0.5rem;
    border: 1px solid #334155;
    border-radius: 6px;
    background: #0f172a;
    color: #f1f5f9;
    font-size: 0.875rem;
}

/* Light mode filters */
body.light-mode .alert-filters {
    background: #ffffff;
    border-color: #e2e8f0;
}

body.light-mode .filter-group label {
    color: #64748b;
}

body.light-mode .filter-group select {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #1e293b;
}

/* Results Containers */
.ab-results-container,
.diff-results-container,
.alerts-container {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 2rem;
    min-height: 300px;
}

/* Light mode results */
body.light-mode .ab-results-container,
body.light-mode .diff-results-container,
body.light-mode .alerts-container {
    background: #ffffff;
    border-color: #e2e8f0;
}
