/* ===== CSS VARIABLES ===== */
:root {
  /* Primære farver */
  --color-primary:        #1B4F9B;
  --color-primary-light:  #5BB8F5;
  --color-primary-pale:   #D6EEFF;

  /* Neutrale */
  --color-white:          #FFFFFF;
  --color-bg:             #F5FAFF;
  --color-surface:        #FFFFFF;
  --color-border:         #C8E0F7;
  --color-text:           #1A2A3A;
  --color-text-muted:     #5A7A9A;

  /* Accenter */
  --color-gold:           #8ECFD0;
  --color-success:        #2ECC71;
  --color-error:          #E74C3C;
  --color-warning:        #F39C12;

  /* Gradienter */
  --gradient-hero:        linear-gradient(135deg, #1B4F9B 0%, #5BB8F5 100%);
  --gradient-card:        linear-gradient(180deg, #FFFFFF 0%, #F5FAFF 100%);
  --gradient-gold:        linear-gradient(135deg, #8ECFD0 0%, #6BBCBD 100%);

  /* Typografi */
  --font-primary:   'Arial', 'Helvetica Neue', Helvetica, sans-serif;
  --font-mono:      'Courier New', monospace;

  --text-xs:    0.75rem;
  --text-sm:    0.875rem;
  --text-base:  1rem;
  --text-lg:    1.125rem;
  --text-xl:    1.25rem;
  --text-2xl:   1.5rem;
  --text-3xl:   1.875rem;
  --text-4xl:   2.25rem;
  --text-5xl:   3rem;
  --text-hero:  4.5rem;

  --weight-normal:  400;
  --weight-medium:  500;
  --weight-bold:    700;
  --weight-black:   900;

  --leading-tight:  1.2;
  --leading-normal: 1.5;
  --leading-loose:  1.8;

  /* Spacing */
  --space-1:   0.25rem;
  --space-2:   0.5rem;
  --space-3:   0.75rem;
  --space-4:   1rem;
  --space-5:   1.25rem;
  --space-6:   1.5rem;
  --space-8:   2rem;
  --space-12:  3rem;
  --space-16:  4rem;
  --space-24:  6rem;

  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   16px;
  --radius-xl:   24px;
  --radius-full: 9999px;

  --shadow-sm:  0 1px 3px rgba(27,79,155,0.08);
  --shadow-md:  0 4px 16px rgba(27,79,155,0.12);
  --shadow-lg:  0 8px 32px rgba(27,79,155,0.18);
  --shadow-xl:  0 16px 48px rgba(27,79,155,0.22);

  --transition: 0.2s ease;
  --transition-slow: 0.4s ease;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--color-primary-light);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-primary);
}

ul, ol {
  list-style: none;
}

input, textarea, select, button {
  font-family: inherit;
  font-size: inherit;
}

/* ===== UTILITY CLASSES ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container--narrow {
  max-width: 800px;
}

.container--wide {
  max-width: 1400px;
}

.section {
  padding: var(--space-16) 0;
}

.section--sm {
  padding: var(--space-8) 0;
}

.section--lg {
  padding: var(--space-24) 0;
}

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  color: var(--color-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

.section-title {
  font-size: var(--text-3xl);
  font-weight: var(--weight-black);
  color: var(--color-primary);
  text-align: center;
  margin-bottom: var(--space-4);
}

.section-subtitle {
  font-size: var(--text-lg);
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: var(--space-12);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== GRID ===== */
.grid {
  display: grid;
  gap: var(--space-6);
}

.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid--4,
  .grid--3,
  .grid--2 { grid-template-columns: 1fr; }
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
  .container { padding: 0 var(--space-4); }
  .section { padding: var(--space-12) 0; }
}

/* ===== LOADING SPINNER ===== */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--color-primary-pale);
  border-top-color: var(--color-primary-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: var(--space-8) auto;
}

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

/* ===== TOAST NOTIFICATIONS ===== */
#toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: calc(100vw - var(--space-8));
}

.toast {
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-md);
  color: white;
  font-weight: var(--weight-medium);
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
  max-width: 360px;
  word-break: break-word;
}

@media (max-width: 480px) {
  #toast-container {
    left: var(--space-4);
    right: var(--space-4);
    bottom: var(--space-4);
  }
  .toast { max-width: 100%; }
}

.toast--success { background: var(--color-success); }
.toast--error   { background: var(--color-error); }
.toast--info    { background: var(--color-primary-light); }

@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ===== MODAL ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  max-width: 560px;
  width: 100%;
  position: relative;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.25s ease;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes modalIn {
  from { transform: scale(0.95) translateY(10px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.modal__close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: none;
  border: none;
  font-size: var(--text-2xl);
  cursor: pointer;
  color: var(--color-text-muted);
  line-height: 1;
  padding: var(--space-3);
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: color var(--transition), background var(--transition);
}

.modal__close:hover {
  color: var(--color-primary);
}

.modal__title {
  font-size: var(--text-2xl);
  margin-bottom: var(--space-6);
  color: var(--color-primary);
}

/* ===== BADGE ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge--blue  { background: var(--color-primary-pale); color: var(--color-primary); }
.badge--gold  { background: var(--gradient-gold); color: #1A5A5C; }
.badge--green { background: #D4EDDA; color: #155724; }

/* ===== DIVIDER ===== */
.divider {
  border: none;
  height: 2px;
  background: var(--gradient-hero);
  opacity: 0.15;
  margin: var(--space-8) 0;
}

/* ===== RESPONSIVE IMAGES ===== */
.img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== SCROLL TO TOP ===== */
#scroll-top {
  position: fixed;
  bottom: var(--space-8);
  right: var(--space-6);
  width: 44px;
  height: 44px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  font-size: var(--text-xl);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--transition), background var(--transition);
  z-index: 100;
  box-shadow: var(--shadow-md);
}

#scroll-top.visible { opacity: 1; }
#scroll-top:hover   { background: var(--color-primary-light); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: var(--space-16);
  color: var(--color-text-muted);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
}

.empty-state__title {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
