:root {
    --primary-color: #3b82f6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --neutral-color: #6b7280;
    --bg-color: #f9fafb;
    --text-color: #111827;
    --border-color: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

/* Header */
header {
    background: white;
    border-bottom: 1px solid var(--border-color);
    padding: 20px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2rem;
    margin-bottom: 5px;
}

header p {
    color: var(--neutral-color);
    margin-bottom: 15px;
}

nav {
    display: flex;
    gap: 20px;
}

nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

nav a:hover {
    text-decoration: underline;
}

/* Main */
main {
    padding: 30px 0;
}

/* Info Banner */
.info-banner {
    background: #eff6ff;
    border-left: 4px solid var(--primary-color);
    padding: 15px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    color: #1e40af;
    line-height: 1.6;
}

.info-banner strong {
    color: #1e3a8a;
}

/* Controls */
.controls {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.search-box {
    margin-bottom: 15px;
}

.search-box input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--neutral-color);
}

.filters select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    min-width: 150px;
}

.filters button {
    padding: 8px 16px;
    background: var(--neutral-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.filters button:hover {
    opacity: 0.9;
}

.filter-hint {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--neutral-color);
    font-style: italic;
}

/* Stats */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stat-label {
    color: var(--neutral-color);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Table */
.table-container {
    background: white;
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

thead {
    background: var(--bg-color);
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
    cursor: pointer;
    user-select: none;
}

th:hover {
    background: #f3f4f6;
}

th[data-sort] {
    position: relative;
}

.sort-icon {
    margin-left: 5px;
    color: var(--neutral-color);
}

th.sort-asc .sort-icon::after {
    content: '↑';
}

th.sort-desc .sort-icon::after {
    content: '↓';
}

.help-icon {
    display: inline-block;
    margin-left: 5px;
    color: var(--primary-color);
    cursor: help;
    font-size: 0.9rem;
    opacity: 0.7;
}

.help-icon:hover {
    opacity: 1;
}

td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
    background: var(--bg-color);
}

.loading {
    text-align: center;
    padding: 40px !important;
    color: var(--neutral-color);
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-beneficial {
    background: #d1fae5;
    color: #065f46;
}

.badge-neutral {
    background: #e5e7eb;
    color: #374151;
}

.badge-harmful {
    background: #fee2e2;
    color: #991b1b;
}

.badge-not_applicable {
    background: #f3f4f6;
    color: #6b7280;
}

.category-emoji {
    display: inline-block;
    font-size: 1.1rem;
    margin: 0 2px;
    cursor: help;
}

.source-tag {
    display: inline-block;
    padding: 2px 8px;
    margin: 2px;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
}

.view-details {
    padding: 6px 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.view-details:hover {
    opacity: 0.9;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.pagination button:disabled {
    background: var(--neutral-color);
    opacity: 0.5;
    cursor: not-allowed;
}

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

.modal-content {
    background: white;
    margin: 50px auto;
    padding: 30px;
    border-radius: 8px;
    max-width: 800px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 2rem;
    font-weight: bold;
    color: var(--neutral-color);
    cursor: pointer;
}

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

#botDetails h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

#botDetails .detail-section {
    margin-bottom: 20px;
}

#botDetails .detail-label {
    font-weight: 600;
    color: var(--neutral-color);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

#botDetails .detail-value {
    margin-bottom: 15px;
}

#botDetails .category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
}

#botDetails .category-item {
    padding: 10px;
    border-radius: 6px;
    background: var(--bg-color);
    text-align: center;
}

#botDetails .category-name {
    font-size: 0.85rem;
    color: var(--neutral-color);
    margin-bottom: 5px;
}

/* Footer */
footer {
    background: white;
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    margin-top: 50px;
    text-align: center;
    color: var(--neutral-color);
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.5rem;
    }

    .filters {
        flex-direction: column;
    }

    .filters select,
    .filters button {
        width: 100%;
    }

    table {
        font-size: 0.9rem;
    }

    th, td {
        padding: 10px;
    }

    .modal-content {
        margin: 20px;
        padding: 20px;
    }
}
