body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
}

.content {
    display: flex;
    gap: 20px;
}

.log-list {
    flex: 1;
    background-color: white;
    border-radius: 5px;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    max-height: 80vh;
    overflow-y: auto;
}

.log-details {
    flex: 1;
    background-color: white;
    border-radius: 5px;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    max-height: 80vh;
    overflow-y: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 8px;
    border-bottom: 1px solid #ddd;
}

tr:hover {
    background-color: #f5f5f5;
    cursor: pointer;
}

.log-detail p {
    margin: 5px 0;
}

.message-log {
    margin-top: 10px;
}

.message {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.message .role {
    font-weight: bold;
    margin-bottom: 5px;
}

.message .content {
    padding: 1rem;
    background-color: white;
}

.message .content pre {
    margin: 0;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    overflow-x: auto;
}

.message.user {
    background-color: #e6f3ff;
}

.message.assistant {
    background-color: #f0f0f0;
}

.message.system {
    background-color: #e8f5e9;
}

.filter-container {
    margin-bottom: 20px;
}

#log-filter {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.prompt-hash {
    font-size: 0.8em;
    color: #666;
    margin-top: 5px;
}

.prompt-hash-tag {
    display: inline-block;
    font-size: 0.7em;
    background-color: #f0f0f0;
    color: #666;
    padding: 2px 5px;
    border-radius: 3px;
    text-decoration: none;
    margin-bottom: 5px;
}

.prompt-hash-tag:hover {
    background-color: #e0e0e0;
}

.prompt-info {
    font-size: 0.875rem;
    color: #6c757d;
}

.prompt-name {
    font-style: italic;
    margin-right: 0.5rem;
}

.prompt-hash {
    color: #0d6efd;
    text-decoration: none;
}

.prompt-hash:hover {
    text-decoration: underline;
}

/* Styles for modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

pre code {
    display: block;
    padding: 1em;
    background: #f5f5f5;
    border-radius: 4px;
    overflow-x: auto;
}

/* Add these styles to your existing CSS */
.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    height: 70vh;
    display: flex;
    flex-direction: column;
}

.card-body {
    padding: 1.25rem;
    flex: 1;
    overflow-y: auto;
}

.table-responsive {
    max-height: calc(70vh - 2.5rem);
    overflow-y: auto;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 1;
    border-bottom: 2px solid #dee2e6;
}

.table tbody tr:hover {
    background-color: #f5f5f5;
    cursor: pointer;
}

.table td {
    vertical-align: middle;
}

/* Update existing styles */
.log-details {
    max-height: 70vh;
    overflow-y: auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Style the placeholder text */
.text-muted {
    color: #6c757d;
    text-align: center;
    margin-top: 2rem;
}

/* Add these styles to your existing CSS */
.message-header {
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
    transition: background-color 0.2s;
}

.message-header:hover {
    background-color: #e9ecef;
}

.collapse-icon {
    transition: transform 0.2s;
}

/* When the collapse is not shown (closed) */
.collapse:not(.show) ~ .message-header .collapse-icon,
[data-bs-toggle="collapse"][aria-expanded="false"] .collapse-icon {
    transform: rotate(-90deg);
}

/* When the collapse is shown (open) */
.collapse.show ~ .message-header .collapse-icon,
[data-bs-toggle="collapse"][aria-expanded="true"] .collapse-icon {
    transform: rotate(0deg);
}

/* Style headers for each message type */
.message.user .message-header {
    background-color: #e3f2fd;
}

.message.assistant .message-header {
    background-color: #f0f0f0;
}

.message.system .message-header {
    background-color: #e8f5e9;
}

/* Style content for all messages */
.message .content {
    margin-top: 0;
    border-top: none;
    border-radius: 0 0 4px 4px;
}

.collapse {
    transition: height 0.3s ease-out;
}

/* Add these styles for the prompt history */
.prompt-version {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.template-content pre,
.diff-content pre {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    margin-top: 10px;
}

.diff-content pre {
    background-color: #f8f9fa;
    font-family: monospace;
}

/* Style diff content */
.language-diff {
    color: #24292e;
}

.language-diff .deletion {
    background-color: #ffeef0;
    color: #b31d28;
}

.language-diff .addition {
    background-color: #e6ffed;
    color: #22863a;
}

/* Make the prompt history container scrollable */
#prompt-history-container {
    max-height: 70vh;
    overflow-y: auto;
}

/* Style headings in prompt history */
.prompt-version h4 {
    color: #0066cc;
    margin-bottom: 1rem;
}

.prompt-version h5 {
    color: #666;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

/* Style the horizontal rule */
.prompt-version hr {
    margin: 2rem 0;
    border-color: #eee;
}

/* Timeline styles for prompt history */
.prompt-timeline {
    position: relative;
    padding: 20px 0;
}

.prompt-version {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    position: relative;
}

.version-header {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.version-badge {
    background-color: #0066cc;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9em;
}

.version-hash {
    color: #666;
    font-family: monospace;
}

.timeline-connector {
    position: absolute;
    left: 50%;
    bottom: -30px;
    width: 2px;
    height: 30px;
    background-color: #ddd;
}

.version-changes {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.version-changes h5 {
    color: #666;
    margin-bottom: 10px;
}

/* Style the diff content */
.language-diff {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    font-family: monospace;
    white-space: pre-wrap;
}

.language-diff .deletion {
    color: #b31d28;
    background-color: #ffeef0;
}

.language-diff .addition {
    color: #22863a;
    background-color: #e6ffed;
}

/* Make code blocks look better */
.template-content pre {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin: 0;
    overflow-x: auto;
}

.template-content code {
    font-family: monospace;
    white-space: pre-wrap;
}

.tool-calls {
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
}

.tool-calls h6 {
    color: #6c757d;
    margin-bottom: 8px;
}

.tool-call {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.tool-call pre {
    margin: 0;
    padding: 0.5rem;
    background-color: white;
    border-radius: 4px;
}

.tool-call:last-child {
    margin-bottom: 0;
}

.tool-call strong {
    color: #495057;
}

/* Sortable columns */
.sortable {
    cursor: pointer;
    position: relative;
    padding-right: 1.5rem;
}

.sortable::after {
    content: "↕";
    position: absolute;
    right: 0.5rem;
    color: #6c757d;
}

.sortable.asc::after {
    content: "↑";
}

.sortable.desc::after {
    content: "↓";
}

/* Modal styles */
.modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.modal-body {
    padding: 1.5rem;
}

/* Rating buttons */
.rating-buttons {
    display: flex;
    gap: 0.5rem;
}

.rating-buttons .btn {
    flex: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card {
        height: auto;
    }

    .table-responsive {
        max-height: none;
    }

    .message-header {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .prompt-info {
        margin-top: 0.5rem;
    }
}
