/* ==========================================================================
   TidligSprogstart.dk - Modern Pedagogical Design System
   Udviklet af Lærevejen ApS • Copydan Tekst & Node
   ========================================================================== */

:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --color-primary: #059669;
  --color-primary-dark: #047857;
  --color-primary-light: #d1fae5;
  --color-accent-de: #e11d48;
  --color-accent-en: #2563eb;
  --color-accent-fr: #7c3aed;
  --color-accent-da: #dc2626;
  --color-accent-bkl: #ea580c;
  --color-slate-900: #0f172a;
  --color-slate-800: #1e293b;
  --color-slate-700: #334155;
  --color-slate-600: #475569;
  --color-slate-500: #64748b;
  --color-slate-300: #cbd5e1;
  --color-slate-200: #e2e8f0;
  --color-slate-100: #f1f5f9;
  --color-slate-50: #f8fafc;
}

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

body {
  font-family: var(--font-sans);
  color: var(--color-slate-800);
  background-color: #f8fafc;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Typography & Links */
a {
  color: inherit;
  text-decoration: none;
}

/* Form Controls & Dropdown Selects (High Contrast & Clear Affordance) */
.form-select,
select.form-select,
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: #ffffff;
  border: 2px solid var(--color-slate-300);
  border-radius: 0.875rem;
  padding: 0.625rem 2.5rem 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-slate-900);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23059669' stroke-width='2.5'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.25rem 1.25rem;
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-block;
  width: 100%;
}

.form-select:hover,
select.form-select:hover,
select:hover {
  border-color: var(--color-primary);
  background-color: #f0fdf4;
  box-shadow: 0 2px 6px 0 rgba(5, 150, 105, 0.12);
}

.form-select:focus,
select.form-select:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  background-color: #ffffff;
  box-shadow: 0 0 0 3.5px rgba(5, 150, 105, 0.2);
}

.form-input,
input.form-input,
.form-textarea,
textarea.form-textarea {
  background-color: #ffffff;
  border: 2px solid var(--color-slate-300);
  border-radius: 0.875rem;
  padding: 0.625rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-slate-900);
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}

.form-input:focus,
input.form-input:focus,
.form-textarea:focus,
textarea.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3.5px rgba(5, 150, 105, 0.2);
}

/* Control Panel Labels */
.control-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-slate-700);
  margin-bottom: 0.375rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  border-radius: 1rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 1px solid transparent;
  user-select: none;
  text-decoration: none !important;
}

.btn-primary {
  background-color: var(--color-primary) !important;
  color: #ffffff !important;
  border-color: var(--color-primary-dark) !important;
  box-shadow: 0 4px 12px -2px rgba(5, 150, 105, 0.3) !important;
}
.btn-primary:hover {
  background-color: var(--color-primary-dark) !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -2px rgba(5, 150, 105, 0.4) !important;
}

.btn-secondary {
  background-color: #ffffff !important;
  color: var(--color-slate-700) !important;
  border: 1.5px solid var(--color-slate-200) !important;
  box-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04) !important;
}
.btn-secondary:hover {
  background-color: var(--color-slate-50) !important;
  border-color: var(--color-slate-300) !important;
  color: var(--color-slate-900) !important;
}

/* Tag Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  transition: all 0.2s ease;
  text-decoration: none !important;
}

.badge-de {
  background-color: #fff1f2 !important;
  color: #be123c !important;
  border: 1.5px solid #fecdd3 !important;
}
.badge-en {
  background-color: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1.5px solid #bfdbfe !important;
}
.badge-fr {
  background-color: #faf5ff !important;
  color: #7e22ce !important;
  border: 1.5px solid #e9d5ff !important;
}
.badge-da {
  background-color: #fef2f2 !important;
  color: #b91c1c !important;
  border: 1.5px solid #fecaca !important;
}
.badge-bkl {
  background-color: #fff7ed !important;
  color: #c2410c !important;
  border: 1.5px solid #fed7aa !important;
}
.badge-dsa {
  background-color: #ecfdf5 !important;
  color: #047857 !important;
  border: 1.5px solid #a7f3d0 !important;
}
.badge-modersmaal {
  background-color: #f0fdf4 !important;
  color: #15803d !important;
  border: 1.5px solid #bbf7d0 !important;
}

/* Filter pills active styling */
.filter-lang-btn.active {
  background-color: #0f172a !important;
  color: #ffffff !important;
  border-color: #0f172a !important;
  box-shadow: 0 4px 10px -2px rgba(15, 23, 42, 0.35) !important;
  transform: scale(1.03);
}

/* Hidden Utility for specific elements */
.search-modal-backdrop.hidden,
#search-modal.hidden,
#cookie-banner.hidden,
#btn-floating-cookie.hidden,
#mobile-nav-dropdown.hidden {
  display: none !important;
}

/* Mobile Navigation Dropdown Menu (Top-right drawer) */
#mobile-nav-dropdown {
  max-height: 85vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: all 0.2s ease-in-out;
}

/* Cards */
.card-hover {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-hover:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px -12px rgba(15, 23, 42, 0.1);
}

/* Search Modal Overlay (Modern Command Palette) */
.search-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 3rem 1rem 1.5rem;
  overflow-y: auto;
}
.search-modal-backdrop.hidden {
  display: none !important;
}

.search-modal-box {
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.05);
}

/* Search item active / keyboard selected state */
.search-item-link {
  transition: all 0.15s ease;
  position: relative;
}

.search-item-link:hover,
.search-item-link.selected {
  background-color: #ecfdf5 !important;
  border-color: #6ee7b7 !important;
  box-shadow: 0 2px 8px -1px rgba(5, 150, 105, 0.15);
  outline: none;
}

.search-item-link.selected .search-item-title {
  color: #047857 !important;
}

.search-item-link.selected .search-item-badge {
  background-color: #d1fae5 !important;
  border-color: #a7f3d0 !important;
}

.search-item-link .search-item-enter-hint {
  opacity: 0;
  transform: translateX(4px);
  transition: all 0.15s ease;
}

.search-item-link:hover .search-item-enter-hint,
.search-item-link.selected .search-item-enter-hint {
  opacity: 1;
  transform: translateX(0);
}

/* Search highlights */
mark.search-hl {
  background-color: #fef08a;
  color: #854d0e;
  font-weight: 700;
  padding: 0 2px;
  border-radius: 3px;
}

/* Audio active playing pulse */
.audio-playing {
  animation: audioPulse 1.4s ease-in-out infinite;
}

@keyframes audioPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.02); }
}

/* Print helper classes in screen view */
.print-only {
  display: none !important;
}

.print-page {
  break-inside: avoid;
}

/* Print Sheet Header in Screen View */
.print-sheet-header {
  border-bottom: 2px solid var(--color-slate-900);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.print-logo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.print-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.print-logo-icon-wrap {
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.print-logo-svg {
  width: 36px !important;
  height: 36px !important;
  max-width: 36px !important;
  max-height: 36px !important;
  display: block !important;
  flex-shrink: 0 !important;
}

.print-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.print-brand-title {
  font-size: 1.125rem;
  font-weight: 900;
  color: var(--color-slate-900);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.print-dot-dk {
  font-size: 0.6875rem;
  font-weight: 800;
  color: #e11d48;
  background-color: #ffe4e6;
  border: 1px solid #fecdd3;
  padding: 0.0625rem 0.375rem;
  border-radius: 9999px;
  line-height: 1;
}

.print-brand-subline {
  font-size: 0.6875rem;
  color: var(--color-slate-500);
  font-weight: 600;
  margin-top: 0.125rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.print-meta-badges {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.print-lang-badge {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  background-color: var(--color-primary-light);
  padding: 0.1875rem 0.625rem;
  border: 1.5px solid #a7f3d0;
  border-radius: 9999px;
}

.print-publisher-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--color-slate-600);
  padding: 0.1875rem 0.5rem;
  border: 1px solid var(--color-slate-300);
  border-radius: 0.375rem;
  background-color: var(--color-slate-50);
}

.print-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-top: 0.375rem;
}

.print-title-group {
  flex: 1;
  min-width: 0;
}

.print-sheet-title {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--color-slate-900);
  line-height: 1.2;
}

.print-sheet-subtitle {
  font-size: 0.75rem;
  color: var(--color-slate-600);
  margin-top: 0.125rem;
}

.print-student-info {
  display: flex;
  gap: 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  align-items: flex-end;
}

.print-line-item {
  display: flex;
  align-items: flex-end;
  gap: 0.25rem;
}

.print-label {
  color: var(--color-slate-700);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.print-underline {
  width: 6.5rem;
  border-bottom: 1.5px solid var(--color-slate-900);
  height: 0.875rem;
}

.print-underline-short {
  width: 3rem;
  border-bottom: 1.5px solid var(--color-slate-900);
  height: 0.875rem;
}

/* Print Sheet Footer in Screen View */
.print-sheet-footer {
  border-top: 1.5px solid var(--color-slate-300);
  margin-top: 1rem;
  padding-top: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.6875rem;
  color: var(--color-slate-500);
  line-height: 1.2;
}

.print-footer-left,
.print-footer-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

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

.animate-fade-in {
  animation: fadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
