/* ============================================================
   Buro Vernuft — Portal Stylesheet
   Pas de variabelen hieronder aan naar jullie huisstijl
   ============================================================ */

:root {
  /* === BRAND KLEUREN — Pas hier aan === */
  --bv-accent:        #C8FF00;       /* Primaire accentkleur */
  --bv-accent-dark:   #A8D900;       /* Hover staat van accent */
  --bv-black:         #0D0E12;       /* Achtergrond / donker */
  --bv-surface:       #16181F;       /* Kaart achtergrond */
  --bv-surface-2:     #1E2029;       /* Input achtergrond */
  --bv-border:        #2A2C36;       /* Randen */
  --bv-text-primary:  #F0F0F0;       /* Hoofdtekst */
  --bv-text-secondary:#8B8E9B;       /* Subtekst */
  --bv-text-hint:     #5A5D6B;       /* Hulptekst */

  /* === STATUSSEN === */
  --bv-success:       #22C55E;
  --bv-success-bg:    #22C55E18;
  --bv-error:         #EF4444;
  --bv-error-bg:      #EF444418;
  --bv-warning:       #F59E0B;
  --bv-warning-bg:    #F59E0B18;

  /* === AFMETINGEN === */
  --bv-radius:        12px;
  --bv-radius-sm:     8px;
  --bv-radius-lg:     16px;

  /* === TYPOGRAFIE === */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ============================================================
   RESET & BASE
   ============================================================ */

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

html { -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-sans);
  background-color: var(--bv-black);
  color: var(--bv-text-primary);
  min-height: 100vh;
  line-height: 1.5;
}

/* ============================================================
   LOGIN VIEW
   ============================================================ */

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  background: var(--bv-surface);
  border: 1px solid var(--bv-border);
  border-radius: var(--bv-radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
}

.brand {
  text-align: center;
  margin-bottom: 40px;
}

.brand-logo {
  width: 64px;
  height: 64px;
  background: var(--bv-accent);
  border-radius: var(--bv-radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.brand-logo--small {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  margin-bottom: 0;
}

.brand-logo-mark {
  font-weight: 900;
  font-size: 20px;
  color: var(--bv-black);
  letter-spacing: -1px;
}

.brand-logo--small .brand-logo-mark {
  font-size: 11px;
  letter-spacing: -0.5px;
}

.brand-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--bv-text-primary);
  letter-spacing: -0.5px;
}

.brand-tagline {
  font-size: 14px;
  color: var(--bv-text-secondary);
  margin-top: 4px;
}

/* ============================================================
   FORMULIER ELEMENTEN
   ============================================================ */

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--bv-text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.field-input {
  width: 100%;
  background: var(--bv-surface-2);
  border: 1px solid var(--bv-border);
  border-radius: var(--bv-radius-sm);
  color: var(--bv-text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  padding: 12px 16px;
  transition: border-color 0.15s;
  outline: none;
}

.field-input:focus {
  border-color: var(--bv-accent);
}

.field-input::placeholder {
  color: var(--bv-text-hint);
  font-size: 13px;
}

.field-hint {
  font-size: 13px;
  color: var(--bv-text-hint);
  margin-top: 8px;
  line-height: 1.4;
}

/* ============================================================
   KNOPPEN
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: var(--bv-radius-sm);
  cursor: pointer;
  padding: 10px 20px;
  transition: opacity 0.15s, background 0.15s, transform 0.1s;
  text-decoration: none;
  white-space: nowrap;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--bv-accent);
  color: var(--bv-black);
}
.btn-primary:hover:not(:disabled) { background: var(--bv-accent-dark); }

.btn-ghost {
  background: transparent;
  color: var(--bv-text-secondary);
  border: 1px solid var(--bv-border);
}
.btn-ghost:hover:not(:disabled) { color: var(--bv-text-primary); border-color: var(--bv-text-secondary); }

.btn-danger {
  background: var(--bv-error);
  color: white;
}
.btn-danger:hover:not(:disabled) { opacity: 0.85; }

.btn-full { width: 100%; margin-top: 20px; padding: 14px; font-size: 15px; }

.btn-sm { padding: 6px 14px; font-size: 13px; }

/* Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-icon { animation: spin 0.8s linear infinite; width: 16px; height: 16px; }

/* ============================================================
   HEADER
   ============================================================ */

.header {
  background: var(--bv-surface);
  border-bottom: 1px solid var(--bv-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--bv-text-primary);
}

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

.key-badge {
  font-size: 12px;
  color: var(--bv-text-hint);
  font-family: 'SF Mono', 'Monaco', monospace;
  background: var(--bv-surface-2);
  border: 1px solid var(--bv-border);
  padding: 4px 10px;
  border-radius: 20px;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */

.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.page-header {
  margin-bottom: 32px;
}

.page-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--bv-text-primary);
  letter-spacing: -0.5px;
}

.page-subtitle {
  font-size: 15px;
  color: var(--bv-text-secondary);
  margin-top: 8px;
  max-width: 560px;
  line-height: 1.6;
}

/* ============================================================
   KANALEN GRID
   ============================================================ */

.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.channel-card {
  background: var(--bv-surface);
  border: 1px solid var(--bv-border);
  border-radius: var(--bv-radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.15s;
}

.channel-card:hover { border-color: var(--bv-border); }
.channel-card.is-connected { border-color: var(--bv-success); }

.channel-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.channel-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--bv-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.channel-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.channel-status.connected {
  background: var(--bv-success-bg);
  color: var(--bv-success);
}

.channel-status.disconnected {
  background: var(--bv-surface-2);
  color: var(--bv-text-hint);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.channel-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--bv-text-primary);
}

.channel-meta {
  font-size: 13px;
  color: var(--bv-text-secondary);
  margin-top: 2px;
}

.channel-account {
  font-size: 12px;
  color: var(--bv-text-hint);
  font-family: 'SF Mono', monospace;
  background: var(--bv-surface-2);
  padding: 2px 8px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 4px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channel-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.channel-actions .btn { flex: 1; }

/* ============================================================
   LOOKER INFO BANNER
   ============================================================ */

.looker-info {
  background: var(--bv-surface);
  border: 1px solid var(--bv-border);
  border-left: 3px solid var(--bv-accent);
  border-radius: var(--bv-radius-sm);
  padding: 16px 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.looker-info-icon {
  color: var(--bv-accent);
  flex-shrink: 0;
  margin-top: 2px;
}

.looker-info strong {
  display: block;
  font-size: 14px;
  color: var(--bv-text-primary);
  margin-bottom: 4px;
}

.looker-info p {
  font-size: 13px;
  color: var(--bv-text-secondary);
  line-height: 1.5;
}

/* ============================================================
   MODALS
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 200;
  backdrop-filter: blur(4px);
}

.modal-card {
  background: var(--bv-surface);
  border: 1px solid var(--bv-border);
  border-radius: var(--bv-radius-lg);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
}

.modal-card--sm { max-width: 360px; }

.modal-header {
  padding: 24px 24px 0;
  display: flex;
  align-items: center;
  gap: 16px;
}

.modal-channel-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--bv-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--bv-text-primary);
}

.modal-body {
  padding: 20px 24px;
}

.modal-body p {
  font-size: 14px;
  color: var(--bv-text-secondary);
  line-height: 1.6;
}

.modal-body p strong { color: var(--bv-text-primary); }

.modal-footer {
  padding: 0 24px 24px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ============================================================
   FOUT & SUCCES BERICHTEN
   ============================================================ */

.error-message {
  background: var(--bv-error-bg);
  border: 1px solid var(--bv-error);
  border-radius: var(--bv-radius-sm);
  color: var(--bv-error);
  font-size: 13px;
  padding: 10px 14px;
  margin-top: 12px;
}

/* ============================================================
   TOAST NOTIFICATIE
   ============================================================ */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bv-text-primary);
  color: var(--bv-black);
  font-size: 14px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: var(--bv-radius-sm);
  z-index: 300;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: toast-in 0.2s ease;
}

.toast.success { background: var(--bv-success); color: white; }
.toast.error   { background: var(--bv-error);   color: white; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================================
   LOADING STATE
   ============================================================ */

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--bv-text-hint);
  gap: 10px;
  font-size: 14px;
}

.loading-spinner svg { animation: spin 0.8s linear infinite; }
