/* =======================================================
   1. VARIABELEN & BASISSTIJLEN
   ======================================================= */

:root {
  --color-primary: #00657f;
  --color-primary-dark: #004f63;
  --color-secondary: #3366cc;
  --color-text: #333;
  --color-muted: #666;
  --color-border: #ccc;
  --color-background: #f8f9fa;
  --color-white: #fff;
  --font-family: 'Segoe UI', Arial, sans-serif;
  --border-radius: 6px;
}

body {
  background: var(--color-background);
  font-family: var(--font-family);
  margin: 0; /* Beter dan een vaste marge */
  color: var(--color-text);
}

/* Gebruik een container voor de content om ruimte te creëren */
.content-wrapper {
  padding: 25px;
}

h1 {
  color: var(--color-primary);
  margin-top: 0;
  margin-bottom: 20px;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}
a:hover { text-decoration: underline; }

.muted {
  color: var(--color-muted);
  font-size: 14px;
}

/* =======================================================
   2. NAVIGATIE (NIEUWE STRUCTUUR)
   ======================================================= */

/* --- Hoofd-headerbalk --- */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--color-white);
  padding: 10px 25px;
}
.header-left h2 { margin: 0; font-size: 20px; }
.header-left h2 a { color: var(--color-white); text-decoration: none; }

.header-right { font-size: 13px; color: var(--color-white); }
.header-right a { color: var(--color-white); }

/* --- Primaire navigatie (Hoofdmenu) --- */
.primary-nav {
  display: flex;
  background-color: rgba(0,0,0,0.2);
  border-radius: 8px;
  padding: 4px;
}
.primary-nav a {
  color: var(--color-white);
  padding: 8px 20px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--border-radius);
  transition: background-color 0.2s;
}
.primary-nav a:hover { background-color: rgba(255, 255, 255, 0.1); }
.primary-nav a.active {
  background-color: var(--color-white);
  color: var(--color-text);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* --- Secundaire navigatie (Contextueel menu) --- */
.secondary-nav {
  display: flex;
  align-items: center;
  padding: 8px 25px;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
  gap: 20px;
  border-bottom: 1px solid #ddd;
}
.secondary-nav a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}
.secondary-nav a:hover { border-color: currentColor; opacity: 0.8; }
.secondary-nav a.active { font-weight: 700; border-color: currentColor; }


/* --- Dashboard Kleurenschema's --- */
/* home (ShopX Groen) */
.home-mode .main-header { background: linear-gradient(90deg, #7d8a6b 0%, #7d8a6b 100%); }
.home-mode .secondary-nav { background-color: #e3f2fd; }
.home-mode .secondary-nav a { color: #7d8a6b; }

/* 🔵 TextSync (Blauw) */
.textsync-mode .main-header { background: linear-gradient(90deg, #0d47a1 0%, #1976d2 100%); }
.textsync-mode .secondary-nav { background-color: #e3f2fd; }
.textsync-mode .secondary-nav a { color: #0d47a1; }

/* 🟢 Channable (Groen) */
.channable-mode .main-header { background: linear-gradient(90deg, #1b5e20 0%, #2e7d32 100%); }
.channable-mode .secondary-nav { background-color: #e8f5e9; }
.channable-mode .secondary-nav a { color: #1b5e20; }
.channable-mode body { background-color: #f1f9f8; } /* Optionele lichtere achtergrond */

/* 🟠 Vendor (Oranje) */
.vendor-mode .main-header { background: linear-gradient(90deg, #bf360c 0%, #e64a19 100%); }
.vendor-mode .secondary-nav { background-color: #fbe9e7; }
.vendor-mode .secondary-nav a { color: #bf360c; }


/* =======================================================
   3. FORMULIEREN & KNOPPEN
   ======================================================= */
button, .btn {
  background-color: var(--color-primary);
  color: var(--color-white);
  border: none;
  padding: 9px 15px;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  transition: background-color 0.2s ease;
}
button:hover, .btn:hover { background-color: var(--color-primary-dark); }

.btn.secondary { background-color: var(--color-secondary); }
.btn.secondary:hover { background-color: #274b99; }
.btn.muted, .btn.reset {
  background: #f0f0f0; color: var(--color-text); border: 1px solid var(--color-border);
}
.btn.muted:hover, .btn.reset:hover { background: #e6e6e6; }
.btn.small { font-size: 12px; padding: 5px 10px; }


input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea {
  padding: 8px 10px;
  border-radius: var(--border-radius);
  border: 1px solid var(--color-border);
  font-size: 14px;
  background: var(--color-white);
  width: 100%;
  box-sizing: border-box;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--color-primary);
  outline: 2px solid transparent;
}

textarea {
  min-height: 80px;
  font-family: monospace;
  resize: vertical;
}
textarea.approved { background-color: #e6ffe6 !important; }

/* =======================================================
   4. TABELLEN
   ======================================================= */
.table-container {
  background: var(--color-white);
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 1px 10px rgba(0,0,0,0.05);
  overflow-x: auto; /* Zorgt dat tabellen scrollen op kleine schermen */
}

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

th, td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #ddd;
  vertical-align: middle;
  font-size: 14px;
}

th {
  background-color: #f1f5f9;
  color: #334155;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
}

tr:hover { background-color: #fff8e1; }

td.ok { background-color: #dcfce7; color: #15803d; }
td.empty { color: var(--color-muted); }
td.missing { background-color: #fee2e2; color: #b91c1c; font-weight: 600; }

/* =======================================================
   5. COMPONENTEN (Filterbar, Paginering, etc.)
   ======================================================= */
.filterbar {
  background: var(--color-white);
  padding: 15px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  border: 1px solid #e2e8f0;
}
.filterbar form {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}
.filterbar form > div { flex-grow: 1; }
.filterbar label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 4px;
}
.filterbar input[type="text"],
.filterbar select { min-width: 180px; }

.pagination {
  margin-top: 20px;
  text-align: center;
}
.pagination a {
  display: inline-block;
  margin: 0 4px;
  padding: 6px 12px;
  background: var(--color-white);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
}
.pagination a:hover { background: #f0f8ff; }
.pagination a.active {
  background: var(--color-primary);
  color: var(--color-white);
  font-weight: bold;
  border-color: var(--color-primary);
}

.status-box, .save-message {
  background-color: #e0f2fe;
  color: #0c4a6e;
  border: 1px solid #7dd3fc;
  padding: 12px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
}

/* =======================================================
   6. LOGIN PAGINA
   ======================================================= */
.login-container {
  max-width: 360px;
  margin: 100px auto;
  background: var(--color-white);
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  text-align: center;
}
.login-container h2 { color: var(--color-primary); margin-bottom: 20px; }
.login-container input { margin-bottom: 15px; }
.error { color: #b91c1c; font-weight: 600; margin-bottom: 15px; }


/* Stijl voor bewerkbare input-velden direct in een tabel */
td .inline-edit {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 5px;
  font-size: 14px;
  border-radius: 4px;
  transition: all 0.2s ease-in-out;
}
td .inline-edit:focus {
  background: #fff;
  border-color: var(--color-border);
  outline: 2px solid transparent;
  box-shadow: 0 0 5px rgba(0, 101, 127, 0.2);
}

.filterbar {
  display: flex;
  flex-wrap: wrap; /* Zorgt dat het netjes onder elkaar springt op kleine schermen */
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: var(--color-white);
  padding: 15px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  border: 1px solid #e2e8f0;
}

/* --- Tab navigatie (voor duplicates pagina) --- */
.tabs {
  display: flex;
  gap: 8px;
  /* Verwijder de border-bottom hier om de filterbar-rand te gebruiken */
}

.tab {
  padding: 8px 16px;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  font-weight: 600;
  color: var(--color-muted);
  background-color: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  transition: all 0.2s ease-in-out;
}

.tab:hover {
  background-color: #eef2f5;
  color: var(--color-text);
}

.tab.active {
  color: var(--color-primary);
  background-color: var(--color-white);
  border-color: #e2e8f0;
  border-bottom: 1px solid var(--color-white); /* Belangrijkste toevoeging */
  /* Plaats de actieve tab 'boven' de container-rand */
  position: relative;
  bottom: -1px; /* Correcte positionering */
  z-index: 1; /* Zorgt dat de tab boven de container-rand komt */
}

/* =======================================================
   7. EDIT PAGINA SPECIFIEK
   ======================================================= */

.edit-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 25px;
}
.edit-page-header .muted b {
  color: var(--color-text);
}

.edit-layout {
  display: grid;
  grid-template-columns: 2fr 1fr; /* 2/3 voor velden, 1/3 voor sidebar */
  gap: 25px;
  align-items: flex-start;
}

.fields-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field-card {
  background-color: var(--color-white);
  border: 1px solid #e2e8f0;
  border-radius: var(--border-radius);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.field-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  border-bottom: 1px solid #e2e8f0;
  background-color: #f8fafc;
}
.field-card-header h3 {
  margin: 0;
  font-size: 16px;
}

.approve-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.approve-toggle input {
  width: auto;
}

.field-card-body {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.source-field label, .manual-field-header label {
  display: block;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--color-muted);
}
.source-field textarea {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  cursor: not-allowed;
}

.manual-field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* SEO hints onder de textareas */
.seo-hint {
  font-size: 12px;
  margin-top: 5px;
  padding: 4px 8px;
  border-radius: 4px;
}
.seo-hint.ok { color: #15803d; background-color: #dcfce7; }
.seo-hint.warning { color: #854d0e; background-color: #fef9c3; }
.seo-hint.error { color: #991b1b; background-color: #fee2e2; }

/* Sidebar styling */
.sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.sticky-sidebar {
  position: sticky;
  top: 20px; /* Blijft plakken bij scrollen */
}
.sidebar-column .btn {
  width: 100%;
}

/* SEO issues in de sidebar */
.seo-issues-container .seo-ok {
  color: #15803d;
  font-weight: 600;
}
.seo-issue {
  padding: 8px;
  border-radius: 4px;
  font-size: 13px;
  border-left: 4px solid;
  margin-bottom: 10px;
}
.seo-issue.low { border-color: #3b82f6; background-color: #eff6ff; }
.seo-issue.medium { border-color: #f97316; background-color: #fff7ed; }
.seo-issue.high { border-color: #dc2626; background-color: #fef2f2; }

/* Voeg toe aan sectie 3 (Knoppen) */
.btn.success {
  background-color: #28a745;
  color: var(--color-white);
}
.btn.success:hover {
  background-color: #218838;
}

/* Voeg toe aan sectie 4 (Tabellen) */
td.actions-cell {
  white-space: nowrap; /* Zorgt dat de acties niet onder elkaar breken */
  text-align: right;
}
td.actions-cell a {
  vertical-align: middle;
}

/* Nieuw: Markeer cellen met een leeg, bewerkbaar veld */
td:has(input.inline-edit:placeholder-shown) {
  background-color: #fffbeb; /* Een subtiele, warme gele tint */
}

/* Verbeter de leesbaarheid van de placeholder-tekst zelf */
.inline-edit::placeholder {
  color: #a1a1aa; /* Iets donkerder grijs */
  font-style: italic;
  opacity: 1; /* Zorg ervoor dat de placeholder niet te flets is */
}

/* Nieuw: Markeer cellen met een GEVULD, bewerkbaar veld */
td:has(input.inline-edit:not(:placeholder-shown)) {
  background-color: #f0fdf4; /* Hele lichte, zachte groene tint */
  border-left: 3px solid #22c55e; /* Duidelijke groene accentrand */
}

/* =======================================================
   9. MODAL (POP-UP) STYLING
   ======================================================= */
.clickable-row {
    cursor: pointer;
}
.clickable-row:hover {
    background-color: #eef2ff !important; /* Een lichte paars/blauwe hover */
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: var(--color-white);
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
}
.modal-header h3 {
    margin: 0;
    font-size: 18px;
}
.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--color-muted);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
}
.modal-body ul {
    list-style-type: disc;
    padding-left: 20px;
}
.modal-body li {
    margin-bottom: 8px;
}

/* Styling voor 'oude data' cellen in de prijscalculator */
td.old-price {
  color: var(--color-muted);
  font-size: 13px;
  background-color: #f8fafc; /* Heel lichtgrijs */
}