/* main.css */

/* === Farbvariablen === */
:root {
  --header-bg:        #292b2c;   /* Dunkles Grau aus Header-Screenshot */
  --layout-bg:        #343a40;   /* Etwas helleres Grau */
  --sidebar-bg:       #292b2c;   /* Gleich wie Header */
  --content-bg:       #202124;   /* Sehr dunkles Grau für Content */
  --footer-bg:        #292b2c;   /* Gleich wie Header/Sidebar */
  --text-primary:     #ffffff;   /* Weißer Haupttext */
  --text-secondary:   #9a9da0;   /* Mittelgrauer Sekundärtext/Links */
  --highlight:        #8ab4f8;   /* Blaues Highlight für Active */
  --accent-bg:        #303134;   /* Hintergrund für Karten/Buttons */
  --active-bg:        #3c4043;   /* Hintergrund für aktive Elemente */
  --active-green:     #0a0;      /* Grün für erfolgreiche Meldungen */
  --error-red:        #a00;      /* Rot für Fehler-Meldungen */
}

/* === Reset & Basis === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: Arial, sans-serif;
  background: var(--layout-bg);
  color: var(--text-primary);
  line-height: 1.5;
}

/* === Header === */
header {
  background: var(--header-bg);
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
header .logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
header .logo img.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}
header .logo .title {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* === Optional: Suche im Header === */
header .search-input {
  flex: 1;
  max-width: 600px;
  margin-left: 1rem;
}
header .search-input input {
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  background: var(--accent-bg);
  color: var(--text-primary);
  border: none;
  border-radius: 4px;
}
header .search-input input::placeholder {
  color: var(--text-secondary);
}

/* === (Optional) Tabs unter dem Header === */
.nav-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
}
.nav-tabs .tab {
  background: var(--accent-bg);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}
.nav-tabs .tab:hover {
  background: var(--active-bg);
}
.nav-tabs .tab.active {
  background: var(--active-bg);
  font-weight: bold;
}

/* === Layout mit Sidebar === */
#layout {
  display: flex;
  min-height: calc(100vh - 112px); /* Header + Footer abziehen */
}

/* === Sidebar === */
#sidebar {
  width: 220px;
  background: var(--sidebar-bg);
  padding: 1rem 0;
}
#sidebar nav ul {
  list-style: none;
}
#sidebar nav li + li {
  margin-top: 0.25rem;
}
#sidebar nav a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  border-left: 4px solid transparent;
  transition: background 0.2s, color 0.2s, border-left-color 0.2s;
}
#sidebar nav a:hover {
  background: var(--accent-bg);
  color: var(--text-primary);
}
#sidebar nav a.active {
  background: var(--active-bg);
  color: var(--text-primary);
  border-left-color: var(--highlight);
  font-weight: bold;
}

/* === Sidebar Submenu === */
#sidebar .submenu {
  display: none;
  list-style: none;
  margin: 0;
  padding-left: 1rem;
}
#sidebar .has-submenu.open > .submenu {
  display: block;
}
#sidebar .submenu-title {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
#sidebar .submenu-title:hover {
  background: var(--accent-bg);
  color: var(--text-primary);
}

/* === Main-Content === */
main#content {
  flex: 1;
  padding: 1.5rem;
  background: var(--content-bg);
  overflow: auto;
}

/* === Footer === */
footer {
  background: var(--footer-bg);
  color: var(--text-secondary);
  text-align: center;
  padding: 1rem;
  font-size: 0.85rem;
}

/* === Globale Link-Styles === */
a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--text-primary);
}

/* === Mediathek-Grid & Video-Karten === */
#container {
  width: 90%;
  margin: 0 auto;
}
.tier-section {
  margin-bottom: 2rem;
}
.tier-section h2 {
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
}
.videos-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
}
.video-item {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.video-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #444;
  border-radius: 4px;
  overflow: hidden;
}
.video-wrapper img.thumb,
.video-wrapper video {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.duration {
  position: absolute;
  bottom: 0.4rem; right: 0.4rem;
  background: rgba(0,0,0,0.7);
  color: #fff;
  font-family: monospace;
  font-size: 0.75rem;
  padding: 0.2rem 0.4rem;
  border-radius: 2px;
}
.video-title {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  height: 2.4em;
  overflow: hidden;
  line-height: 1.2em;
}

/* === "Mehr anzeigen"-Logik === */
.more {
  display: none;
}
.tier-section.show-all .more {
  display: flex;
}
.show-all-btn {
  margin-top: 0.75rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  background: var(--accent-bg);
  color: var(--text-primary);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}
.show-all-btn:hover {
  background: var(--active-bg);
}

/* === FAQ === */
.faq-item {
  margin-bottom: 1.5rem;
}
.faq-item h2 {
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}
.faq-item p {
  padding-left: 1rem;
}

/* === Suchformular === */
#search-form {
  text-align: center;
  margin: 1.5rem 0;
}
#search-form input[type="text"] {
  width: 60%;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  background: var(--accent-bg);
  color: var(--text-primary);
  border: none;
  border-radius: 4px;
}
#search-form input[type="text"]::placeholder {
  color: var(--text-secondary);
}
#search-form button,
#search-form a {
  margin-left: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  background: var(--accent-bg);
  color: var(--text-primary);
  border: none;
  border-radius: 4px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}
#search-form button:hover,
#search-form a:hover {
  background: var(--active-bg);
}

/* === Abonnementstatus-Seite Styles === */
body.abostatus-page main#content {
  margin: 2em;
}
body.abostatus-page main#content section {
  margin-bottom: 2em;
}
body.abostatus-page main#content dl dt {
  font-weight: bold;
}
body.abostatus-page main#content dl dd {
  margin: 0 0 0.5em 1em;
}
body.abostatus-page main#content .expired {
  color: var(--error-red);
}
body.abostatus-page main#content .active {
  color: var(--active-green);
}
body.abostatus-page main#content time.end-local {
  font-style: normal;
}

/* === Form-Elemente dunkel stylen & Radios in Akzent-Farbe === */
main#content input[type="number"],
main#content input[type="text"],
main#content select {
  background: var(--accent-bg);
  color: var(--text-primary);
  border: 1px solid var(--active-bg);
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
}

main#content input[type="radio"] {
  accent-color: var(--highlight);
}

main#content button,
main#content input[type="button"],
main#content input[type="submit"] {
  background: var(--accent-bg);
  color: var(--text-primary);
  border: 1px solid var(--active-bg);
  border-radius: 4px;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

main#content button:hover,
main#content input[type="button"]:hover,
main#content input[type="submit"]:hover {
  background: var(--active-bg);
}

/* === Fieldset/Legend Styling für "Tier" Auswahl === */
main#content fieldset {
  border: 1px solid var(--text-secondary);
  padding: 1rem;
  margin: 1.5rem 0;
  border-radius: 4px;
}
main#content legend {
  color: var(--text-primary);
  font-weight: bold;
  padding: 0 0.5rem;
}
main#content fieldset label {
  display: block;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  cursor: pointer;
}

/* === Flash Messages === */
.flash {
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 4px;
}
.flash-success {
  border: 1px solid var(--active-green);
  background: rgba(0, 170, 0, 0.1);
}
.flash-error {
  border: 1px solid var(--error-red);
  background: rgba(255, 0, 0, 0.1);
}
/* „Bezahlung erfolgreich!“ in grün */
.flash-success strong {
  color: var(--active-green);
}
