/* Base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #2c3e50;
    font-size: 2rem;
    margin-bottom: 5px;
}

header .subtitle {
    color: #7f8c8d;
    font-size: 1rem;
}

/* Metrics Panel */
.metrics-panel {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.metric-card {
    background: white;
    border-radius: 8px;
    padding: 15px 25px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    min-width: 120px;
}

.metric-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #3498db;
}

.metric-label {
    display: block;
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-top: 5px;
}

/* Filters */
.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.filters label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #555;
}

.filters input,
.filters select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-success {
    background-color: #27ae60;
    color: white;
}

.btn-success:hover {
    background-color: #219a52;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

/* Examples List */
.examples-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.example-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.2s;
}

.example-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.example-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.example-score {
    font-size: 1.5rem;
    font-weight: 700;
}

.example-score.excellent { color: #27ae60; }
.example-score.good { color: #3498db; }
.example-score.acceptable { color: #f39c12; }
.example-score.poor { color: #e74c3c; }

.example-tier {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.tier-excellent { background: #d5f4e6; color: #27ae60; }
.tier-good { background: #d6eaf8; color: #3498db; }
.tier-acceptable { background: #fef5e7; color: #f39c12; }
.tier-poor { background: #fadbd8; color: #e74c3c; }

.example-meta {
    display: flex;
    gap: 15px;
    color: #7f8c8d;
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.example-patterns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pattern-tag {
    background: #ecf0f1;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #555;
}

.loading {
    text-align: center;
    color: #7f8c8d;
    padding: 40px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 14px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
}

.pagination button.active {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    width: 95%;
    padding: 30px;
}

.modal-content.small {
    max-width: 400px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
}

.modal-close:hover {
    color: #333;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 15px;
}

/* Detail View */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.detail-scores {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.score-item {
    text-align: center;
}

.score-item .value {
    display: block;
    font-size: 1.3rem;
    font-weight: 600;
}

.score-item .label {
    font-size: 0.8rem;
    color: #7f8c8d;
}

.conversation-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.message {
    margin-bottom: 12px;
    padding: 10px 15px;
    border-radius: 8px;
    max-width: 80%;
}

.message.user {
    background: #3498db;
    color: white;
    margin-left: auto;
}

.message.assistant {
    background: white;
    border: 1px solid #ddd;
}

.message-role {
    font-size: 0.7rem;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 4px;
}

.ai-reasoning {
    background: #fef9e7;
    border-left: 3px solid #f39c12;
    padding: 15px;
    margin: 15px 0;
}

.ai-reasoning h4 {
    margin-bottom: 8px;
    color: #f39c12;
}

.action-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Textarea */
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.empty-state h3 {
    margin-bottom: 10px;
}
