/* Algemene styling - Donker thema */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0d1117;
    min-height: 100vh;
    color: #c9d1d9;
    font-size: 12px;
    line-height: 1.4;
}

/* Login pagina */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: #0d1117;
}

.login-box {
    background: #161b22;
    padding: 24px;
    border-radius: 6px;
    border: 1px solid #30363d;
    width: 100%;
    max-width: 380px;
}

.login-box h1 {
    text-align: center;
    margin-bottom: 20px;
    color: #f0f6fc;
    font-size: 20px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #c9d1d9;
    font-size: 12px;
}

.form-group input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #30363d;
    border-radius: 6px;
    font-size: 12px;
    background: #0d1117;
    color: #c9d1d9;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #58a6ff;
}

.form-group input::placeholder {
    color: #6e7681;
}

.error-message {
    color: #f85149;
    margin-top: 6px;
    display: none;
    font-size: 11px;
}

/* Knoppen */
.btn {
    padding: 6px 12px;
    border: 1px solid #30363d;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-primary {
    background-color: #238636;
    color: #fff;
    border-color: #238636;
    width: 100px;
}

.btn-primary:hover {
    background-color: #2ea043;
    border-color: #2ea043;
}

.btn-secondary {
    background-color: #21262d;
    color: #c9d1d9;
    border-color: #30363d;
}

.btn-secondary:hover {
    background-color: #30363d;
    border-color: #484f58;
}

.btn-danger {
    background-color: #da3633;
    color: #fff;
    border-color: #da3633;
}

.btn-danger:hover {
    background-color: #f85149;
    border-color: #f85149;
}

.btn-small {
    padding: 3px 8px;
    font-size: 11px;
}

.btn-remove {
    background: none;
    border: none;
    color: #f85149;
    font-size: 16px;
    cursor: pointer;
    padding: 0 6px;
}

.btn-remove:hover {
    color: #ff6b6b;
}

/* Dashboard */
.dashboard-container {
    min-height: 100vh;
    background: #0d1117;
}

.dashboard-header {
    background: #161b22;
    padding: 10px 20px;
    border-bottom: 1px solid #30363d;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.dashboard-header h1 {
    color: #f0f6fc;
    font-size: 18px;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.user-info {
    color: #8b949e;
    font-size: 11px;
}

.dashboard-main {
    padding: 16px;
    max-width: 1400px;
    margin: 0 auto;
}

.search-section {
    margin-bottom: 16px;
}

.search-box {
    display: flex;
    gap: 6px;
}

.search-box input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #30363d;
    border-radius: 6px;
    font-size: 12px;
    background: #0d1117;
    color: #c9d1d9;
}

.search-box input:focus {
    outline: none;
    border-color: #58a6ff;
}

.results-info {
    margin-bottom: 10px;
    color: #8b949e;
    font-size: 11px;
}

.results-table-container {
    background: #161b22;
    border-radius: 6px;
    border: 1px solid #30363d;
    overflow: hidden;
}

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

thead {
    background-color: #161b22;
    border-bottom: 1px solid #30363d;
}

th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    color: #8b949e;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* Verbeterde kolomverdeling */
th:nth-child(1) { min-width: 200px; max-width: 300px; } /* Subject */
th:nth-child(2) { min-width: 150px; max-width: 200px; } /* From */
th:nth-child(3) { min-width: 120px; max-width: 180px; } /* To */
th:nth-child(4) { min-width: 140px; max-width: 160px; } /* Date */
th:nth-child(5) { min-width: 200px; max-width: 400px; } /* Snippet */

td {
    padding: 8px 10px;
    border-bottom: 1px solid #21262d;
    font-size: 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Kolom specifieke styling */
td:nth-child(1) { max-width: 300px; } /* Subject */
td:nth-child(2) { max-width: 200px; } /* From */
td:nth-child(3) { max-width: 180px; } /* To */
td:nth-child(4) { max-width: 160px; white-space: nowrap; } /* Date */
td:nth-child(5) { max-width: 400px; } /* Snippet */

tbody tr {
    transition: background-color 0.15s;
}

tbody tr:hover {
    background-color: #161b22;
}

tbody tr:last-child td {
    border-bottom: none;
}

.subject-cell {
    font-weight: 500;
    color: #c9d1d9;
}

.no-results {
    text-align: center;
    color: #6e7681;
    padding: 24px !important;
    font-size: 12px;
}

.loading {
    text-align: center;
    color: #58a6ff;
    padding: 24px !important;
    font-size: 12px;
}

.error {
    text-align: center;
    color: #f85149;
    padding: 24px !important;
    font-size: 12px;
}

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

.modal-content {
    background-color: #161b22;
    margin: 3% auto;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #30363d;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.email-viewer {
    max-width: 1200px;
}

.close {
    color: #8b949e;
    float: right;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 12px;
    top: 12px;
    transition: color 0.2s;
}

.close:hover {
    color: #f0f6fc;
}

/* E-mail viewer */
.email-viewer-controls {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #30363d;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
    color: #c9d1d9;
    font-size: 12px;
}

.checkbox-label input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #238636;
}

.email-header {
    border-bottom: 1px solid #30363d;
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.email-field {
    margin-bottom: 6px;
    color: #8b949e;
    font-size: 12px;
}

.email-field strong {
    color: #c9d1d9;
    display: inline-block;
    width: 80px;
    font-weight: 500;
    font-size: 12px;
}

.email-body {
    margin: 12px 0;
    line-height: 1.5;
    color: #c9d1d9;
    font-size: 12px;
}

.email-body-html iframe {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
}

.email-body pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: inherit;
    background: #0d1117;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #30363d;
    font-size: 11px;
}

.email-attachments {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #30363d;
    font-size: 12px;
}

.email-attachments ul {
    list-style: none;
    margin-top: 6px;
}

.email-attachments li {
    padding: 3px 0;
    color: #8b949e;
    font-size: 11px;
}

/* Recente zoekopdrachten */
.recent-search-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    border-bottom: 1px solid #21262d;
    cursor: pointer;
    transition: background-color 0.15s;
}

.recent-search-item:hover {
    background-color: #161b22;
}

.recent-search-query {
    flex: 1;
    color: #58a6ff;
    font-size: 12px;
}

.recent-search-query:hover {
    text-decoration: underline;
}

/* Admin paneel */
.admin-section {
    background: #161b22;
    padding: 16px;
    border-radius: 6px;
    border: 1px solid #30363d;
    margin-bottom: 16px;
}

.admin-section h2 {
    margin-bottom: 12px;
    color: #f0f6fc;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #30363d;
    padding-bottom: 6px;
}

.admin-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.admin-form input,
.admin-form select {
    padding: 6px 10px;
    border: 1px solid #30363d;
    border-radius: 6px;
    background: #0d1117;
    color: #c9d1d9;
    font-size: 12px;
}

.admin-form input:focus,
.admin-form select:focus {
    outline: none;
    border-color: #58a6ff;
}

.admin-table {
    width: 100%;
    margin-top: 12px;
    table-layout: auto;
}

.admin-table th {
    background-color: #161b22;
    color: #8b949e;
    padding: 8px 10px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid #30363d;
    white-space: nowrap;
}

.admin-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #21262d;
    font-size: 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.admin-table td:first-child {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-table tbody tr:hover {
    background-color: #161b22;
}

.admin-actions {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}

/* Status indicatoren */
span[style*="color: green"] {
    color: #238636 !important;
}

span[style*="color: red"] {
    color: #f85149 !important;
}

code {
    background: #0d1117;
    padding: 2px 5px;
    border-radius: 3px;
    border: 1px solid #30363d;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 11px;
    color: #c9d1d9;
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

/* Token code styling in tables */
.admin-table code {
    max-width: 250px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 10px 14px;
    }
    
    .dashboard-header h1 {
        font-size: 16px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .dashboard-main {
        padding: 12px;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 14px;
    }
    
    table {
        font-size: 11px;
    }
    
    th, td {
        padding: 6px 8px;
    }
    
    .admin-form {
        grid-template-columns: 1fr;
    }
}
