/* css/admin.css */

/* Layout Framework */
.top-bar {
    width: 100%;
    background: var(--primary);
    color: var(--primary-text-contrast);
    font-size: 20px;
    font-weight: bold;
    padding: 15px 30px;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.top-bar .btn {
    font-size: 14px;
    font-weight: normal;
    padding: 8px 15px;
    color: white !important;
}

.layout-wrapper {
    display: flex;
    flex: 1;
    width: 100%;
    overflow: hidden;
    height: calc(100vh - 60px);
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--header-bg);
    color: white;
    padding: 20px;
    flex-shrink: 0;
    overflow-y: auto;
}

.sidebar h2 {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: var(--secondary-text-contrast);
}

.nav-item {
    padding: 12px;
    cursor: pointer;
    border-radius: 6px;
    margin-bottom: 5px;
    transition: 0.2s;
    display: flex;
    align-items: center;
}

.nav-item:hover { background: #334155; }
.nav-item.active {
    background: var(--primary);
    color: var(--primary-text-contrast);
}
.nav-exit { color: var(--text-muted); margin-top: 20px; }

#adminAppTitle { color: var(--primary-text-contrast) !important; }
.nav-exit { color: white !important; opacity: 0.8; }
.nav-exit:hover { opacity: 1; }

/* Main Content */
.main {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    background: var(--bg);
}

.card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* --- FLEX HEADER (AANGEPAST VOOR IPAD/DESKTOP) --- */
.flex-header {
    display: flex;
    flex-direction: row; /* Altijd naast elkaar */
    flex-wrap: nowrap;   /* Niet omvouwen */
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
    width: 100%;
}

/* Dropdowns verdelen de ruimte */
.flex-header select {
    flex: 1;             /* Groei om ruimte te vullen */
    min-width: 150px;    /* Niet te smal worden */
    width: auto !important;
    margin: 0;
}

/* Knop behoudt zijn eigen breedte */
.flex-header button {
    flex-shrink: 0;      /* Niet krimpen */
    width: auto;
    white-space: nowrap;
}

/* Item Lists */
.item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #f1f5f9;
}

.item-info { flex: 1; }
.item-actions { display: flex; gap: 5px; }

.badge-domain {
    background: #e0f2fe;
    color: #0369a1;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

.admin-status-passed {
    background-color: #dcfce7;
    color: #16a34a;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    border: 1px solid #16a34a;
}

.admin-status-failed {
    background-color: #fee2e2;
    color: #dc2626;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    border: 1px solid #dc2626;
}

/* Paginatie */
.pagi-container { 
    margin-top: 25px; 
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap; 
}

.pagi-btn {
    padding: 0 12px;
    height: 40px; 
    border: 1px solid var(--border);
    background: white;
    cursor: pointer;
    border-radius: 6px;
    min-width: 40px; 
    font-weight: bold;
    color: var(--header-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all 0.2s;
}

.pagi-btn:hover:not(:disabled) {
    background-color: #f1f5f9;
    border-color: var(--primary);
}

.pagi-active { 
    background: var(--primary) !important; 
    color: white !important; 
    border-color: var(--primary) !important;
}

.pagi-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #f8fafc;
}

.pagi-dots {
    padding: 0 5px;
    color: var(--text-muted);
    font-weight: bold;
    user-select: none;
}

/* Settings Tabs */
.settings-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 25px;
    overflow-x: auto; /* Scrollen op mobiel indien nodig */
}

.tab-btn {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background: none;
    font-weight: bold;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    white-space: nowrap;
}

.tab-btn:hover { color: var(--primary); }
.tab-btn.active {
    background-color: var(--primary);
    color: var(--primary-text-contrast);
    border-radius: 4px;
    border-bottom: 2px solid var(--primary); /* Keep border but it blends if background matches */
}

/* Taal Grid */
.lang-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.lang-card {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    background: #f8fafc;
    position: relative;
    transition: opacity 0.3s;
}

.lang-flag { font-size: 2rem; display: block; margin-bottom: 3px; }
.lang-name { font-weight: bold; font-size: 1rem; }
.lang-code { color: var(--text-muted); font-family: monospace; font-size: 0.8rem; }
.lang-actions { margin-top: 10px; display: flex; gap: 3px; justify-content: center; }
.lang-actions .btn { padding: 4px 8px; font-size: 12px; }

/* Vertaling Editor Tabel */
.trans-table { width: 100%; border-collapse: collapse; margin-top: 10px; }
.trans-table th { text-align: left; padding: 10px; background: #f1f5f9; border-bottom: 2px solid var(--border); position: sticky; top: 0; }
.trans-table td { padding: 10px; border-bottom: 1px solid #f1f5f9; }
.trans-key { font-family: monospace; color: var(--primary); font-size: 0.9em; width: 30%; }
.trans-input { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 4px; }

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 10px;
    width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-footer { margin-top: 20px; display: flex; gap: 10px; }
.flex-1 { flex: 1; }

/* Responsive Adjustments */
@media screen and (max-width: 900px) {
    .layout-wrapper { flex-direction: column; height: auto; }
    .sidebar { width: 100%; padding: 5px; display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
    .sidebar h2, .sidebar hr { display: none; }
    .nav-item { padding: 8px 12px; margin: 0; font-size: 14px; flex: 1 1 auto; justify-content: center; }
    .main { padding: 15px; }
}

/* Echte Mobiele weergave (< 600px) */
@media screen and (max-width: 600px) {
    /* Hier mag de header wél wrappen */
    .flex-header { 
        flex-wrap: wrap !important; 
        gap: 10px;
    }
    /* En alles onder elkaar */
    .flex-header select, 
    .flex-header .w-200, 
    .flex-header button { 
        flex: 1 1 100%; 
        width: 100% !important; 
    }

    .item-row { flex-direction: row; align-items: flex-start; gap: 10px; padding: 12px 5px; }
    .pagi-container { gap: 4px; }
    .pagi-btn { padding: 0 8px; min-width: 36px; font-size: 14px; height: 38px; }
}
