:root {
  --primary-color: #006bb7;
  --darker-primary-color: #004a80;
  --bg-color: #f4f6f8;
  --text-color: #333;
  --border-color: #e0e0e0; 
}

html { box-sizing: border-box; }
*, *:before, *:after { box-sizing: inherit; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

header {
  background: #fff;
  padding: 0.5rem 2rem;
  display: flex;
  justify-content: space-between; /* Houdt .header-left en #user-info uit elkaar */
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.notification-container {
  display: none;
  padding: 0 2rem;
  margin: 0.75rem 0 0;
}

.notification-container.notification-container--visible {
  display: block;
}

.notification {
  border-radius: 4px;
  padding: 0.75rem 1rem;
  border: 1px solid transparent;
  font-size: 0.95rem;
  font-weight: 500;
}

.notification--error {
  background: #fdecea;
  border-color: #f5c6cb;
  color: #7d0c0c;
}

.notification--warning {
  background: #fff4e5;
  border-color: #ffdaab;
  color: #8a4b0f;
}

.notification--info {
  background: #e8f4fd;
  border-color: #b6e0fe;
  color: #0b5394;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

#header-logo {
  height: 40px;
  width: auto;
  display: block;
}

nav a {
  color: var(--primary-color);
  margin-right: 1.5rem;
  text-decoration: none;
  font-weight: 400;
  transition: color .2s, background-color .2s;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
}

nav a:last-child { margin-right: 0; }

nav a:hover,
nav a:focus {
  color: var(--darker-primary-color);
  text-decoration: underline;
}

nav a.active {
  background-color: var(--primary-color);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#user-info {
  /* De "justify-content: space-between" op de header doet nu al het werk */
  white-space: nowrap; 
}

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

main#content-container {
    padding: 1rem 2rem;
    flex-grow: 1;
}

footer {
  background: #e9ecef;
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
  color: #666;
  flex-shrink: 0;
}

@media (max-width: 850px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
  }

  .notification-container {
    padding: 0 1rem;
  }

  .header-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
  }
  
  nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  nav a { margin-right: 0; }
  
  #user-info {
      padding-top: 1rem;
      border-top: 1px solid var(--border-color);
      width: 100%;
      text-align: left;
  }
}

main#content-container {
    padding: 0; /* Verwijder padding om de kaart de volle ruimte te geven */
    flex-grow: 1;
    display: flex; /* Noodzakelijk voor de hoogte van de map-wrapper */
    flex-direction: column; /* Noodzakelijk voor de hoogte van de map-wrapper */
}

html, body {
    height: 100%; /* Zorgt dat de body de volledige viewport hoogte heeft */
}

html, body, #app-container {
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Stijl voor de leads pagina */
#leads-page {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    width: 100%;
}

#leads-page .loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 2rem 0;
    color: var(--primary-color);
    font-weight: 500;
}

#leads-loading .spinner {
    width: 1.75rem;
    height: 1.75rem;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 9999px;
    animation: leads-spin 0.8s linear infinite;
}

#leads-page .is-hidden {
    display: none !important;
}

#leads-content {
    transition: opacity 0.2s ease-in-out;
}

#leads-content:not(.is-hidden) {
    opacity: 1;
}

#leads-content.is-hidden {
    opacity: 0;
}

#leads-page h2 {
    text-align: center;
}

#leads-table {
    width: 100%;
}

#leads-table thead .filter-row th {
    padding: 0.25rem;
}

#leads-table thead .filter-row input {
    width: 100%;
    padding: 0.25rem;
    border: 1px solid var(--border-color);
}

/* Laat de #app-container meegroeien */
#app-container {
    flex-grow: 1;
}

/* Laat de content-container alle resterende ruimte vullen */
main#content-container {
    flex-grow: 1; /* Dit is de belangrijkste regel */
    display: flex;
    flex-direction: column;
    padding: 0; /* Zorgt dat de kaart de volle breedte/hoogte kan gebruiken */
}

@keyframes leads-spin {
    to {
        transform: rotate(360deg);
    }
}
