
:root {
  /* Dark Mode Palette (Standard) */
  --bg-gradient: linear-gradient(135deg, #070e17 0%, #0c1827 50%, #09131f 100%);
  --panel-bg: rgba(15, 30, 49, 0.55);
  --panel-border: rgba(255, 255, 255, 0.07);
  --text-primary: #f3f5f9;
  --text-secondary: #90a0b5;
  --accent-color: #2e8bfa;
  --accent-hover: #5aa1fd;
  --accent-glow: rgba(46, 139, 250, 0.25);
  --success-color: #4ade80;
  --success-glow: rgba(74, 222, 128, 0.3);
  --error-color: #f87171;
  --error-glow: rgba(248, 113, 113, 0.3);
  --warn-color: #fbbf24;
  --warn-glow: rgba(251, 191, 36, 0.3);
  --input-bg: rgba(7, 14, 23, 0.6);
  --card-bg-hover: rgba(46, 139, 250, 0.15);
  
  --shadow-main: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
  --glass-blur: 14px;
  --header-bg: rgba(18, 18, 18, 0.4);
}

[data-theme="light"] {
  /* Light Mode Palette */
  --bg-gradient: linear-gradient(135deg, #f0f4f8 0%, #e2ebf0 100%);
  --panel-bg: rgba(255, 255, 255, 0.65);
  --panel-border: rgba(0, 0, 0, 0.06);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --accent-color: #0259c4;
  --accent-hover: #024394;
  --accent-glow: rgba(2, 89, 196, 0.15);
  --success-color: #16a34a;
  --success-glow: rgba(22, 163, 74, 0.2);
  --error-color: #dc2626;
  --error-glow: rgba(220, 38, 38, 0.2);
  --warn-color: #d97706;
  --warn-glow: rgba(217, 119, 6, 0.2);
  --input-bg: rgba(255, 255, 255, 0.85);
  --card-bg-hover: rgba(2, 89, 196, 0.08);
  
  --shadow-main: 0 12px 30px 0 rgba(0, 0, 0, 0.1);
  --glass-blur: 12px;
  --header-bg: rgba(255, 255, 255, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

body {
  min-height: 100vh;
  background: var(--bg-gradient);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
  background: var(--panel-border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Glassmorphism Panel Base */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  box-shadow: var(--shadow-main);
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
  height: 75px;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--panel-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.logo-text {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, var(--text-primary) 0%, var(--accent-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.user-dropdown {
  position: absolute;
  top: 50px;
  right: 0;
  min-width: 210px;
  padding: 10px 0;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-main);
  z-index: 1000;
  background: #0f172a; /* Solider Hintergrund im Dark Mode */
}

/* Deckender Hintergrund im Light Mode */
html[data-theme="light"] .user-dropdown,
[data-theme="light"] .user-dropdown {
  background: #ffffff;
}

/* Dropdown Name Header */
.dropdown-user-name {
  padding: 12px 20px;
  border-bottom: 1px solid var(--panel-border);
  font-weight: 600;
  color: var(--accent-color);
  font-size: 0.95rem;
  text-align: left;
  background: #111b30; /* Solider dunkler Hintergrund */
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

/* Light Theme */
html[data-theme="light"] .dropdown-user-name,
[data-theme="light"] .dropdown-user-name {
  background: #f1f5f9;
}

/* Dropdown Divider */
.dropdown-divider {
  border-top: 1px solid var(--panel-border);
  margin: 5px 0;
}

/* User Avatar Circle in Header */
.user-avatar-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--accent-color);
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent-glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.user-avatar-circle:hover {
  transform: scale(1.06);
  box-shadow: 0 0 16px var(--accent-glow);
}



.nav-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary {
  background: var(--accent-color);
  color: #ffffff !important;
  box-shadow: 0 4px 14px 0 var(--accent-glow);
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px 0 var(--accent-glow);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--error-color);
  color: #fff;
  box-shadow: 0 4px 14px 0 var(--error-glow);
}

.btn-danger:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  font-size: 1.1rem;
  transition: all 0.25s ease;
}

.btn-icon:hover {
  background: var(--card-bg-hover);
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: scale(1.05);
}

/* User Info Badge */
.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--panel-border);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
}

.user-badge i {
  color: var(--accent-color);
}

/* Main Container */
main {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 20px;
}

.jumbotron {
  text-align: center;
  margin-bottom: 50px;
  animation: fadeIn 0.8s ease;
}

.jumbotron h1 {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.8px;
}

.jumbotron p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Dashboard Grid */
.tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 25px;
  justify-content: center;
}

/* Kachel Styling */
.tile-card {
  height: 200px;
  padding: 25px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none !important;
  color: inherit !important;
}

.tile-card:hover {
  transform: translateY(-8px);
  background: var(--card-bg-hover);
  border-color: var(--accent-color);
  box-shadow: 0 20px 38px rgba(0, 0, 0, 0.4);
}

.tile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 2;
}

.tile-icon-wrapper {
  font-size: 1.8rem;
  color: var(--accent-color);
  background: rgba(46, 139, 250, 0.1);
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile-card:hover .tile-icon-wrapper {
  color: #fff;
  background: var(--accent-color);
  transform: scale(1.05);
  transition: all 0.3s ease;
}

/* Statusindikator */
.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--text-secondary);
  box-shadow: 0 0 8px var(--text-secondary);
  position: relative;
}

.status-dot.online {
  background-color: var(--success-color);
  box-shadow: 0 0 10px var(--success-color);
}
.status-dot.online::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 50%;
  border: 2px solid var(--success-color);
  animation: pulse 2s infinite;
}

.status-dot.offline {
  background-color: var(--error-color);
  box-shadow: 0 0 10px var(--error-color);
}

.status-dot.timeout {
  background-color: var(--warn-color);
  box-shadow: 0 0 10px var(--warn-color);
}

.tile-body {
  z-index: 2;
  margin-top: 20px;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.tile-bottom-content {
  width: 100%;
}

.tile-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
  text-align: right;
}

.tile-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Hintergrund Dekoration für Kacheln */
.tile-bg-glow {
  position: absolute;
  bottom: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--accent-glow);
  filter: blur(40px);
  opacity: 0.3;
  z-index: 1;
  transition: all 0.4s ease;
}

.tile-card:hover .tile-bg-glow {
  transform: scale(1.3);
  opacity: 0.5;
}

/* Kachel Deaktiviert */
.tile-card.disabled {
  cursor: not-allowed;
  opacity: 0.65;
  background: rgba(0,0,0,0.2) !important;
  border-color: var(--panel-border) !important;
  transform: none !important;
  box-shadow: none !important;
}
.tile-card.disabled .tile-icon-wrapper {
  background: rgba(255,255,255,0.05) !important;
  color: var(--text-secondary) !important;
}
.tile-card.disabled .unavailable-label {
  display: block;
  color: var(--error-color);
  font-weight: 700;
  font-size: 0.8rem;
  margin-top: 8px;
}

.unavailable-label {
  display: none;
}

/* Kachel Zeitlich Gesperrt */
.tile-card.time-locked {
  cursor: not-allowed;
  opacity: 0.7;
  background: rgba(10, 10, 10, 0.4) !important;
  border-color: rgba(255, 255, 255, 0.05) !important;
  transform: none !important;
  box-shadow: none !important;
}
.tile-card.time-locked .tile-icon-wrapper {
  background: rgba(255, 255, 255, 0.02) !important;
  color: var(--text-secondary) !important;
  filter: grayscale(1);
}
.tile-card.time-locked .time-locked-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--warn-color);
  font-weight: 600;
  font-size: 0.8rem;
  margin-top: 8px;
}
.tile-card.time-locked .status-dot {
  background-color: var(--text-secondary) !important;
  box-shadow: none !important;
}

.time-locked-label {
  display: none;
}

/* Modals & Forms */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 40px;
  position: relative;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-content-large {
  max-width: 1000px;
}

.close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: 50%;
  transition: all 0.2s ease;
  z-index: 15;
  line-height: 1;
}
.close-btn:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.08);
  transform: scale(1.05);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--input-bg);
  border: 1px solid var(--panel-border);
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s ease;
}

.form-control:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Setup Wizard Panel */
.setup-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.setup-panel {
  max-width: 600px;
  width: 100%;
  padding: 45px;
}

.setup-header {
  text-align: center;
  margin-bottom: 30px;
}

.setup-logo {
  font-size: 3rem;
  color: var(--accent-color);
  margin-bottom: 15px;
}

.setup-step {
  display: none;
}
.setup-step.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

.step-indicator {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
}

.indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
}

.indicator-dot.active {
  background: var(--accent-color);
  box-shadow: 0 0 8px var(--accent-color);
}

/* Tab Layout (Admin Backend) */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  margin-top: 30px;
}

.admin-sidebar {
  padding: 20px;
  height: fit-content;
}

.admin-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-nav-item {
  padding: 12px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s ease;
}

.admin-nav-item:hover, .admin-nav-item.active {
  color: var(--text-primary);
  background: rgba(255,255,255,0.06);
}

.admin-nav-item.active {
  background: var(--accent-glow);
  color: var(--accent-color);
  border-left: 3px solid var(--accent-color);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.admin-content-panel {
  padding: 35px;
  min-height: 500px;
}

.admin-tab {
  display: none;
}

.admin-tab.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

/* Tables in Admin Panel */
.admin-table-container {
  overflow-x: auto;
  margin-top: 20px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.admin-table th, .admin-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--panel-border);
}

.admin-table th {
  background: rgba(0, 0, 0, 0.15);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.admin-table td {
  font-size: 0.9rem;
}

/* Actions cell */
.actions-cell {
  display: flex;
  gap: 10px;
}

/* Tooltip */
.tooltip-custom {
  position: absolute;
  background: #000;
  color: #fff;
  padding: 5px 10px;
  font-size: 0.75rem;
  border-radius: 4px;
  z-index: 1000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255,255,255,0.1);
  transition: .4s;
  border-radius: 34px;
  border: 1px solid var(--panel-border);
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent-color);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* Alert Boxes */
.alert {
  padding: 14px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeIn 0.4s ease;
}

.alert-success {
  background: var(--success-glow);
  border: 1px solid var(--success-color);
  color: var(--success-color);
}

.alert-danger {
  background: var(--error-glow);
  border: 1px solid var(--error-color);
  color: var(--error-color);
}

.alert-warning {
  background: var(--warn-glow);
  border: 1px solid var(--warn-color);
  color: var(--warn-color);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

/* Responsive */
@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }
  header {
    padding: 0 20px;
  }
}

@media (max-width: 600px) {
  .jumbotron h1 {
    font-size: 1.7rem;
  }
  .setup-panel {
    padding: 25px;
  }
}

/* Icon Picker Styles */
.icon-picker-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  color: var(--text-primary);
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.icon-picker-item:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  transform: scale(1.1);
}
.icon-picker-item.active {
  background: var(--accent-glow);
  border-color: var(--accent-color);
  color: var(--accent-color);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* SPH Autologin Key-Button */
.tile-key-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}
.tile-key-btn:hover {
  background: rgba(245, 158, 11, 0.15); /* amber glow */
  border-color: var(--warn-color);
  color: var(--warn-color);
  transform: scale(1.1);
}
.tile-key-btn i {
  font-size: 0.85rem;
}

/* News Karussell / Banner */
.news-carousel-container {
  margin: 0 auto 30px auto;
  max-width: 1200px;
  width: 100%;
  padding: 20px 25px;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-main);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: slideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-carousel-track {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
}

.news-slide {
  width: 100%;
  max-width: 100%;
  min-width: 100%;
  min-height: 200px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 40px; /* Platz für Pfeiltasten */
  box-sizing: border-box;
  word-break: break-word;
  overflow-wrap: break-word;
}

.news-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-color);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.news-body {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-primary);
  margin: 0;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  flex-grow: 1;
}

.news-body p, .news-body div, .news-body span, .news-body li {
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.news-footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 5px;
}

.news-confirm-btn {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--warn-color);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.news-confirm-btn:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--warn-color);
  transform: scale(1.02);
}

.news-always-show-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  user-select: none;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.2s ease;
}

.news-always-show-label:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.news-always-show-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-color);
  cursor: pointer;
}

.news-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.news-nav-btn:hover {
  background: rgba(46, 139, 250, 0.15);
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: translateY(-50%) scale(1.1);
}

.news-nav-btn.prev {
  left: 0;
}

.news-nav-btn.next {
  right: 0;
}

.news-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 5px;
}

.news-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--panel-border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.news-dot.active {
  background: var(--accent-color);
  width: 14px;
  border-radius: 3px;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* WYSIWYG Nachrichteneditor */
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: none;
  padding: 8px 12px;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.editor-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-radius: 4px;
  width: 32px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.editor-btn:hover {
  background: rgba(46, 139, 250, 0.15);
  border-color: var(--accent-color);
  color: var(--accent-color);
  transform: scale(1.05);
}

#editor-source-btn {
  width: auto;
  padding: 0 10px;
  font-weight: 600;
  display: flex;
  gap: 6px;
}

#editor-source-btn.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--warn-color);
  color: var(--warn-color);
}

.editor-wysiwyg {
  min-height: 180px;
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
  overflow-y: auto;
  outline: none;
  padding: 12px 15px;
  line-height: 1.6;
}

.editor-wysiwyg:empty::before {
  content: attr(placeholder);
  color: var(--text-secondary);
  opacity: 0.7;
  cursor: text;
}

/* Frontend & Editor Code-Formatierung */
.news-body pre, .editor-wysiwyg pre {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  margin: 10px 0;
  font-family: 'Fira Code', 'Courier New', Courier, monospace;
}

.news-body code, .editor-wysiwyg code {
  font-family: 'Fira Code', 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  color: #f43f5e; /* Rose accent inline code */
  background: rgba(244, 63, 94, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

.news-body pre code, .editor-wysiwyg pre code {
  color: #e2e8f0;
  font-size: 0.85rem;
  background: none;
  padding: 0;
  border-radius: 0;
  display: block;
}

/* Header Megafon & Dropdown */
.news-bell-wrapper {
  display: inline-block;
}

.news-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #f43f5e; /* Premium Rose accent red */
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 6px rgba(244, 63, 94, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.news-dropdown {
  position: fixed;
  top: 75px;
  right: 12px;
  width: min(320px, calc(100vw - 24px));
  border-radius: 12px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-main);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 2000;
  display: none;
  animation: slideDown 0.2s ease;
}

.news-dropdown-header {
  padding: 12px 15px;
  border-bottom: 1px solid var(--panel-border);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.news-dropdown-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 320px;
  overflow-y: auto;
}

.news-dropdown-item {
  padding: 12px 15px;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
  border-bottom: 1px solid var(--panel-border);
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.news-dropdown-item:last-child {
  border-bottom: none;
}

.news-dropdown-item:hover {
  background: var(--card-bg-hover);
}

.news-dropdown-item.confirmed {
  opacity: 0.5;
}

.news-dropdown-item .news-title-text {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-grow: 1;
}

.news-dropdown-item .dot-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f43f5e;
  flex-shrink: 0;
  box-shadow: 0 0 4px #f43f5e;
}

/* Schülerportal & Login-Tabs CSS */
.login-tab-btn {
  flex: 1;
  padding: 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  outline: none;
}

.login-tab-btn:hover {
  color: var(--text-primary) !important;
}

.login-tab-btn.active {
  color: var(--text-primary) !important;
  border-bottom-color: var(--accent-color) !important;
  font-weight: 600 !important;
}

.student-grid {
  animation: fadeIn 0.4s ease;
}

.student-table td {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.student-table tr:last-child td {
  border-bottom: none;
}

@media (max-width: 900px) {
  .student-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Footer Styles */
.site-footer {
  margin-top: auto;
  padding: 20px 30px;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--panel-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
  z-index: 50;
  flex-shrink: 0;
}

.site-footer a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color 0.2s ease;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.site-footer a:hover {
  color: var(--accent-hover, #2e8bfa);
  text-decoration: underline;
}

@media (max-width: 600px) {
  .site-footer {
    flex-direction: column;
    gap: 10px;
    text-align: center;
    padding: 15px;
  }
}

@media (max-width: 550px) {
  .tiles-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .tile-card {
    height: auto !important;
    min-height: 140px !important;
    padding: 15px !important;
  }
  .tile-icon-wrapper {
    width: 38px !important;
    height: 38px !important;
    font-size: 1.3rem !important;
  }
  .tile-title {
    font-size: 0.95rem !important;
  }
  .tile-description {
    font-size: 0.75rem !important;
  }

  /* News Carousel Mobile */
  .news-carousel-container {
    padding: 14px 12px !important;
    border-radius: 10px !important;
  }
  .news-slide {
    padding: 0 28px !important;
    min-height: 140px !important;
  }
  .news-title {
    font-size: 1rem !important;
  }
  .news-body {
    font-size: 0.85rem !important;
  }
  .news-nav-btn {
    width: 26px !important;
    height: 26px !important;
    font-size: 0.75rem !important;
  }
  .news-always-show-label {
    font-size: 0.78rem !important;
    padding: 6px 10px !important;
  }
}


