/* =============================================================================
   Van Leek tot Goeroe - CSS Stylesheet
   Geoptimaliseerd en gerefactored voor betere onderhoudbaarheid
   ============================================================================= */

/* =============================================================================
   1. CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ============================================================================= */

:root {
  /* Kleurenpalet */
  --kleur-accent: #52b69a;
  --kleur-accent2: #76c893;
  --kleur-accent3: #b5e48c;
  --kleur-achtergrond: #f8fff6;
  --kleur-achtergrond2: #f0faff;
  --kleur-titel: #184e77;
  --kleur-link: #168aad;
  --kleur-link-hover: #184e77;
  --kleur-h2: #1e6091;
  --kleur-h3: #1a759f;
  --kleur-h4: #168aad;
  --kleur-h5: #34a0a4;
  --kleur-h6: #52b69a;
  --kleur-quote: #76c893;
  --kleur-table: #d9ed92;
  --kleur-table-border: #b5e48c;
  
  /* Spacing */
  --padding-lijst: 1.5rem 2rem;
  --border-radius: 15px;
  --border-radius-small: 5px;
  
  /* Shadows */
  --box-shadow: 0 4px 12px rgba(82, 182, 154, 0.12);
  --box-shadow-hover: 0 6px 20px rgba(82, 182, 154, 0.18);
  --box-shadow-large: 0 8px 32px rgba(24, 78, 119, 0.1);
  
  /* Typography */
  --font-family-base: 'Inter', 'Segoe UI', Arial, sans-serif;
  --font-family-mono: 'Fira Mono', 'Consolas', monospace;
  --line-height-base: 1.4;
  --line-height-content: 1.6;
  
  /* Layout */
  --sidebar-width: 250px;
  --sidebar-width-medium: 200px;
  --content-max-width: 1100px;
  --content-max-width-medium: 900px;
  
  /* Transitions */
  --transition-base: 0.3s ease;
  --transition-fast: 0.2s ease;
}

/* =============================================================================
   2. RESET & BASE STYLES
   ============================================================================= */

* {
  box-sizing: border-box;
}

body {
  background: linear-gradient(135deg, var(--kleur-achtergrond) 0%, #fff 50%, var(--kleur-achtergrond2) 100%);
  font-family: var(--font-family-base);
  color: var(--kleur-titel);
  font-size: 1rem;
  line-height: var(--line-height-base);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-attachment: fixed;
}

/* =============================================================================
   3. TYPOGRAPHY
   ============================================================================= */

h1 {
  color: var(--kleur-titel);
  font-size: 1.4rem;
  margin: 0.8rem 0;
  letter-spacing: 0.8px;
  background: linear-gradient(135deg, var(--kleur-accent3) 0%, var(--kleur-accent2) 100%);
  padding: 0.6rem;
  border-radius: var(--border-radius);
  box-shadow: 0 5px 15px rgba(181, 228, 140, 0.3);
  position: relative;
  overflow: hidden;
  font-weight: 600;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
  animation: fadeInUp 0.6s ease-out;
}

/* H1 Hover Effect */
h1::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  transition: left 0.5s;
}

h1:hover::before {
  left: 100%;
}

/* Chapter Headers */
.hoofdstuk-header {
  cursor: pointer;
  transition: background var(--transition-fast);
}

.hoofdstuk-header:hover {
  background: #f1faee;
}

.hoofdstuk-header::after {
  content: '▶';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  transition: transform var(--transition-base);
  font-size: 1.2rem;
  color: var(--kleur-accent);
}

.hoofdstuk-header[data-open="true"]::after {
  content: '▼';
}

h2 {
  color: var(--kleur-h2);
  margin: 2rem 0 1rem 0;
  border-left: 6px solid var(--kleur-accent);
  padding: 0.8rem 1rem 0.8rem 1.5rem;
  background: linear-gradient(90deg, var(--kleur-table) 0%, rgba(217, 237, 146, 0.3) 60%, transparent 100%);
  border-radius: 0 12px 12px 0;
  position: relative;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(82, 182, 154, 0.1);
  transition: all var(--transition-base);
  animation: fadeInUp 0.6s ease-out;
}

h2:hover {
  transform: translateX(5px);
  box-shadow: 0 4px 12px rgba(82, 182, 154, 0.2);
}

h3 {
  color: var(--kleur-h3);
  margin: 1.5rem 0 0.8rem 0;
  animation: fadeInUp 0.6s ease-out;
}

h4 { color: var(--kleur-h4); }
h5 { color: var(--kleur-h5); }
h6 { color: var(--kleur-h6); }

p {
  margin-bottom: 1.5rem;
  text-align: justify;
  text-justify: inter-word;
  padding-left: 20px;
  line-height: var(--line-height-content);
  animation: fadeInUp 0.6s ease-out;
}

strong { 
  color: var(--kleur-titel); 
}

em { 
  color: var(--kleur-h3); 
}

/* =============================================================================
   4. LINKS
   ============================================================================= */

a {
  color: var(--kleur-link);
  text-decoration: none;
  border-bottom: 2px dotted var(--kleur-table-border);
  transition: color var(--transition-fast), border-bottom var(--transition-fast);
}

a:hover {
  color: var(--kleur-link-hover);
  border-bottom: 2px solid var(--kleur-link-hover);
}

a:focus {
  outline: 2px solid var(--kleur-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

/* =============================================================================
   5. LISTS
   ============================================================================= */

.content ul,
.content ol {
  margin-left: 1rem;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, var(--kleur-achtergrond) 0%, var(--kleur-achtergrond2) 100%);
  padding: var(--padding-lijst);
  border-radius: var(--border-radius);
  border-left: 4px solid var(--kleur-accent);
  box-shadow: var(--box-shadow);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  list-style: none;
  animation: fadeInUp 0.6s ease-out;
}

.content ul:hover,
.content ol:hover {
  transform: translateY(-2px);
  box-shadow: var(--box-shadow-hover);
}

/* List Items */
.content li {
  margin-bottom: 1rem;
  position: relative;
  padding-left: 0.5rem;
  line-height: var(--line-height-content);
  transition: all var(--transition-base);
}

.content ul li::before,
.content ol li::before {
  content: '●';
  color: var(--kleur-accent);
  font-weight: bold;
  position: absolute;
  left: -1.8rem;
  top: 0.1em;
  font-size: 1.2rem;
  text-shadow: 0 1px 2px rgba(82, 182, 154, 0.3);
  transition: all var(--transition-base);
  line-height: 1;
}

.content ul li:hover::before,
.content ol li:hover::before {
  color: var(--kleur-h2);
  transform: scale(1.1);
}

.content ul li:hover {
  color: var(--kleur-h2);
  transform: translateX(3px);
}

/* Table of Contents Lists Exception */
.inhoudsopgave-lijst {
  background: none;
  padding: 0 0 0 2rem;
  border: none;
  border-radius: 0;
  margin-left: 1rem;
  box-shadow: none;
  list-style: none;
}

.inhoudsopgave-lijst li {
  margin-bottom: 0.5rem;
  position: relative;
  padding-left: 0;
}

.inhoudsopgave-lijst li::before {
  content: '●';
  color: var(--kleur-accent);
  font-weight: bold;
  position: absolute;
  left: -1.8rem;
  top: 0.1em;
  font-size: 1rem;
  text-shadow: 0 1px 2px rgba(82, 182, 154, 0.3);
  line-height: 1;
}

/* Specific override for table of contents after #inhoudsopgave */
#inhoudsopgave + ul {
  background: none;
  padding: 0 0 0 2rem;
  border: none;
  border-radius: 0;
  margin-left: 1rem;
  box-shadow: none;
  border-left: none;
}

#inhoudsopgave + ul:hover {
  transform: none;
  box-shadow: none;
}

#inhoudsopgave + ul li {
  margin-bottom: 0.5rem;
  padding-left: 0;
}

#inhoudsopgave + ul li::before {
  font-size: 1rem;
}

/* =============================================================================
   6. LAYOUT COMPONENTS
   ============================================================================= */

.container {
  display: block;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(135deg, var(--kleur-achtergrond) 0%, var(--kleur-achtergrond2) 100%);
  border-right: 3px solid var(--kleur-accent3);
  padding: 1.5rem;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.sidebar-header h3 {
  color: var(--kleur-titel);
  margin: 0 0 1rem 0;
  font-size: 1.2rem;
  border-bottom: 2px solid var(--kleur-accent3);
  padding-bottom: 0.5rem;
}

.sidebar-logo {
  max-width: 100%;
  height: auto;
  margin-bottom: 20px;
  display: block;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 2px 4px 12px var(--kleur-accent3);
  border: 2px solid var(--kleur-accent3);
}

/* Sidebar Menu */
.sidebar-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-menu li {
  margin-bottom: 0.5rem;
  position: static;
  padding-left: 0;
}

.sidebar-menu a {
  display: block;
  padding: 0.8rem 1rem;
  color: var(--kleur-h2);
  text-decoration: none;
  border: none;
  border-radius: var(--border-radius-small);
  transition: all var(--transition-base);
  font-size: 0.9rem;
  line-height: 1.3;
}

.sidebar-menu a:hover {
  background: var(--kleur-table);
  color: var(--kleur-titel);
  transform: translateX(5px);
}

.sidebar-menu a:focus {
  outline: 2px solid var(--kleur-accent);
  outline-offset: 2px;
}

.sidebar-menu a:active,
.sidebar-menu a[aria-current="true"] {
  background: linear-gradient(90deg, var(--kleur-accent) 0%, var(--kleur-h5) 100%);
  color: white;
}

/* Content Area */
.content {
  max-width: var(--content-max-width);
  margin: 20px auto;
  padding: 2rem;
  margin-left: calc(var(--sidebar-width) + 50px);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  box-shadow: var(--box-shadow-large);
  position: relative;
}

/* Decorative Elements */
.content::before {
  content: '';
  position: absolute;
  top: -10px;
  right: -10px;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(181, 228, 140, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: float 6s ease-in-out infinite;
}

.content::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: -15px;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(118, 200, 147, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: float 8s ease-in-out infinite reverse;
}

/* =============================================================================
   7. CONTENT COMPONENTS
   ============================================================================= */

/* Blockquotes */
blockquote {
  border-left: 6px solid var(--kleur-accent2);
  background: linear-gradient(135deg, var(--kleur-achtergrond) 0%, var(--kleur-achtergrond2) 100%);
  color: var(--kleur-titel);
  padding: var(--padding-lijst);
  margin: 2rem 0;
  font-style: italic;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  box-shadow: var(--box-shadow);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out;
}

blockquote::before {
  content: '"';
  font-size: 4rem;
  color: var(--kleur-accent2);
  position: absolute;
  top: -10px;
  left: 10px;
  opacity: 0.3;
  font-family: serif;
}

/* Tables */
table {
  border-collapse: collapse;
  width: 100%;
  margin: 2rem 0;
  background: var(--kleur-achtergrond);
  box-shadow: 0 2px 8px rgba(52, 166, 164, 0.08);
}

th,
td {
  border: 1px solid var(--kleur-table-border);
  padding: 0.7rem 1rem;
  text-align: left;
}

th {
  background: var(--kleur-table);
  color: var(--kleur-titel);
}

td {
  color: var(--kleur-h2);
}

/* Buttons */
button,
.button {
  background: linear-gradient(90deg, var(--kleur-accent) 0%, var(--kleur-h5) 100%);
  color: #fff;
  border: none;
  border-radius: var(--border-radius-small);
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  margin: 0.5rem 0;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(22, 138, 173, 0.10);
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

button:hover,
.button:hover {
  background: linear-gradient(90deg, var(--kleur-link) 0%, var(--kleur-h2) 100%);
  box-shadow: 0 4px 16px rgba(22, 138, 173, 0.18);
}

button:focus,
.button:focus {
  outline: 2px solid var(--kleur-accent);
  outline-offset: 2px;
}

/* Code */
code,
pre {
  background: var(--kleur-achtergrond);
  color: var(--kleur-h2);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-family: var(--font-family-mono);
  font-size: 0.98em;
}

/* Horizontal Rule */
hr {
  border: none;
  border-top: 2px solid var(--kleur-table-border);
  margin: 2rem 0;
}

/* =============================================================================
   8. SPECIAL PAGES
   ============================================================================= */

/* Voorblad (Cover Page) */
.voorblad {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--kleur-achtergrond) 0%, var(--kleur-table) 50%, var(--kleur-accent3) 100%);
  text-align: center;
  position: relative;
}

.voorblad-content {
  max-width: 800px;
  padding: 3rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(24, 78, 119, 0.1);
  border: 3px solid var(--kleur-accent3);
}

.voorblad-logo {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  animation: pulse 2s ease-in-out infinite alternate;
}

.voorblad-titel {
  font-size: 3rem;
  color: var(--kleur-titel);
  margin-bottom: 0.5rem;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  border: none;
}

.voorblad-subtitel {
  font-size: 1.5rem;
  color: var(--kleur-h2);
  margin-bottom: 2rem;
  font-weight: normal;
  border: none;
  background: none;
  padding: 0;
}

.voorblad-beschrijving {
  font-size: 1.2rem;
  color: var(--kleur-h3);
  margin-bottom: 3rem;
  line-height: var(--line-height-content);
  font-style: italic;
}

.voorblad-niveaus {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin: 2rem 0;
  padding: 2rem;
  background: rgba(217, 237, 146, 0.3);
  border-radius: var(--border-radius);
  border: 2px solid var(--kleur-accent3);
}

.niveau {
  background: linear-gradient(90deg, var(--kleur-accent) 0%, var(--kleur-h5) 100%);
  color: white;
  padding: 0.8rem 1.2rem;
  border-radius: 25px;
  font-weight: bold;
  font-size: 0.9rem;
  box-shadow: 0 4px 8px rgba(52, 166, 164, 0.2);
  transition: transform var(--transition-fast);
}

.niveau:hover {
  transform: translateY(-2px);
}

.niveau-pijl {
  font-size: 1.5rem;
  color: var(--kleur-accent);
  font-weight: bold;
  margin: 0 0.5rem;
}

.voorblad-auteur {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--kleur-accent3);
}

.voorblad-auteur p {
  font-size: 1.1rem;
  color: var(--kleur-link);
  font-weight: 500;
  margin: 0;
}

/* =============================================================================
   9. UTILITIES
   ============================================================================= */

/* Scroll to Top Button */
.scroll-top-btn,
#scrollTopBtn {
  display: none;
  position: fixed;
  bottom: 80px;
  right: 15px;
  z-index: 99;
  border: none;
  outline: none;
  background-color: var(--kleur-accent);
  color: white;
  cursor: pointer;
  padding: 5px;
  width: 65px;
  height: 65px;
  border-radius: 50%;
  font-size: 30px;
  transition: background-color var(--transition-fast);
}

.scroll-top-btn:hover,
#scrollTopBtn:hover {
  background-color: var(--kleur-h2);
}

.scroll-top-btn:focus,
#scrollTopBtn:focus {
  outline: 2px solid var(--kleur-accent);
  outline-offset: 2px;
}

/* Menu Toggle for Mobile - UPDATED */
.menu-toggle {
  position: fixed !important;
  top: 15px !important;
  left: 15px !important;
  z-index: 1001 !important;
  background: var(--kleur-accent) !important;
  color: white !important;
  border: 3px solid #fff !important;
  border-radius: 15px !important;
  cursor: pointer !important;
  font-size: 2.5rem !important;
  font-weight: bold !important;
  box-shadow: 0 6px 20px rgba(82, 182, 154, 0.4) !important;
  transition: all 0.3s ease !important;
  width: 80px !important;
  height: 80px !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
}

.menu-toggle:hover {
  background: var(--kleur-h2) !important;
  transform: scale(1.05) !important;
  box-shadow: 0 6px 16px rgba(82, 182, 154, 0.4) !important;
}

.menu-toggle:focus {
  outline: 3px solid white !important;
  outline-offset: 3px !important;
}

.menu-toggle:active {
  transform: scale(0.98) !important;
  background: var(--kleur-h2) !important;
}

/* =============================================================================
   10. ANIMATIONS
   ============================================================================= */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.1);
  }
}

/* =============================================================================
   11. SCROLLBAR STYLING
   ============================================================================= */

::-webkit-scrollbar {
  width: 8px;
  background: var(--kleur-achtergrond);
}

::-webkit-scrollbar-thumb {
  background: var(--kleur-accent3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--kleur-accent2);
}

/* =============================================================================
   12. RESPONSIVE DESIGN
   ============================================================================= */

@media (max-width: 1280px) {
  .sidebar {
    width: var(--sidebar-width-medium);
    padding: 1rem;
  }
  
  .content {
    margin-left: calc(var(--sidebar-width-medium) + 20px);
    max-width: var(--content-max-width-medium);
  }
}

@media (max-width: 1024px) {
  .sidebar {
    position: fixed !important;
    left: -250px !important;
    transition: left 0.3s ease !important;
    width: 250px !important;
  }
  
  .sidebar.open {
    left: 0 !important;
  }
  
  .content {
    margin-left: 0;
    max-width: 100%;
    padding-left: 1rem;
    border-radius: var(--border-radius);
  }
  
  body {
    width: 100%;
    margin: 0;
    padding: 0;
  }
  
  .menu-toggle {
    display: flex !important;
  }
}

@media (min-width: 1025px) {
  .menu-toggle {
    display: none;
  }
}

@media (max-width: 768px) {
  .voorblad-content {
    padding: 2rem 1.5rem;
    margin: 1rem;
  }
  
  .voorblad-titel {
    font-size: 2rem;
  }
  
  .voorblad-subtitel {
    font-size: 1.2rem;
  }
  
  .voorblad-niveaus {
    flex-direction: column;
    gap: 1rem;
  }
  
  .niveau-pijl {
    transform: rotate(90deg);
    margin: 0;
  }
  
  .menu-toggle {
    width: 90px !important;
    height: 90px !important;
    font-size: 3rem !important;
    top: 10px !important;
    left: 10px !important;
  }
}

/* =============================================================================
   13. PRINT STYLES
   ============================================================================= */

@media print {
  .sidebar,
  .scroll-top-btn,
  #scrollTopBtn,
  .menu-toggle {
    display: none;
  }
  
  .content {
    margin-left: 0;
    box-shadow: none;
    background: white;
  }
  
  .content::before,
  .content::after {
    display: none;
  }
  
  h1, h2, h3, h4, h5, h6 {
    animation: none;
    break-after: avoid;
  }
  
  p, ul, ol, blockquote {
    animation: none;
  }
}

/* =============================================================================
   END OF STYLESHEET
   ============================================================================= */