/*
 * MODERN DARK-MODE THEME FOR MENSA
 * Overrides w3.css defaults and introduces a sleek, premium design.
 */

:root {
  --bg-main: #0B0E14;
  /* Deep, sleek dark background */
  --bg-sidebar: #131722;
  /* Slightly softer dark for sidebar */
  --bg-card: #1C212D;
  /* Card background */
  --bg-card-hover: #262D3D;

  --text-primary: #E2E8F0;
  --text-muted: #94A3B8;
  --accent-color: #3B82F6;
  /* Vibrant blue */
  --accent-glow: rgba(59, 130, 246, 0.5);

  --gradient-glow: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  --sidebar-gradient: linear-gradient(180deg, #131722 0%, #0B0E14 100%);

  --surface-border: rgba(255, 255, 255, 0.08);
  --success-color: #10B981;
  --danger-color: #EF4444;

  --font-family: 'Inter', sans-serif;
}

body.modern-dark {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-family);
  margin: 0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1,
h3,
h4,
h5,
h6 {
  font-family: var(--font-family);
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.02em;
}

h2 {
  font-family: var(--font-family);
  font-weight: 700;
  color: #93c5fd; /* Brighter Radiant Blue */
  text-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
  letter-spacing: -0.01em;
  margin-top: 0;
}

/* -------------------------------------
 *  SIDEBAR OVERRIDES
 * ------------------------------------- */

/* Layout - narrow sidebar 80px */
.modern-sidebar {
  width: 100px !important;
  min-width: 100px !important;
  position: fixed !important;
  left: 0;
  top: 0;
  height: 100vh;
  background: var(--sidebar-gradient) !important;
  border-right: 1px solid var(--surface-border);
  display: flex !important;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
  z-index: 10;
}

.modern-sidebar .sidebar-avatar {
  padding: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-bottom: 1px solid var(--surface-border);
  margin-bottom: 10px;
}

.modern-sidebar .sidebar-avatar img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-color);
  box-shadow: 0 0 10px var(--accent-glow);
}

.modern-sidebar a.w3-bar-item {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-muted) !important;
  background: transparent !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px 5px !important;
  border-left: 3px solid transparent;
}

.modern-sidebar a.w3-bar-item:hover,
.modern-sidebar a.w3-bar-item:focus {
  background: rgba(255, 255, 255, 0.03) !important;
  color: var(--accent-color) !important;
  border-left: 3px solid var(--accent-color);
}

.modern-sidebar a.w3-bar-item i {
  font-size: 24px !important;
  margin-bottom: 6px;
  transition: transform 0.3s ease;
}

.modern-sidebar a.w3-bar-item:hover i {
  transform: translateY(-2px) scale(1.1);
  color: var(--accent-color);
  text-shadow: 0 0 10px var(--accent-glow);
}

.modern-sidebar a.w3-bar-item p {
  margin: 0;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}

#main {
  margin-left: 80px !important;
  min-height: 100vh;
  padding: 0 !important;
}

/* Container to prevent full-width stretching */
.page-container {
  max-width: 1300px;
  margin: 0 auto;
  padding: 20px;
  width: auto;
}

/* Tab Management */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: tabFadeIn 0.4s ease;
}

@keyframes tabFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modern-sidebar a.w3-bar-item.active {
  color: var(--accent-color) !important;
  border-left: 3px solid var(--accent-color);
  background: rgba(255, 255, 255, 0.03) !important;
}

@media only screen and (max-width: 600px) {

  #main,
  #main2 {
    margin-left: 0
  }
}


/* -------------------------------------
 *  MAIN CONTENT (Cards, Tables, etc.)
 * ------------------------------------- */

/* Hero Banner */
.hero-header {
  background-image: url('images/mensa.jpg') !important;
  background-size: cover !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-blend-mode: overlay;
  background-color: rgba(11, 14, 20, 0.7) !important;
  padding: 10px 10px !important;
  position: relative;
  overflow: hidden;
}

.hero-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 100px;
  background: linear-gradient(to top, var(--bg-main), transparent);
  pointer-events: none;
}

.hero-header h1 {
  font-size: 2.8rem !important;
  font-weight: 800;
  background: linear-gradient(to right, #fff, var(--text-muted));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  margin: 0 0 5px 0;
}

.hero-header h2 {
  opacity: 1;
  font-size: 1.4rem !important;
  color: #fff; /* High Contrast White for images */
  text-shadow: 0 0 15px var(--accent-color);
  margin: 0;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Modern Card */
.modern-card {
  background: var(--bg-card);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--surface-border);
  padding: 20px;
  margin-bottom: 30px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.modern-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* Tabellen / Speiseplan */
.modern-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 12px;
  overflow: hidden;
}

.modern-table th,
.modern-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--surface-border);
  font-size: 14px;
  line-height: 1.4;
  word-break: break-word;
  hyphens: auto;
}

.modern-table th {
  background: rgba(0, 0, 0, 0.3) !important;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
}

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

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

.modern-table td b {
  color: #fff;
  font-weight: 600;
}

/* Colored Columns for readability */
.col-vk {
  background: rgba(59, 130, 246, 0.05) !important;
}

.col-lvk {
  background: rgba(16, 185, 129, 0.05) !important;
}

.col-veg {
  background: rgba(245, 158, 11, 0.05) !important;
}

.modern-table tr:hover .col-vk {
  background: rgba(59, 130, 246, 0.1) !important;
}

.modern-table tr:hover .col-lvk {
  background: rgba(16, 185, 129, 0.1) !important;
}

.modern-table tr:hover .col-veg {
  background: rgba(245, 158, 11, 0.1) !important;
}

/* Meal Highlights */
.meal-title {
  font-weight: 500;
  color: #fff;
  display: inline;
}

.meal-additives {
  color: var(--text-muted);
  font-size: 13px;
  opacity: 0.8;
  display: inline;
}

/* Inputs & Formulare */
input[type="text"],
input[type="password"],
textarea,
select {
  background: rgba(0, 0, 0, 0.2) !important;
  border: 1px solid var(--surface-border) !important;
  color: #fff !important;
  border-radius: 8px !important;
  padding: 15px 20px !important;
  transition: all 0.3s ease;
  font-family: var(--font-family);
  width: 100%;
}

input:focus,
textarea:focus,
select:focus {
  outline: none !important;
  border-color: var(--accent-color) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2) !important;
  background: rgba(0, 0, 0, 0.4) !important;
}

select option {
  background: var(--bg-card);
  color: white;
}

/* Radio Buttons für Abstimmung */
.modern-radio-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

input[type='radio'] {
  appearance: none;
  width: 24px;
  height: 24px;
  border: 2px solid var(--text-muted);
  border-radius: 50%;
  outline: none;
  transition: all 0.3s ease;
  cursor: pointer;
  background: transparent;
  position: relative;
  transform: none;
  /* override alter transform */
}

input[type='radio']:checked {
  border-color: var(--accent-color);
  background: rgba(59, 130, 246, 0.1);
}

input[type='radio']:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-glow);
}

input[type='radio']:disabled {
  border-color: #333;
  cursor: not-allowed;
}

/* Modern Buttons */
.modern-btn {
  background: var(--accent-color);
  color: white !important;
  border: none;
  border-radius: 8px;
  padding: 14px 28px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
}

.modern-btn:hover {
  background: #2563EB;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.modern-btn.secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--surface-border);
  box-shadow: none;
}

.modern-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.modern-btn.jumbo {
  padding: 20px 40px;
  font-size: 20px;
  border-radius: 12px;
}

/* Footer & Impressum Styling */
footer.w3-content {
  max-width: 1200px;
  margin: 0 auto;
  border-top: 1px solid var(--surface-border);
  padding: 40px 20px !important;
  text-align: center;
}

#impressum {
  padding: 40px 0 !important;
  max-width: 100% !important;
  text-align: left;
}

#impressum h2 {
  font-size: 1.5rem;
  margin-bottom: 5px;
  color: var(--text-muted);
}

#impressum p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 5px 0;
}

#impressum .fa {
  width: 25px;
  font-size: 16px !important;
  color: var(--accent-color) !important;
}

#impressum a {
  color: var(--accent-color);
  text-decoration: none;
}

#impressum a:hover {
  text-decoration: underline;
}

.w3-red {
  border-left-color: var(--danger-color) !important;
  background: rgba(239, 68, 68, 0.1) !important;
  color: white !important;
}

.w3-green {
  border-left-color: var(--success-color) !important;
  background: rgba(16, 185, 129, 0.1) !important;
  color: white !important;
}

/* Typography Overrides for remaining w3 classes */
.w3-text-grey,
.w3-text-light-grey {
  color: var(--text-muted) !important;
}

.w3-xlarge {
  font-size: 20px !important;
}

.w3-xxlarge {
  font-size: 28px !important;
}

.w3-jumbo {
  font-size: 42px !important;
}

hr.w3-opacity {
  border-top: 1px solid var(--surface-border) !important;
  opacity: 1 !important;
}

.w3-opacity {
  opacity: 0.7 !important;
}

/* Contact Section Tweaks */
.w3-check {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-color);
}