/*
 * Custom stylesheet for the 3G‑IT documentation portal
 *
 * This file defines a modern look and feel for the application using a
 * dark‑blue accent colour. Colours, spacing and other constants are
 * defined as CSS custom properties at the top so they can be easily
 * adjusted in one place. The intention is to provide a consistent
 * appearance across all pages, forms and tables.
 */

/* Theme variables */
:root {
  /* Farbpalette für professionelles, modernes Design */
  --colour-primary: #0051a2;        /* satttes Blau */
  --colour-primary-hover: #004080;  /* dunkleres Blau für Hover */
  --colour-primary-light: #4d88ff;  /* helleres Blau für Fokus */
  --colour-background: #f2f5fa;    /* sehr helles Grau-Blau */
  --colour-card: #ffffff;          /* Karten und Formularhintergrund */
  --colour-border: #ccd7e3;        /* dezente Rahmenfarbe */
  --colour-text: #1a2433;          /* Standardtextfarbe */
  --colour-heading: #11213a;       /* Überschriftenfarbe */
  --colour-table-header: #eef3f9;  /* Tabellenkopf-Hintergrund */
  --colour-table-row-hover: #f7faff; /* Tabellenzeile Hover/gerade Zeilen */
  --colour-success-bg: #e6f7ee;
  --colour-success-border: #b8e0c2;
  --colour-success-text: #166534;
  --colour-error-bg: #fdecea;
  --colour-error-border: #f5c6cb;
  --colour-error-text: #b71c1c;
}

/* Base styles */
body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--colour-background);
  color: var(--colour-text);
  line-height: 1.5;
}

/* Generic container to wrap content and centre it */
.container {
  max-width: 1100px;
  margin: 20px auto;
  padding: 20px;
}

/* Fixed header at the top */
header.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: var(--colour-primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

header.site-header .header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
}

header.site-header h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
}

header.site-header nav a {
  margin-left: 20px;
  text-decoration: none;
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  transition: color 0.2s ease;
}

header.site-header nav a:hover {
  color: #fff;
}

/* Ensure main content does not overlap with fixed header */
main.container {
  margin-top: 90px;
}

h2,
h3 {
  color: var(--colour-heading);
  margin-top: 20px;
  margin-bottom: 10px;
}

/* Standard form styling */
form {
  background: var(--colour-card);
  padding: 20px;
  border: 1px solid var(--colour-border);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  margin-top: 20px;
}

label {
  font-weight: 500;
  display: block;
  margin-top: 12px;
  color: var(--colour-text);
}

input,
textarea,
select {
  width: 100%;
  padding: 10px;
  margin-top: 6px;
  border: 1px solid var(--colour-border);
  border-radius: 6px;
  background: #fff;
  color: var(--colour-text);
  font-size: 14px;
  box-sizing: border-box;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--colour-primary);
  box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.3);
  outline: none;
}

button {
  background: var(--colour-primary);
  color: #fff;
  border: none;
  padding: 10px 18px;
  margin-top: 15px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
}

button:hover {
  background: var(--colour-primary-hover);
}

/* Spezielles Styling für die Filterzeile in der Übersicht */
.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: flex-end;
  background: var(--colour-card);
  padding: 15px;
  border: 1px solid var(--colour-border);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  margin-top: 20px;
}

.filter-form label {
  margin-top: 0;
  font-weight: 500;
}

.filter-form input,
.filter-form select {
  flex: 1 1 200px;
  min-width: 180px;
}

/* Table styling */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 15px;
  background: var(--colour-card);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

th,
td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--colour-border);
  text-align: left;
  font-size: 14px;
}

th {
  background: var(--colour-table-header);
  font-weight: 600;
  color: var(--colour-heading);
}

tr:hover td {
  background: var(--colour-table-row-hover);
}

/* Zebra-Streifen für bessere Lesbarkeit in Tabellen */
table tr:nth-child(even) td {
  background: var(--colour-table-row-hover);
}
table tr:nth-child(even):hover td {
  /* Beim Hover soll die Hover-Farbe Vorrang haben */
  background: var(--colour-table-row-hover);
}

/* Notification boxes */
.error {
  background: var(--colour-error-bg);
  color: var(--colour-error-text);
  padding: 10px;
  border: 1px solid var(--colour-error-border);
  border-radius: 6px;
  margin-top: 10px;
}

.msg {
  background: var(--colour-success-bg);
  color: var(--colour-success-text);
  padding: 10px;
  border: 1px solid var(--colour-success-border);
  border-radius: 6px;
  margin-top: 10px;
}

/* Quick links on login/home page */
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 20px;
}
.quick-links a {
  flex: 1 1 160px;
  background: var(--colour-card);
  border: 1px solid var(--colour-border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  color: var(--colour-primary);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}
.quick-links a:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  color: var(--colour-primary-hover);
}

/* Secondary button style (links styled as buttons for cancel actions) */
a.button-secondary {
  display: inline-block;
  margin-left: 10px;
  padding: 10px 18px;
  background: var(--colour-table-header);
  border: 1px solid var(--colour-border);
  border-radius: 6px;
  color: var(--colour-primary);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
}
a.button-secondary:hover {
  background: var(--colour-table-row-hover);
  color: var(--colour-primary-hover);
}

/* Danger button style for delete actions */
.button-danger {
  display: inline-block;
  margin-left: 10px;
  padding: 10px 18px;
  background: var(--colour-error-text);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease;
}
.button-danger:hover {
  background: #8b0f0f;
}

/* Styling for password fields and action icons */
.password-field {
  margin-right: 4px;
  font-family: monospace;
}
.toggle-password,
.copy-password {
  background: none;
  border: none;
  margin-left: 2px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 2px 4px;
  color: var(--colour-primary);
}
/* Beim Hover soll nur ein blauer Rahmen erscheinen und die Schriftfarbe bleibt beim Primärblau */
.toggle-password:hover,
.copy-password:hover {
  color: var(--colour-primary);
  border: 1px solid var(--colour-primary);
  border-radius: 4px;
  background: none;
}

/* Container für Passwort und Aktionssymbole in der Übersicht */
.password-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

/* Responsive navigation */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
}

@media (max-width: 768px) {
  header.site-header .header-inner {
    justify-content: space-between;
  }
  nav.site-nav {
    position: fixed;
    top: 0;
    right: -260px;
    width: 260px;
    height: 100vh;
    background: var(--colour-primary);
    display: flex;
    flex-direction: column;
    padding-top: 80px;
    transition: right 0.3s ease;
    box-shadow: -2px 0 6px rgba(0, 0, 0, 0.1);
    z-index: 1500;
  }
  nav.site-nav.open {
    right: 0;
  }
  nav.site-nav a {
    margin: 15px 20px;
    color: #fff;
    display: block;
  }
  button.mobile-menu-toggle {
    display: block;
    /* Ensure toggle button stays above the sliding menu */
    position: relative;
    z-index: 2001;
  }
  /* Ensure main content has padding on small screens */
  main.container {
    margin-top: 90px;
    padding-left: 20px;
    padding-right: 20px;
  }

  /* Make tables scrollable horizontally on small screens */
  table {
    display: block;
    overflow-x: auto;
  }
  table thead, table tbody, table tr {
    display: table;
    width: 100%;
    table-layout: fixed;
  }
}

/* Footer styling */
footer.site-footer {
  background: var(--colour-primary);
  color: #fff;
  padding: 30px 20px;
  margin-top: 60px;
}

/* Layout container inside the footer */
footer.site-footer .footer-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

footer.site-footer .footer-about,
footer.site-footer .footer-links,
footer.site-footer .footer-copy {
  flex: 1 1 200px;
  font-size: 14px;
}

footer.site-footer .footer-links a {
  color: #ffffff;
  text-decoration: none;
  margin-right: 8px;
}
footer.site-footer .footer-links a:hover {
  text-decoration: underline;
  color: var(--colour-primary-light);
}

footer.site-footer .footer-copy {
  text-align: right;
}

@media (max-width: 768px) {
  footer.site-footer .footer-copy {
    text-align: left;
  }
}

/* Dropdown-Menü für Verwaltung (Desktop) */
nav.site-nav .dropdown {
  position: relative;
  display: inline-block;
}
nav.site-nav .dropdown .dropdown-content {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--colour-primary);
  display: flex;
  flex-direction: column;
  min-width: 200px;
  border-radius: 0 0 6px 6px;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.5s ease, opacity 0.5s ease;
  z-index: 2000;
}
nav.site-nav .dropdown .dropdown-content a {
  padding: 10px 20px;
  color: #fff;
  white-space: nowrap;
}
nav.site-nav .dropdown .dropdown-content a:hover {
  background: var(--colour-primary-hover);
}
nav.site-nav .dropdown:hover .dropdown-content {
  max-height: 600px;
  opacity: 1;
}

/* Mobile Ansicht: Dropdown-Elemente als normale Liste anzeigen */
@media (max-width: 768px) {
  nav.site-nav .dropdown .dropdown-content {
    position: static;
    max-height: none;
    opacity: 1;
    background: transparent;
    box-shadow: none;
  }
  nav.site-nav .dropdown .dropdown-content a {
    margin-left: 20px;
    padding: 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
  }
}

/* Utility classes */
.hidden {
  display: none !important;
}

/* Filter form */
.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
  align-items: center;
}

.filter-form input,
.filter-form select {
  flex: 1;
  min-width: 200px;
}