/* ==========================================================================
   EWE Design
   ========================================================================== */

:root {
  /* EWE Farbpalette */
  --ewe-yellow: #FFD700;
  --ewe-yellow-hover: #FFF3B2;
  --ewe-yellow-active: #F5D000;
  --ewe-dark-grey: #393E41;
  --ewe-black-grey: #303437;
  --ewe-white: #ffffff;
  --ewe-text-main: #393E41;
  --ewe-text-light: #7f8c8d;
  --ewe-success: #27ae60;
  --ewe-error: #e74c3c;
  --ewe-info: #3498db;
  
  /* Schriftart (EWE nutzt 'Volte', ersatzweise serifenlose Fonts) */
  --font-family: 'Volte', Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  color: var(--ewe-text-main);
  background-color: var(--ewe-white);
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Header Bereich
   ========================================================================== */

.main-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 4.5rem;
  background-color: var(--ewe-dark-grey);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.header-left {
  display: flex;
  flex-direction: column;
}

.header-brand {
  color: var(--ewe-yellow);
  font-size: 1.875rem;
  font-weight: 600;
}

.header-title {
  color: var(--ewe-white);
  margin: 0;
  font-size: 1.2em;
  font-weight: 600;
}

.header-logo {
  height: 40px;
  width: auto;
}

/* Logo Klasse für SVG Darstellung */
.ewe-logo-svg {
  display: inline-block;
  fill: currentColor;
  color: #FFD700;
  width: 6.125rem;
  height: 2.0625rem;
  font-size: 1.5rem;
  flex-shrink: 0;
  user-select: none;
}

.logo-footer { 
  width: 3rem;
  height: 1rem;
}

/* Navigations-Links im Header */
.header-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.header-nav-link {
  color: var(--ewe-white);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 400;
  transition: color 150ms ease;
}

.header-nav-link:hover {
  color: var(--ewe-yellow-hover);
}

/* Gelber Akzent-Streifen */
.header-accent {
  height: 4px;
  background-color: var(--ewe-yellow);
  width: 100%;
}

/* ==========================================================================
   Buttons im EWE-Stil
   ========================================================================== */

.ewe-btn-primary {
  background-color: var(--ewe-yellow);
  color: var(--ewe-dark-grey);
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 250ms ease;
  font-family: var(--font-family);
}

.ewe-btn-primary:hover {
  background-color: var(--ewe-yellow-hover);
}

.ewe-btn-primary:active {
  background-color: var(--ewe-yellow-active);
}

/* ==========================================================================
   Footer (gemeinsam)
   ========================================================================== */

.main-footer {
  background-color: var(--ewe-dark-grey);
  color: var(--ewe-text-light);
  padding: 2rem 1.5rem;
  margin-top: 4rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer-brand-text {
  color: var(--ewe-yellow);
  font-weight: 600;
  font-size: 0.875rem;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--ewe-text-light);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--ewe-text-light);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 150ms ease;
}

.footer-links a:hover {
  color: var(--ewe-yellow-hover);
}

/* ==========================================================================
   Container und Layout
   ========================================================================== */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.content-wrapper {
  padding: 2rem 0;
}

/* ==========================================================================
   Admin-spezifische Styles (ergänzend)
   ========================================================================== */

/* Admin Header spezifisch */
.admin-header {
  background-color: var(--ewe-black-grey);
}

/* Config Form Styles */
.config-section {
  padding: 2rem 0;
}

.config-form {
  max-width: 800px;
}

.config-group {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.config-group h3 {
  margin-top: 0;
  color: var(--ewe-dark-grey);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.config-field {
  margin-bottom: 1rem;
}

.config-field:last-child {
  margin-bottom: 0;
}

.config-field label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--ewe-text-main);
}

.config-field input[type="text"],
.config-field input[type="url"],
.config-field input[type="color"],
.config-field textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-family: var(--font-family);
  font-size: 0.9rem;
}

.config-field input:focus,
.config-field textarea:focus {
  outline: none;
  border-color: var(--ewe-yellow);
  box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.25);
}

.config-field small {
  display: block;
  margin-top: 0.25rem;
  color: var(--ewe-text-light);
  font-size: 0.8rem;
}

.config-actions {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e9ecef;
}

/* Buttons */
.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  font-family: var(--font-family);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 150ms ease;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--ewe-yellow);
  color: var(--ewe-dark-grey);
  font-weight: 600;
}

.btn-primary:hover {
  background-color: var(--ewe-yellow-hover);
}

.btn-small {
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
}

.btn-delete {
  background-color: #f8d7da;
  color: var(--ewe-error);
  border: 1px solid var(--ewe-error);
}

.btn-delete:hover {
  background-color: var(--ewe-error);
  color: white;
}

/* Users Section */
.users-section {
  padding: 2rem 0;
}

.user-card {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.user-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.user-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* API Keys */
.key-card {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.api-key-input-wrapper {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.api-key-input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
}

.btn-copy {
  background-color: var(--ewe-info);
  color: white;
  border: none;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
}

.btn-copy:hover {
  background-color: #2980b9;
}

/* New User/Key Section */
.new-user-section {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 2rem;
}

.users-form {
  max-width: 800px;
}

/* Message */
.message {
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

.message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Log View */
.log-view {
  padding: 2rem 0;
}

.log-content {
  background: #000000;
  color: #27ae60;
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  line-height: 1.4;
  max-height: 600px;
  overflow-y: auto;
}

/* No Incidents */
.no-incidents {
  text-align: center;
  padding: 3rem;
  color: var(--ewe-text-light);
}

/* Incident Cards (falls noch vorhanden) */
.incident-list {
  display: grid;
  gap: 1rem;
}

.incident-card {
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 150ms ease;
}

.incident-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.incident-link {
  text-decoration: none;
  color: inherit;
}

.incident-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 600;
}

.incident-areas {
  font-size: 1.1rem;
  margin: 0.5rem 0;
  color: var(--ewe-text-main);
}

.incident-description {
  color: var(--ewe-text-light);
  font-size: 0.9rem;
  line-height: 1.5;
}

.incident-eta {
  font-size: 0.85rem;
  color: var(--ewe-text-light);
  margin-top: 0.5rem;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 1rem;
  }
  
  .footer-container {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* Admin Toolbar */
.admin-toolbar {
  background-color: var(--ewe-dark-grey);
  padding: 0.75rem 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.admin-toolbar a {
  color: var(--ewe-white);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 150ms ease;
}

.admin-toolbar a:hover {
  background-color: rgba(255, 215, 0, 0.1);
}

.admin-toolbar-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-left: auto;
  color: var(--ewe-white);
  font-size: 0.75rem;
  line-height: 1.3;
}

.toolbar-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem;
  justify-items: end;
}

.toolbar-label {
  opacity: 0.6;
}

.toolbar-value {
  font-family: monospace;
}

.toolbar-env {
  font-weight: 700;
  text-transform: uppercase;
}

.env-prod {
  color: #4ade80;
}

.env-dev {
  color: var(--ewe-yellow);
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--ewe-dark-grey);
    padding: 0 1.5rem;
}

.admin-tab {
    color: var(--ewe-text-light);
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 150ms ease;
}

.admin-tab:hover {
    color: var(--ewe-text-main);
}

.admin-tab.active {
    color: var(--ewe-yellow);
    border-bottom-color: var(--ewe-yellow);
}

/* Admin Main Content */
.admin-main {
  padding: 2rem 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

/* ==========================================================================
   Public-spezifische Styles (ergänzend)
   ========================================================================== */

/* Public Header spezifisch */
.public-header {
  background-color: var(--ewe-dark-grey);
}

/* Documentation Styles */
.endpoint {
  background: #ecf0f1;
  padding: 20px;
  margin: 15px 0;
  border-left: 4px solid var(--ewe-info);
  border-radius: 4px;
}

.method {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 4px;
  font-weight: bold;
  color: white;
  margin-right: 10px;
  font-size: 0.9em;
}

.method.get { background: var(--ewe-success); }
.method.post { background: var(--ewe-info); }
.method.delete { background: var(--ewe-error); }

/* Terminal-like code blocks */
.terminal {
  background: #2c3e50;
  color: #ecf0f1;
  padding: 15px;
  border-radius: 4px;
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  line-height: 1.5;
  border: 1px solid #333;
}

.terminal .prompt { color: #569cd6; }
.terminal .flag { color: #9cdcfe; }
.terminal .string { color: #ce9178; }
.terminal .url { color: #0dbc87; }

code {
  background: #ecf0f1;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  color: #ce9178;
}

.note {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  padding: 15px;
  margin: 15px 0;
  border-radius: 4px;
  color: #333;
}

/* Success/Error Text */
.success { color: var(--ewe-success); }
.error { color: var(--ewe-error); }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
}

th, td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

th {
  background: var(--ewe-dark-grey);
  color: var(--ewe-white);
}

tr:hover {
  background: #f5f5f5;
}

/* Lists */
ul {
  line-height: 1.8;
}

li {
  margin: 8px 0;
}

/* Horizontal Rule */
hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 40px 0;
}

/* Footer spezifisch für Public */
.public-footer {
  text-align: center;
  color: var(--ewe-text-light);
  font-size: 0.9em;
  margin-top: 40px;
}

.public-footer a {
  color: var(--ewe-info);
  text-decoration: none;
  margin: 0 10px;
}

.public-footer a:hover {
  text-decoration: underline;
}

.toc {
    background: var(--color-background-secondary, #f5f5f3);
    border: 1px solid var(--color-border-tertiary, #e0e0dc);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    display: inline-block;
    margin-bottom: 2rem;
}

.toc h2 {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary, #666);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin: 0 0 0.75rem 0;
}

.toc li {
    margin: 2px;
}

.toc ol {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: toc-main;
}

.toc > ol > li {
    counter-increment: toc-main;
    padding: 3px 0;
}

.toc > ol > li > a {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary, #1a1a1a);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.toc > ol > li > a::before {
    content: counter(toc-main) ".";
    font-size: 12px;
    color: var(--color-text-tertiary, #999);
    min-width: 14px;
}

.toc > ol > li > a:hover {
    text-decoration: underline;
}

.toc ol ol {
    list-style: none;
    padding: 4px 0 4px 20px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.toc ol ol li a {
    font-size: 13px;
    color: var(--color-text-secondary, #666);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.toc ol ol li a:hover {
    color: var(--color-text-primary, #1a1a1a);
}
