/* Basis Reset en Variabelen */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --secondary-hover: #475569;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius-md: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1800px;
    margin: 0 auto;
    background: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    font-weight: 700;
}

.subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 12px;
}

.metadata {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Controls Section */
.controls-section {
    padding: 24px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
}

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

.search-box label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    align-items: end;
}

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

.filter-group label {
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.filter-select {
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: var(--secondary-hover);
    transform: translateY(-1px);
}

/* Stats Bar */
.stats-bar {
    display: flex;
    gap: 24px;
    padding: 16px 24px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    gap: 8px;
    align-items: center;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

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

/* Table */
.table-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 600px;
}

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

.spreadsheet thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.spreadsheet thead th {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 12px 10px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #475569;
    white-space: nowrap;
}

.spreadsheet thead th.sortable {
    cursor: pointer;
    user-select: none;
}

.spreadsheet thead th.sortable:hover {
    background: linear-gradient(135deg, #334155 0%, #475569 100%);
}

.spreadsheet tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.spreadsheet tbody tr:hover {
    background: #f1f5f9;
}

.spreadsheet tbody tr.even {
    background: var(--bg-color);
}

.spreadsheet tbody tr.even:hover {
    background: #e2e8f0;
}

.spreadsheet tbody td {
    padding: 10px 8px;
    border: 1px solid var(--border-color);
    vertical-align: top;
}

.spreadsheet tbody td.clickable {
    cursor: pointer;
    max-width: 500px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spreadsheet tbody td.clickable:hover {
    background: #e0e7ff;
}

/* TBB Checks */
.tbb-cell {
    text-align: center;
}

.tbb-check {
    width: 20px;
    height: 20px;
    cursor: default;
}

.tbb-check.checked {
    color: var(--success-color);
}

.tbb-check.unchecked {
    color: var(--border-color);
}

/* Custom Columns */
.custom-col {
    background: #fef3c7;
}

.custom-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: inherit;
}

.custom-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.custom-textarea {
    width: 100%;
    min-width: 140px;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: inherit;
    resize: vertical;
    min-height: 40px;
}

.custom-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Keywords */
.keyword {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin: 2px;
    font-weight: 500;
}

.bijlage-badge {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Status Select */
.status-select {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 0.8rem;
    background: white;
    cursor: pointer;
}

.status-select.status-niet-gestart {
    background: #fee2e2;
    color: #991b1b;
}

.status-select.status-bezig {
    background: #fef3c7;
    color: #92400e;
}

.status-select.status-klaar {
    background: #dcfce7;
    color: #166534;
}

/* Hidden Class */
.hidden {
    display: none !important;
}

/* Actions Section */
.actions-section {
    padding: 20px 24px;
    background: var(--bg-color);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Footer */
footer {
    padding: 16px 24px;
    text-align: center;
    background: var(--surface-color);
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--surface-color);
    margin: 5% auto;
    padding: 30px;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s ease;
}

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

#modalTitle {
    margin-bottom: 20px;
    color: var(--text-primary);
    padding-right: 40px;
}

#modalBody {
    color: var(--text-secondary);
}

#modalBody p {
    margin-bottom: 12px;
}

#modalBody .detail-section {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-color);
    border-radius: var(--radius-md);
}

#modalBody .detail-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .stats-bar {
        flex-direction: column;
        gap: 12px;
    }

    .spreadsheet {
        font-size: 0.75rem;
    }

    .spreadsheet thead th,
    .spreadsheet tbody td {
        padding: 8px 6px;
    }

    .actions-section {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Highlight Search */
.highlight {
    background: #fef08a;
    padding: 1px 2px;
    border-radius: 2px;
}

/* Scrollbar Styling */
.table-container::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.table-container::-webkit-scrollbar-track {
    background: var(--bg-color);
}

.table-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}
