:root {
  --bg1: #0f172a;       /* Dunkles Slate-Blau */
  --bg2: #0b2545;       /* Dunkles Navy */
  --card: rgba(255, 255, 255, 0.03);
  --accent: #8be9fd;    /* Helles Cyan/Blau */
  --text: #e6eef8;      /* Fast Weiß */
  --input-bg: #1e293b;  /* Etwas hellerer Hintergrund für Inputs */
  --border: rgba(139, 233, 253, 0.15); /* Subtile Rahmenfarbe */
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: Inter, Roboto, "Segoe UI", Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Container & Typografie --- */
.container {
  max-width: 900px;
  margin: 48px auto;
  padding: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
  border-radius: 12px;
  box-shadow: 0 6px 30px rgba(3, 6, 23, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(6px);
  text-align: center;
}

h1 {
  margin: 0 0 12px 0;
  font-size: 1.9rem;
  color: var(--accent);
  letter-spacing: 0.4px;
}

h2 {
  margin: 8px 0 18px 0;
  font-size: 1.2rem;
  color: rgba(230, 238, 248, 0.92);
}

p,
ul {
  margin: 8px 0;
  line-height: 1.55;
  color: rgba(230, 238, 248, 0.92);
}

a {
  color: var(--accent);
}

/* --- Buttons & Links --- */
.mailto,
marquee {
  display: inline-block;
  margin-top: 8px;
  margin-right: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(139, 233, 253, 0.12), rgba(139, 233, 253, 0.06));
  color: var(--accent);
  text-decoration: none;
  border: 1px solid rgba(139, 233, 253, 0.08);
  transition: transform .12s ease, box-shadow .12s ease;
}

.mailto:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(11, 37, 69, 0.5);
}

footer {
  margin-top: 18px;
  font-size: 0.85rem;
  color: rgba(230, 238, 248, 0.7);
  text-align: center;
}

@media (max-width:540px) {
  .container {
    margin: 20px;
    padding: 18px;
  }
  h1 {
    font-size: 1.4rem;
  }
}

/* --- User Widget (Oben Rechts) --- */
.user-widget {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-container {
  display: inline-flex;
}

/* Avatar-Button */
.avatar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 2px solid rgba(139, 233, 253, 0.3);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.2s;
}

.avatar-btn:hover {
  border-color: var(--accent);
}

.avatar-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#user-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* --- Dropdown Menü --- */
.user-menu {
  position: absolute;
  top: 50px;
  right: 0;
  min-width: 240px;
  background: var(--bg2);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95), rgba(11, 37, 69, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  padding: 12px;
  color: var(--text);
  z-index: 1001;
}

.menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 4px 12px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 12px;
}

.menu-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.menu-ident {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.menu-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-email {
  font-size: 0.8rem;
  color: rgba(230, 238, 248, 0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-action {
  width: 100%;
  background: linear-gradient(90deg, rgba(139, 233, 253, 0.08), rgba(139, 233, 253, 0.02));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--accent);
  font-weight: 500;
  transition: all 0.12s ease;
  text-align: center;
}

.menu-action:hover {
  background: rgba(139, 233, 253, 0.15);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.menu-action:active {
  background: rgba(139, 233, 253, 0.05);
  transform: translateY(0);
}

[hidden] {
  display: none !important;
}

/* --- IP Info Styles --- */
.ip-box {
  margin: 18px auto;
  padding: 16px;
  border-radius: 10px;
  background: var(--card);
  display: inline-block;
  min-width: 320px;
  border: 1px solid rgba(139, 233, 253, 0.1);
}

.ip-value {
  font-family: monospace;
  font-weight: 700;
  color: var(--accent);
  font-size: 1.1rem;
  word-break: break-all;
}

.info-list {
  max-width: 550px;
  margin: 25px auto;
  text-align: left;
  padding: 0;
  list-style: none;
  background: rgba(139, 233, 253, 0.02);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(139, 233, 253, 0.05);
}

.info-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(139, 233, 253, 0.05);
}

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

.label {
  color: #888;
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 600;
}

.value {
  color: var(--accent);
  font-family: monospace;
  font-size: 0.9rem;
  text-align: right;
  word-break: break-all;
}

.section-title {
  background: rgba(139, 233, 253, 0.05);
  padding: 8px 20px;
  font-size: 0.75rem;
  color: #aaa;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --- NEU: Login Modal System (Farblich angepasst) --- */

/* Login-Button im Header (neben Google) */
.login-trigger {
  display: inline-block;
  margin-right: 4px;
  padding: 10px 14px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(139, 233, 253, 0.12), rgba(139, 233, 253, 0.06));
  color: var(--accent);
  text-decoration: none;
  border: 1px solid rgba(139, 233, 253, 0.08);
  transition: transform .12s ease, box-shadow .12s ease;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  height: auto; /* Höhe anpassen an Google Button */
}

.login-trigger:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(11, 37, 69, 0.5);
  background: linear-gradient(90deg, rgba(139, 233, 253, 0.12), rgba(139, 233, 253, 0.06));
  color: var(--accent);
}

/* Hintergrund Abdunklung */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
}

/* Modal Inhalt */
.modal-content {
  background: var(--bg1);
  background: linear-gradient(135deg, var(--bg1), var(--bg2));
  margin: 10% auto;
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 90%;
  max-width: 380px;
  color: var(--text);
  text-align: center;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.6), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Eingabefelder */
.modal-input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--input-bg);
  color: white;
  box-sizing: border-box;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 233, 253, 0.2);
}

/* Haupt-Button im Modal (Einloggen / Erstellen) */
.modal-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: var(--bg2);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 15px;
  font-size: 1rem;
  transition: all 0.2s;
}

.modal-btn:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 15px rgba(139, 233, 253, 0.4);
}

/* --- Global Primary Button (Dashboard & Co) --- */
.btn-primary {
  display: inline-block;
  padding: 10px 20px;
  background: linear-gradient(135deg, rgba(139, 233, 253, 0.15), rgba(139, 233, 253, 0.05));
  color: var(--accent);
  border: 1px solid rgba(139, 233, 253, 0.2);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
  text-align: center;
  text-decoration: none;
}

.btn-primary:hover {
  background: rgba(139, 233, 253, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(11, 37, 69, 0.4);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Tabs (Anmelden | Registrieren) */
.tab-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 5px;
}

.tab-btn {
  background: transparent;
  border: none;
  color: rgba(230, 238, 248, 0.5);
  cursor: pointer;
  font-size: 1rem;
  padding-bottom: 10px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: rgba(230, 238, 248, 0.9);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

/* Schließen (X) */
.close {
  float: right;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.4);
  margin-top: -15px;
  margin-right: -10px;
  transition: color 0.2s;
}

.close:hover {
  color: var(--accent);
}

/* --- Globale Formular Styles --- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
    width: 100%;
    padding: 12px;
    margin: 8px 0 16px 0;
    background: var(--input-bg, #1e293b); /* Fallback falls Variable fehlt */
    border: 1px solid var(--border, rgba(139, 233, 253, 0.15));
    border-radius: 8px;
    color: #e2e8f0;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

/* Spezifische Verbesserungen für select und textarea */
select {
    background-image: linear-gradient(45deg, transparent 50%, var(--accent, #8be9fd) 50%),
                      linear-gradient(135deg, var(--accent, #8be9fd) 50%, transparent 50%);
    background-position: calc(100% - 15px) center, calc(100% - 10px) center;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 40px;
    appearance: none;
}

select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent, #8be9fd);
    background-color: rgba(30, 41, 59, 0.95);
    box-shadow: 0 0 0 3px rgba(139, 233, 253, 0.15);
}

/* Placeholder Styling */
input::placeholder,
textarea::placeholder {
    color: rgba(230, 238, 248, 0.4);
}

/* Speichern Buttons */
.btn-primary {
    width: 100%;
    padding: 12px;
    /* Angepasst an .mailto Stil */
    background: linear-gradient(90deg, rgba(139, 233, 253, 0.12), rgba(139, 233, 253, 0.06));
    color: var(--accent, #8be9fd);
    border: 1px solid rgba(139, 233, 253, 0.15); /* Etwas stärkerer Border als mailto */
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 233, 253, 0.15);
    background: linear-gradient(90deg, rgba(139, 233, 253, 0.18), rgba(139, 233, 253, 0.12));
}

/* --- Spezielle Input-Klassen --- */

/* API Key Input - Monospace Font */
.api-key-input {
    font-family: 'Courier New', 'Courier', monospace !important;
    color: var(--accent) !important;
}

.api-key-input:focus {
    color: var(--accent) !important;
}

/* Read-only Input Styling */
input[readonly] {
    opacity: 0.9;
    cursor: text;
}

input[readonly]:focus {
    background-color: rgba(30, 41, 59, 0.8);
}

/* --- Avatar Auswahl (Dashboard) --- */
.avatar-option {
    cursor: pointer;
    position: relative;
    display: inline-block;
}

.avatar-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.avatar-option img { 
    width: 60px; 
    height: 60px; 
    border-radius: 50%; 
    border: 3px solid transparent; 
    transition: all 0.2s; 
}

/* Wenn Radio ausgewählt ist -> Grüner Rand */
.avatar-option input:checked + img { 
    border-color: #50fa7b; 
    transform: scale(1.1); 
    box-shadow: 0 0 15px rgba(80, 250, 123, 0.4); 
}

.avatar-option:hover img { 
    border-color: var(--accent, #8be9fd); 
}

/* --- Table Styles --- */
table.info-table {
  width: 100%;
  max-width: 800px;
  margin: 20px auto;
  border-collapse: separate;
  border-spacing: 0;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

table.info-table tr {
  transition: background 0.2s ease;
}

table.info-table tr:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

table.info-table td {
  padding: 16px 24px;
  text-align: left;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

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

table.info-table tr:hover {
  background: rgba(139, 233, 253, 0.05);
}

/* Label Cell (First Column) */
table.info-table td:first-child {
  color: var(--accent);
  font-weight: 600;
  width: 35%;
  border-right: 1px solid var(--border);
}

@media (max-width: 600px) {
  table.info-table td {
    padding: 12px 16px;
  }
  table.info-table td:first-child {
    width: 40%;
  }
}
