/* UK Healthcare Data Browser - Clean, professional styling */

:root {
    --primary: #1F4E79;
    --primary-light: #2E75B6;
    --accent: #548235;
    --accent-light: #70AD47;
    --success: #548235;
    --warning: #BF8F00;
    --danger: #C00000;
    --info: #2E75B6;
    --bg: #F5F6FA;
    --card-bg: #FFFFFF;
    --text: #2D3436;
    --text-light: #636E72;
    --border: #DFE6E9;
    --hover: #F0F3F8;
    --verified: #E2EFDA;
    --warning-bg: #FFF2CC;
    --unverified: #FCE4EC;
}

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

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

/* Navigation */
.navbar {
    background: var(--primary);
    color: white;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    height: 56px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.nav-brand a {
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.nav-links {
    margin-left: 3rem;
    display: flex;
    gap: 0.5rem;
}

.nav-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nav-links a:hover { background: rgba(255,255,255,0.15); color: white; }
.nav-links a.active { background: rgba(255,255,255,0.2); color: white; font-weight: 500; }

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
}

/* Page Header */
.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--primary);
}

.page-header .subtitle {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    border-left: 4px solid var(--border);
}

.stat-card.primary { border-left-color: var(--primary); }
.stat-card.accent { border-left-color: var(--accent); }
.stat-card.success { border-left-color: var(--success); }
.stat-card.info { border-left-color: var(--info); }

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.stat-card.accent .stat-number { color: var(--accent); }
.stat-card.success .stat-number { color: var(--success); }
.stat-card.info .stat-number { color: var(--info); }

.stat-label {
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

.stat-detail {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.15rem;
}

/* Dashboard Panels */
.dashboard-panels {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.panel {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.panel h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 1rem;
}

/* Mini Table (dashboard) */
.mini-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.mini-table th {
    text-align: left;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-light);
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
}

.mini-table td {
    padding: 0.4rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
}

.mini-table td:last-child {
    text-align: right;
    font-weight: 500;
}

/* Tags */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-block;
    background: #EBF5FB;
    color: var(--primary);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.5rem 1.2rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-light); }
.btn-accent { background: var(--accent); color: white; }
.btn-accent:hover { background: var(--accent-light); }
.btn-secondary { background: #E8ECF0; color: var(--text); }
.btn-secondary:hover { background: #D5DCE1; }

/* Toolbar */
.toolbar {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.search-box {
    flex: 1;
    min-width: 200px;
}

.search-box input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 2px rgba(46,117,182,0.15);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filters select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.85rem;
    background: white;
    cursor: pointer;
    outline: none;
}

.filters select:focus {
    border-color: var(--primary-light);
}

.actions {
    display: flex;
    gap: 0.5rem;
}

/* Results Info */
.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Data Table */
.table-container {
    background: var(--card-bg);
    border-radius: 10px;
    overflow-x: auto;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table thead th {
    background: #F8F9FA;
    padding: 0.7rem 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-light);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
    user-select: none;
}

.data-table thead th.sortable {
    cursor: pointer;
}

.data-table thead th.sortable:hover {
    color: var(--primary);
}

.data-table thead th.sorted-asc::after { content: ' \u25B2'; font-size: 0.7rem; }
.data-table thead th.sorted-desc::after { content: ' \u25BC'; font-size: 0.7rem; }

.data-table tbody td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid #F0F0F0;
    vertical-align: top;
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.data-table tbody tr:hover {
    background: var(--hover);
}

/* Validation status colours */
.data-table tbody tr.status-verified { background: var(--verified); }
.data-table tbody tr.status-warning { background: var(--warning-bg); }
.data-table tbody tr.status-unverified { }

.data-table tbody tr.status-verified:hover { background: #D5E8CD; }
.data-table tbody tr.status-warning:hover { background: #FFE8A3; }

/* Status badges */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-verified { background: #D5E8CD; color: #2D6A2E; }
.badge-warning { background: #FFE8A3; color: #7D6000; }
.badge-unverified { background: #F0F0F0; color: #666; }

/* Links in table */
.data-table a {
    color: var(--primary-light);
    text-decoration: none;
}

.data-table a:hover {
    text-decoration: underline;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    padding: 1rem;
}

.pagination button {
    padding: 0.35rem 0.7rem;
    border: 1px solid var(--border);
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.pagination button:hover { background: var(--hover); border-color: var(--primary-light); }
.pagination button.active { background: var(--primary); color: white; border-color: var(--primary); }
.pagination button:disabled { opacity: 0.4; cursor: default; }

/* Toast notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

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

/* Responsive */
@media (max-width: 768px) {
    .navbar { padding: 0 1rem; }
    .container { padding: 1rem; }
    .toolbar { flex-direction: column; }
    .search-box { width: 100%; }
    .filters { width: 100%; }
    .actions { width: 100%; justify-content: flex-end; }
}
