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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f7fa url('img/background.png') no-repeat fixed center;
  background-size: cover;
  color: #1a1a2e;
  line-height: 1.5
}

.container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 20px
}

h1 {
  font-size: 1.5rem;
  margin-bottom: 4px;
  color: #16213e
}

.subtitle {
  color: #666;
  font-size: .9rem;
  margin-bottom: 20px
}

.pdf-dropdown {
  position: fixed;
  right: 20px;
  top: 20px;
  z-index: 1000
}

.pdf-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #388e3c;
  color: #fff;
  border: none;
  border-radius: 50px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(56, 142, 60, .3);
  transition: all .15s
}

.pdf-toggle-btn:hover {
  background: #2e7d32;
  transform: translateY(-2px)
}

.pdf-toggle-btn .dropdown-arrow {
  font-size: .7rem
}

.pdf-dropdown-menu {
  display: none;
  position: absolute;
  top: 45px;
  right: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
  overflow: hidden;
  min-width: 180px
}

.pdf-dropdown-menu.show {
  display: block
}

.pdf-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: #333;
  text-decoration: none;
  font-size: .85rem;
  transition: background .15s
}

.pdf-item:hover {
  background: #e8f5e9
}

.pdf-item .pdf-icon-small {
  font-size: 1rem
}

.pdf-item .pdf-item-name {
  flex: 1
}

.info-box {
  background: #fff;
  border-radius: 10px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
  overflow: hidden
}

.info-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
  font-size: .85rem;
  font-weight: 600;
  color: #555;
  transition: background .15s
}

.info-header:hover {
  background: #f5f5f5
}

.info-header .arrow {
  font-size: .75rem;
  color: #999;
  transition: transform .2s;
  width: 12px
}

.info-header.open .arrow {
  transform: rotate(90deg)
}

.info-content {
  display: none;
  padding: 0 16px 14px;
  font-size: .82rem;
  color: #555;
  line-height: 1.6
}

.info-content.open {
  display: block
}

.info-content p {
  margin-bottom: 10px
}

.level-explanations {
  margin: 6px 0 0;
  padding: 0
}

.level-explanations dt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #333;
  margin-top: 6px;
  font-size: .85rem
}

.level-explanations dd {
  margin: 2px 0 4px 4px;
  padding-left: 4px;
  color: #777;
  font-size: .8rem
}

.lvl-badge {
  font-size: .7rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  text-align: center;
  min-width: 5ch
}

.lvl-hkb {
  background: #e8f5e9;
  color: #2e7d32
}

.lvl-hk {
  background: #e8eaf6;
  color: #283593
}

.lvl-lk {
  background: #e3f2fd;
  color: #1565c0
}

.lvl-lz {
  background: #e0f7fa;
  color: #00838f
}

.controls {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
  display: flex;
  flex-direction: column;
  gap: 12px
}

.search-row {
  display: flex;
  gap: 10px;
  align-items: center
}

.search-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  outline: 0;
  transition: border-color .2s
}

.search-row input:focus {
  border-color: #388e3c
}

.search-row .count {
  white-space: nowrap;
  font-size: .85rem;
  color: #888
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px
}

.filter-group label {
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #888
}

.filter-group .options {
  display: flex;
  flex-wrap: wrap;
  gap: 4px
}

.filter-group .options button {
  padding: 4px 10px;
  font-size: .8rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: all .15s;
  color: #666
}

.filter-group .options button:hover {
  border-color: #388e3c;
  color: #388e3c
}

.filter-group .options button.active {
  background: #388e3c;
  color: #fff;
  border-color: #388e3c
}

.clear-btn {
  padding: 4px 10px;
  font-size: .8rem;
  border: 1px solid #e74c3c;
  color: #e74c3c;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: all .15s
}

.clear-btn:hover {
  background: #e74c3c;
  color: #fff
}

.subject-header {
  cursor: pointer;
  padding: 12px 16px;
  background: #fff;
  border-radius: 10px;
  margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background .15s
}

.subject-header:hover {
  background: #f1f8e9
}

.subject-header .arrow {
  font-size: .8rem;
  color: #999;
  transition: transform .2s;
  width: 16px
}

.subject-header.open .arrow {
  transform: rotate(90deg)
}

.subject-header .code {
  font-weight: 700;
  color: #388e3c;
  font-size: .85rem;
  background: #e8f5e9;
  padding: 2px 8px;
  border-radius: 4px
}

.subject-header .name {
  font-weight: 600;
  color: #16213e
}

.subject-content {
  display: none;
  padding-left: 8px;
  border-left: 3px solid #dcedc8;
  margin-left: 8px;
  margin-bottom: 16px
}

.subject-content.open {
  display: block
}

.competence-header {
  cursor: pointer;
  padding: 10px 14px;
  background: #fff;
  border-radius: 8px;
  margin-bottom: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background .15s
}

.competence-header:hover {
  background: #f1f8e9
}

.competence-header .arrow {
  font-size: .75rem;
  color: #bbb;
  transition: transform .2s;
  width: 14px
}

.competence-header.open .arrow {
  transform: rotate(90deg)
}

.competence-header .code {
  font-weight: 600;
  color: #283593;
  font-size: .8rem;
  background: #e8eaf6;
  padding: 2px 8px;
  border-radius: 4px
}

.competence-header .name {
  font-size: .9rem;
  color: #333
}

.competence-content {
  display: none;
  padding-left: 8px
}

.competence-content.open {
  display: block
}

.competence-desc {
  font-size: .8rem;
  line-height: 1.5;
  color: #555;
  margin: 6px 0 10px 6px;
  padding: 8px 12px;
  background: #fafafa;
  border-radius: 6px;
  border-left: 3px solid #c8e6c9
}

.lk-header {
  cursor: pointer;
  padding: 8px 12px;
  background: #fff;
  border-radius: 6px;
  margin-bottom: 4px;
  margin-left: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background .15s
}

.lk-header:hover {
  background: #f1f8e9
}

.lk-header .arrow {
  font-size: .7rem;
  color: #ccc;
  transition: transform .2s;
  width: 12px
}

.lk-header.open .arrow {
  transform: rotate(90deg)
}

.lk-code {
  font-weight: 600;
  color: #1565c0;
  font-size: .75rem;
  background: #e3f2fd;
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap
}

.semester-range {
  flex-shrink: 0;
  font-size: .65rem;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
  background: #fff8e1;
  color: #e65100;
  white-space: nowrap;
  margin-left: auto
}

.lk-desc {
  font-size: .8rem;
  color: #555;
  flex: 1
}

.lk-content {
  display: none;
  padding-left: 16px;
  margin-bottom: 6px
}

.lk-content.open {
  display: block
}

.lernziel-row {
  background: #fff;
  border-radius: 4px;
  margin-bottom: 2px;
  margin-left: 8px;
  padding: 4px 10px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .03);
  border-left: 3px solid #e3f2fd;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .8rem
}

.lz-id {
  font-weight: 700;
  color: #00838f;
  font-size: .72rem;
  background: #e0f7fa;
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
  width: 12ch;
  flex-shrink: 0;
  text-align: center
}

.lz-desc {
  flex: 1;
  color: #444
}

.hk-pw-badge {
  font-size: .65rem;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
  margin-left: auto
}

.hk-pw-badge.mandatory {
  background: #e8f5e9;
  color: #2e7d32
}

.hk-pw-badge.optional {
  background: #fff3e0;
  color: #e65100
}

.taxonomie-badge {
  flex-shrink: 0;
  font-size: .65rem;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
  background: #f3e5f5;
  color: #7b1fa2;
  min-width: 24px;
  text-align: center
}

.semester-badge {
  flex-shrink: 0;
  font-size: .65rem;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
  background: #fff8e1;
  color: #e65100;
  white-space: nowrap
}

.lernort-badge {
  flex-shrink: 0;
  font-size: .65rem;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 600;
  min-width: 28px;
  text-align: center
}

.lernort-BE {
  background: #e8f5e9;
  color: #1b5e20
}

.lernort-BFS {
  background: #f3e5f5;
  color: #7b1fa2
}

.lernort-ük {
  background: #e0f2f1;
  color: #00695c
}

.no-results {
  text-align: center;
  padding: 60px 20px;
  color: #999
}

.no-results strong {
  color: #666
}

.highlight {
  background: #fff176;
  font-weight: 600
}

.toggle-all-btn {
  padding: 4px 10px;
  font-size: .8rem;
  border: 1px solid #388e3c;
  color: #388e3c;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: all .15s
}

.toggle-all-btn:hover {
  background: #388e3c;
  color: #fff
}

.highlighted {
  animation: highlight-pulse 2s ease-out;
  background: #e8f5e9;
  border-radius: 6px;
  border-left: 3px solid #388e3c;
}

@keyframes highlight-pulse {
  0% { box-shadow: 0 0 0 4px rgba(56, 142, 60, 0.5); }
  100% { box-shadow: 0 0 0 0 rgba(56, 142, 60, 0); }
}
