/* ===================
   Startpagina Styles
   =================== */

/* CSS Variables - Vrij CLB Huisstijl */
:root {
  --color-blue: #1d70b7;
  --color-green: #008d36;
  --color-blue-dark: #165a91;
  --color-green-dark: #006b29;
  --color-bg: #f8fafc;
  --color-bg-alt: #ffffff;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --color-shadow: rgba(29, 112, 183, 0.1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius: 12px;
  --radius-sm: 8px;
  --font-main:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, sans-serif;
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Page Wrapper */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

.page-wrapper::before {
  content: "";
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  top: 0;
  background-image: url("/assets/images/background.png");
  background-size: contain;
  background-position: center bottom;
  background-repeat: no-repeat;
  opacity: 0.2;
  pointer-events: none;
  z-index: 0;
}

/* ============================================
   Header
   ============================================ */
.header {
  background: linear-gradient(
    135deg,
    var(--color-blue) 0%,
    var(--color-green) 100%
  );
  padding: 0.5rem 1rem;
  box-shadow: var(--shadow-md);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: padding 0.3s ease;
}

.header.scrolled {
  padding: 0.25rem 1rem;
}

.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  transition: gap 0.3s ease;
}

.header.scrolled .header-content {
  gap: 1rem;
}

.header-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.5rem 1rem;
  backdrop-filter: blur(10px);
  transition: padding 0.3s ease;
}

.header.scrolled .header-search {
  padding: 0.35rem 0.75rem;
}

.header-search .search-icon {
  color: rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
}

.header-search .search-input {
  background: transparent;
  border: none;
  color: white;
  font-size: 0.95rem;
  width: 200px;
  padding: 0;
  transition:
    font-size 0.3s ease,
    width 0.3s ease;
}

.header.scrolled .header-search .search-input {
  font-size: 0.85rem;
  width: 160px;
}

.header-search .search-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.header-search .search-input:focus {
  outline: none;
}

.header-search .search-input:focus::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.header-abc-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-blue);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  margin-left: auto;
}

.header-abc-btn:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.header-abc-btn:active {
  transform: translateY(0);
}

.header-abc-btn svg {
  flex-shrink: 0;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
}

.header-home-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-blue);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.header-home-btn:hover {
  background: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.header-home-btn:active {
  transform: translateY(0);
}

.header-home-btn svg {
  flex-shrink: 0;
}

.logo img {
  height: 100px;
  width: auto;
  object-fit: contain;
  transition: height 0.3s ease;
}

.header.scrolled .logo img {
  height: 50px;
}

.header-title h1 {
  color: white;
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  transition:
    font-size 0.3s ease,
    margin-bottom 0.3s ease;
}

.header.scrolled .header-title h1 {
  font-size: 1.25rem;
  margin-bottom: 0.1rem;
}

.header-title .subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  font-weight: 500;
  transition:
    font-size 0.3s ease,
    opacity 0.3s ease;
}

.header.scrolled .header-title .subtitle {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* ============================================
   Header Google Search
   ============================================ */
.header-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2rem;
  transition: gap 0.3s ease;
  position: relative;
}

.header.scrolled .header-content {
  gap: 1rem;
}

.header-google-search {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.header-search-wrapper {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50px;
  padding: 0.75rem 1.5rem;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  border: 2px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  max-width: 500px;
}

.header-search-wrapper:focus-within {
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

.header-search-icon {
  color: rgba(255, 255, 255, 0.8);
  flex-shrink: 0;
  margin-right: 0.75rem;
}

.header-search-input {
  background: transparent;
  border: none;
  color: white;
  font-size: 1.1rem;
  width: 100%;
  padding: 0;
  font-family: var(--font-main);
}

.header-search-input::placeholder {
  color: rgba(255, 255, 255, 0.8);
}

.header-search-input:focus {
  outline: none;
}

@media (max-width: 640px) {
  .header-content {
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
  }

  .logo {
    order: 1;
  }

  .header-google-search {
    order: 2;
    width: 100%;
    position: relative;
    left: auto;
    transform: none;
  }

  .header-search-wrapper {
    width: 100%;
    max-width: 100%;
  }

  .header-search-input {
    width: 100%;
    font-size: 1rem;
  }

  .header-abc-btn {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .logo img {
    height: 50px;
  }

  .header.scrolled .logo img {
    height: 30px;
  }

  .header-title h1 {
    font-size: 1.5rem;
  }

  .header.scrolled .header-title h1 {
    font-size: 1.1rem;
  }
}

/* Prevent overlap on medium screens */
@media (min-width: 641px) and (max-width: 1100px) {
  .header-google-search {
    margin-left: 100px;
  }

  .header-google-search {
    margin-left: calc(var(--logo-width, 100px) + 2rem);
  }
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 8rem 1rem 2rem;
  position: relative;
  z-index: 1;
}

.main-content.abc-page {
  padding-top: 8rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--color-text-muted);
}

.empty-state h2 {
  color: var(--color-text);
  font-size: 1.5rem;
  margin: 1rem 0 0.5rem;
}

.empty-state p {
  font-size: 1rem;
}

/* ============================================
   Category Section
   ============================================ */
.category-section {
  margin-bottom: 3rem;
  animation: fadeIn 0.3s ease;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid transparent;
  background: linear-gradient(
      90deg,
      var(--color-blue) 0%,
      var(--color-green) 50%,
      var(--color-blue) 100%
    )
    bottom/100% 2px no-repeat;
}

.category-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text);
}

.category-count {
  background: linear-gradient(135deg, var(--color-blue), var(--color-green));
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
}

/* Links Grid */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

@media (min-width: 768px) {
  .links-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
  }
}

@media (min-width: 1200px) {
  .links-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============================================
   Link Card
   ============================================ */
.link-card {
  display: block;
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.link-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-blue);
}

.link-card-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
}

.link-card-image {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-bg);
}

.link-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.link-card-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    rgba(29, 112, 183, 0.1),
    rgba(0, 141, 54, 0.1)
  );
  border-radius: var(--radius-sm);
}

.link-card-content {
  flex: 1;
  min-width: 0;
}

.link-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-card-url {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-card-arrow {
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: color 0.2s ease;
}

.link-card:hover .link-card-arrow {
  color: var(--color-blue);
}

/* Hidden state for search */
.link-card.hidden {
  display: none;
}

.category-section.hidden {
  display: none;
}

/* ============================================
   Context Menu
   ============================================ */
.link-context-menu {
  position: fixed;
  z-index: 1000;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 380px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;
}

.link-context-menu.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.context-menu-content {
  color: var(--color-text);
  font-size: 0.9rem;
  line-height: 1.5;
}

.context-menu-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(
    135deg,
    rgba(29, 112, 183, 0.05),
    rgba(0, 141, 54, 0.05)
  );
}

.context-menu-image {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-bg);
}

.context-menu-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.context-menu-info {
  flex: 1;
  min-width: 0;
}

.context-menu-title {
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.context-menu-url {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.context-menu-body {
  padding: 1rem;
}

.context-menu-description {
  color: var(--color-text);
  line-height: 1.6;
}

.context-menu-description p {
  margin-bottom: 0.75rem;
}

.context-menu-description p:last-child {
  margin-bottom: 0;
}

.context-menu-description strong {
  font-weight: 600;
}

.context-menu-description em {
  font-style: italic;
}

.context-menu-description ul,
.context-menu-description ol {
  margin: 0.5rem 0;
  padding-left: 1.5rem;
}

.context-menu-description li {
  margin-bottom: 0.25rem;
}

.context-menu-description a {
  color: var(--color-blue);
  text-decoration: underline;
}

.context-menu-description code {
  background: var(--color-bg);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-size: 0.85em;
}

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 640px) {
  .header-content {
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
  }

  .header-title h1 {
    font-size: 1.25rem;
  }

  .logo img {
    height: 100px;
  }

  .header-search {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .header-search .search-input {
    width: 100%;
  }

  .category-title {
    font-size: 1.25rem;
  }

  .links-grid {
    grid-template-columns: 1fr;
  }

  .link-card-inner {
    padding: 0.875rem;
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .header-search {
    display: none;
  }

  .link-card {
    break-inside: avoid;
    border: 1px solid #ccc;
  }

  .header {
    background: none;
    color: black;
  }

  .logo img {
    filter: none;
  }

  .header-title h1,
  .header-title .subtitle {
    color: black;
  }
}
