/* DomeinPortal — main.css */
/* Kei Media huisstijl: paars #B0258C, Tahoma */

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

:root {
  --purple:      #B0258C;
  --purple-dark: #8a1a6e;
  --purple-light:#f7e9f4;
  --text:        #2d2d2d;
  --muted:       #666;
  --border:      #e0e0e0;
  --bg:          #f5f5f7;
  --white:       #ffffff;
  --success:     #2e7d32;
  --success-bg:  #e8f5e9;
  --error:       #c62828;
  --error-bg:    #ffebee;
  --warning:     #e65100;
  --warning-bg:  #fff3e0;
  --info:        #0277bd;
  --info-bg:     #e1f5fe;
  --radius:      8px;
  --shadow:      0 2px 8px rgba(0,0,0,.08);
}

body {
  font-family: 'Fredoka', cursive;
  font-size: 19px;
  color: #313b47;
  background: var(--bg);
  line-height: 1.6;
}
h1, h2, h3, h4, h5, h6 { font-weight: normal; }
h1, h2, h3, h4, h5, h6 { font-weight: normal; }

/* ── Topbar ── */
.topbar {
  background: var(--purple);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  position: sticky; top: 0; z-index: 100;
}
.topbar-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; height: 56px;
  position: relative;
}
.logo {
  font-size: 20px; font-weight: normal; color: #fff;
  text-decoration: none; letter-spacing: -.3px;
  white-space: nowrap;
}
.logo span { opacity: .7; font-weight: normal; font-size: 13px; }
.topnav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.topnav a {
  color: rgba(255,255,255,.88); text-decoration: none;
  padding: 6px 10px; border-radius: 5px; font-size: 13px;
  transition: background .15s; white-space: nowrap;
}
.topnav a:hover, .topnav a.active { background: rgba(255,255,255,.2); color: #fff; }
.topnav .sep { color: rgba(255,255,255,.3); margin: 0 2px; }
.topnav .username { color: rgba(255,255,255,.7); font-size: 13px; padding: 0 8px; }
.btn-logout {
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3);
  color: #fff !important; padding: 5px 12px !important; border-radius: 5px;
  font-size: 12px !important; cursor: pointer; white-space: nowrap;
}
.btn-logout:hover { background: rgba(255,255,255,.28) !important; }

/* ── Hamburger ── */
.hamburger {
  display: none;
  flex-direction: column; justify-content: center; align-items: center;
  width: 40px; height: 40px; gap: 5px;
  background: transparent; border: none; cursor: pointer;
  padding: 4px; border-radius: 6px;
  transition: background .15s;
}
.hamburger:hover { background: rgba(255,255,255,.15); }
.hamburger span {
  display: block; width: 22px; height: 2px;
  background: #fff; border-radius: 2px;
  transition: transform .25s, opacity .25s;
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.cart-badge {
  display: inline-block; background: #fff; color: var(--purple);
  font-size: 10px; font-weight: normal; border-radius: 10px;
  padding: 1px 5px; margin-left: 3px; vertical-align: middle;
}
.nav-divider { width: 1px; height: 20px; background: rgba(255,255,255,.25); margin: 0 4px; }
.nav-user { color: rgba(255,255,255,.8) !important; }

/* ── Container ── */
.container { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }

/* ── Alerts ── */
.alert {
  padding: 12px 16px; border-radius: var(--radius);
  margin-bottom: 20px; font-size: 14px;
}
.alert-success { background: var(--success-bg); color: var(--success); border-left: 4px solid var(--success); }
.alert-error    { background: var(--error-bg);   color: var(--error);   border-left: 4px solid var(--error); }
.alert-warning  { background: var(--warning-bg); color: var(--warning); border-left: 4px solid var(--warning); }
.alert-info     { background: var(--info-bg);    color: var(--info);    border-left: 4px solid var(--info); }

/* ── Cards ── */
.card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px;
}
.card-title {
  font-size: 16px; font-weight: normal; color: var(--purple);
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 2px solid var(--purple-light);
}

/* ── Buttons ── */
.btn {
  display: inline-block; padding: 9px 20px; border-radius: 6px;
  font-size: 13px; font-family: 'Fredoka', cursive;
  font-weight: normal; cursor: pointer; text-decoration: none;
  border: none; transition: background .15s, opacity .15s;
  line-height: 1.4; white-space: nowrap;
}
.btn-primary   { background: var(--purple); color: #fff; }
.btn-primary:hover { background: var(--purple-dark); }
.btn-secondary { background: #eee; color: var(--text); }
.btn-secondary:hover { background: #ddd; }
.btn-danger    { background: var(--error); color: #fff; }
.btn-danger:hover { opacity: .85; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-outline {
  background: transparent; border: 1px solid var(--purple);
  color: var(--purple);
}
.btn-outline:hover { background: var(--purple-light); }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: normal; margin-bottom: 5px; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 19px; font-family: 'Fredoka', cursive;
  background: #fff; color: #313b47;
  transition: border-color .15s;
}
.form-group input:focus,
.form-group select:focus {
  outline: none; border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(176,37,140,.12);
}
.form-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 160px; }

/* ── Table ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th {
  background: var(--purple-light); color: var(--purple);
  padding: 10px 12px; text-align: left; font-weight: normal; font-size: 13px;
  border-bottom: 2px solid #e0c0d8; white-space: nowrap;
}
td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fdf5fb; }

/* Eerste kolom vastzetten tijdens horizontaal scrollen, zodat je context houdt */
.table-wrap table th:first-child,
.table-wrap table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: #fff;
}
.table-wrap table th:first-child { background: var(--purple-light); z-index: 2; }
.table-wrap table tr:hover td:first-child { background: #fdf5fb; }

/* ── Prijslijst: flex-wrap rijen i.p.v. table, variabele breedtes, altijd responsive ── */
.tld-list { display: flex; flex-direction: column; }
.tld-row {
  display: flex; flex-wrap: wrap; align-items: flex-end;
  gap: 8px 18px; padding: 12px 4px; border-bottom: 1px solid var(--border);
}
.tld-row:hover { background: #fdf5fb; }
.tld-row-inactive .tld-field:not(.tld-check):not(.tld-delete) { opacity: .5; }
.tld-row-inactive .tld-field.tld-check,
.tld-row-inactive .tld-field.tld-delete { opacity: 1; }
.tld-field { display: flex; flex-direction: column; gap: 3px; min-width: 90px; }
.tld-field label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.tld-field.tld-name { min-width: 55px; }
.tld-field.tld-name strong { font-size: 14px; }
.tld-field.tld-check { min-width: 60px; align-items: center; }
.tld-field.tld-check label { text-align: center; }
.tld-field.tld-delete { min-width: 40px; justify-content: flex-end; }
.tld-field.tld-drag {
  min-width: 20px; justify-content: center; align-items: center;
  cursor: grab; color: var(--muted); font-size: 16px; user-select: none;
}
.tld-row[draggable="true"]:active .tld-field.tld-drag { cursor: grabbing; }

@media (max-width: 767px) {
  .tld-row { flex-direction: column; align-items: stretch; gap: 0; padding: 10px 4px; }
  .tld-field {
    flex-direction: row; justify-content: space-between; align-items: center;
    width: 100%; min-width: 0; padding: 6px 0; border-bottom: 1px solid #f2f2f2;
  }
  .tld-field:last-child { border-bottom: none; }
  .tld-field label { margin: 0; }
  .tld-field.tld-name { border-bottom: 1px solid #f2f2f2; }
  .tld-field.tld-name strong { font-size: 16px; }
  .tld-field.tld-delete { justify-content: flex-end; }
}

/* ── Responsive tabellen: kaartweergave op smalle schermen (geen horizontaal scrollen) ── */
@media (max-width: 800px) {
  table.responsive-cards { position: static; }
  table.responsive-cards thead { display: none; }
  table.responsive-cards, table.responsive-cards tbody, table.responsive-cards tr, table.responsive-cards td {
    display: block; width: 100%;
  }
  table.responsive-cards tr {
    border: 1px solid var(--border); border-radius: 8px;
    margin-bottom: 12px; padding: 10px 12px; background: #fff;
  }
  table.responsive-cards tr:hover td { background: transparent; }
  table.responsive-cards td {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; border-bottom: 1px solid #f2f2f2; padding: 7px 0;
    position: static !important; background: transparent !important;
  }
  table.responsive-cards td:last-child { border-bottom: none; }
  table.responsive-cards td::before {
    content: attr(data-label);
    color: var(--muted); font-size: 12px; flex-shrink: 0; margin-right: 8px;
  }
  table.responsive-cards td[data-label=""]::before { content: none; }
  table.responsive-cards td > * { flex-shrink: 0; }
}

.table-import td:nth-child(1) { width: 160px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-import td:nth-child(2) { width: 90px; white-space: nowrap; }
.table-import td:nth-child(3) { width: 180px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.table-import td:nth-child(4) { width: 180px; max-width: 180px; font-family: monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-import td:nth-child(5) { width: 90px; white-space: nowrap; }
.table-import td:nth-child(6) { width: 80px; white-space: nowrap; }
.table-import td:nth-child(7) { width: 130px; }

/* ── Status badges ── */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 12px;
  font-size: 11px; font-weight: normal; text-transform: uppercase;
}
.badge-active   { background: var(--success-bg); color: var(--success); }
.badge-expiring { background: var(--warning-bg); color: var(--warning); }
.badge-expired  { background: var(--error-bg);   color: var(--error); }
.badge-pending  { background: var(--info-bg);    color: var(--info); }

/* ── Domain search ── */
.search-box { display: flex; gap: 0; }
.search-box input {
  flex: 1; border-radius: 6px 0 0 6px !important;
  border-right: none !important;
  font-size: 16px !important; padding: 12px 16px !important;
}
.search-box button {
  border-radius: 0 6px 6px 0; padding: 12px 24px;
  font-size: 15px;
}
.tld-results { margin-top: 20px; }
.tld-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border: 1px solid var(--border);
  border-radius: 6px; margin-bottom: 8px; background: #fff;
  gap: 12px;
}
.tld-row.available { border-color: #a5d6a7; background: #f9fff9; }
.tld-row.taken     { border-color: var(--border); }
.tld-domain { font-size: 15px; font-weight: normal; word-break: break-all; }
.tld-price  { color: var(--muted); font-size: 13px; margin-left: 8px; white-space: nowrap; }
.tld-right  { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.tld-status-text { font-size: 12px; color: var(--muted); }
.tld-status-text.ok { color: var(--success); font-weight: normal; }

/* ── Dashboard stats ── */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; text-align: center;
}
.stat-card .num { font-size: 28px; font-weight: normal; color: var(--purple); }
.stat-card .lbl { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ── Auth pages ── */
.auth-wrap {
  min-height: calc(100vh - 56px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 16px;
}
.auth-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 32px; width: 100%; max-width: 420px;
}
.auth-card h1 { color: var(--purple); margin-bottom: 24px; font-size: 22px; }
.auth-card .auth-logo { text-align: center; margin-bottom: 24px; }
.auth-card .auth-logo span { font-size: 26px; font-weight: normal; color: var(--purple); }
.auth-link { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }
.auth-link a { color: var(--purple); text-decoration: none; }

/* ── DNS editor ── */
.dns-record-row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; flex-wrap: wrap; }
.dns-record-row input, .dns-record-row select { padding: 7px 10px; }
.dns-type-col  { width: 90px; min-width: 90px; }
.dns-name-col  { flex: 2; min-width: 100px; }
.dns-value-col { flex: 4; min-width: 140px; }
.dns-ttl-col   { width: 80px; min-width: 80px; }
.dns-act-col   { width: 36px; padding-top: 2px; }

/* ── Utilities ── */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-2 { margin-bottom: 16px; }
.text-muted { color: var(--muted); }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.gap-2 { gap: 8px; }

/* ── Footer ── */
.footer {
  margin-top: 40px; padding: 20px 16px;
  border-top: 1px solid var(--border);
  text-align: center; color: var(--muted); font-size: 12px;
}
.footer a { color: var(--purple); text-decoration: none; }

/* ── Responsive: tablet (hamburger) ── */
@media (max-width: 860px) {
  .hamburger { display: flex; }

  .topnav {
    display: none;
    position: absolute; top: 56px; left: 0; right: 0;
    background: var(--purple);
    flex-direction: column; align-items: stretch;
    padding: 8px 0; gap: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,.2);
    z-index: 200;
  }
  .topnav.open { display: flex; }

  .topnav a {
    padding: 13px 20px; font-size: 14px !important;
    border-radius: 0; border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .topnav a:last-child { border-bottom: none; }
  .topnav .nav-divider { display: none; }
  .topnav .btn-logout {
    margin: 8px 16px 4px;
    border-radius: 6px !important;
    text-align: center;
    display: block;
  }
}

/* ── Responsive: mobiel ── */
@media (max-width: 480px) {
  .container { padding: 12px 10px; }
  .card { padding: 14px 12px; }

  .table-wrap { margin: 0 -10px; padding: 0 10px; }

  .tld-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .tld-right { width: 100%; justify-content: space-between; flex-wrap: wrap; }
  .tld-right form { flex: 1; }
  .tld-right .btn { width: 100%; text-align: center; }

  div[style*="grid-template-columns:1fr 380px"] { display: block !important; }
  div[style*="grid-template-columns:1fr 1fr"] { display: block !important; }

  .auth-card { padding: 20px 14px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  .search-box { flex-direction: column; gap: 8px; }
  .search-box input {
    border-radius: 6px !important;
    border-right: 1px solid var(--border) !important;
    font-size: 15px !important;
    padding: 11px 14px !important;
  }
  .search-box button {
    border-radius: 6px !important;
    width: 100%; padding: 11px 16px; font-size: 14px;
  }

  .form-row { flex-direction: column; gap: 0; }
  .hide-mobile { display: none !important; }

  table { font-size: 12px; }
  th, td { padding: 8px; }
}
strong, b { font-weight: normal; }
