/* Root‑Variablen & Dark‑Mode */

:root {
  --bg: #f5f5f5;
  --fg: #1a1a1a;
  --card-bg: #f5f5f5;
  --border: #d0d0d0;
  --icon-color: #333;
  --titlebar-button-fg: #000;
  --toolbar-height: 42px;
}

.dark {
  --bg: #1e1e1e;
  --fg: #e6e6e6;
  --card-bg: #2a2a2a;
  --border: #444;
  --icon-color: #ddd;
  --titlebar-button-fg: #ccc;
}

body {
  background: var(--bg);
  color: var(--fg);
}

/* Base Styles */

html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 60px;
  padding-top: 54px; /* gleiche Höhe wie deine Navbar */
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.form-line {
  min-width: 500px;
  position: relative;
  margin-bottom: 1.5rem;
}

/* Win11 Navbar */

.win11-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 54px;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.55);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  z-index: 1000;
}

.nav-spacer {
  height: 60px;
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
}

.nav-btn {
  padding: 8px 14px;
  margin-right: 10px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
  transition: background 0.2s, color 0.2s;
}

  .nav-btn:hover {
    background: rgba(0,0,0,0.06);
  }

.logout {
  color: #b00020;
}

  .logout:hover {
    background: rgba(176, 0, 32, 0.12);
  }

.nav-user {
  margin-right: 12px;
  font-weight: 600;
  color: var(--fg);
}

/* Titlebar Buttons (Win11‑Style) */

.win11-titlebar-button {
  color: var(--titlebar-button-fg) !important;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

  .win11-titlebar-button:hover {
    background: rgba(0,0,0,0.05);
  }

.dark .win11-titlebar-button:hover {
  background: rgba(255,255,255,0.1);
}

/* Login Page */

.login-container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  height: 100vh;
  align-items: center;
  gap: 40px;
}

.login-left,
.login-right {
  display: flex;
  justify-content: center;
  align-items: center;
}

.side-image img {
  max-width: 100%;
  height: auto;
}

.login-box {
  width: 350px;
  padding: 30px;
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  position: relative;
  z-index: 2;
}

/* Dashboard */
.dashboard-container {
  padding: 20px;
}

.dashboard-grid {
  display: flex !important;
  flex-direction: row;
  gap: 20px;
  flex-wrap: wrap;
  align-items: stretch;
}

.dash-tile {
  display: block;
  padding: 20px;
  background: rgba(102, 177, 250, 0.70);
  backdrop-filter: blur(10px);
  border-radius: 14px;
  text-align: center;
  font-size: 18px;
  color: #333;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: 0.2s;
  flex: 0 1 260px;
  max-width: 260px;
}

  .dash-tile:hover {
    background: rgba(255,255,255,0.9);
    transform: translateY(-3px);
  }

/* Profile / Settings / Files / Messages (vereinheitlicht) */

.card {
  background: rgba(102, 177, 250, 0.70);
  backdrop-filter: blur(10px);
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  max-width: 700px;
  min-width: 400px;
}

.profile-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

.profile-label {
  font-weight: 600;
}

.profile-value {
  opacity: 0.8;
}

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.settings-select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(10px);
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.message-row {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(10px);
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Popups */

.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.popup-window {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  width: 420px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

/* Tabellen (modern-grid) */

.modern-grid {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  font-size: 15px;
}

  .modern-grid th {
    background: var(--accent-bg, #f3f3f3);
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    border-bottom: 1px solid #ddd;
  }

  .modern-grid td {
    padding: 10px 16px;
    border-bottom: 1px solid #eee;
  }

  .modern-grid tr:hover {
    background: rgba(0,0,0,0.06);
  }

/* Icons */

.icon {
  width: 40px;
  height: 40px;
  background-color: var(--icon-color);
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

.settings-icon {
  mask-image: url('/icons/settings.svg');
}

.person-icon {
  mask-image: url('/icons/person.svg');
}

.mail-icon {
  mask-image: url('/icons/mail.svg');
}

.folder-icon {
  mask-image: url('/icons/folder.svg');
}

/*Container*/

/* Seiten-Container für Inhalt unterhalb der Navbar */
/* --- Seiten-Boxen (Profile, Settings, Files, Messages) --- */

.content-card {
  background: rgba(102, 177, 250, 0.70);
  backdrop-filter: blur(10px);
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  min-width: 800px;
  max-width: 1000px;
  min-height: 500px;
  max-height: 800px;
  margin-bottom: 20px;
}


/* Optional: allgemeiner Page-Container, falls du ihn nutzt */
.page-container {
  min-height: 75vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
}

/* --- Einheitliche Win11-Card für alle Seiten --- */
.card {
  background: rgba(102, 177, 250, 0.70);
  backdrop-filter: blur(10px);
  padding: 20px;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin-bottom: 20px;
  max-width: 700px;
  width: 100%;
  box-sizing: border-box;
}

/* --- Pagination (Win11-Style) --- */
.pagination {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  justify-content: center;
}

  .pagination a {
    padding: 8px 14px;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    text-decoration: none;
    color: var(--fg);
    font-weight: 500;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    transition: 0.2s;
  }

    .pagination a:hover {
      background: rgba(255,255,255,0.9);
      transform: translateY(-2px);
    }

    /* Aktive Seite */
    .pagination a.active {
      background: #0078d4;
      color: white;
      font-weight: 600;
      box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    }

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: #f3f3f3;
  border-bottom: 1px solid #ddd;
}

.nav-item {
  margin-right: 50px;
  text-decoration: none;
  color: #333;
  font-weight: 500;
}

  .nav-item:hover {
    color: #0078d4;
  }

.nav-right {
  margin-left: auto; /* Schiebt alles nach rechts */
  display: flex;
  align-items: center;
  gap: 15px; /* Abstand zwischen Buttons */
}

.nav-right .logout {
  color: #b00020;
}

.nav-user {
  align-content: center;
  margin-right: 15px;
  font-weight: bold;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  margin-right: 50px;
  font-size: 20px; /* falls du ein FontAwesome/Bootstrap Icon nutzt */
  color: #333; /* optional */
  opacity: 0.85; /* Win11 Look */
  transition: opacity 0.2s ease;
}

  .nav-icon:hover {
    opacity: 1;
  }

#msgbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

#msgbox {
  background: white;
  padding: 20px 30px;
  border-radius: 12px;
  width: 350px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  text-align: center;
}

  #msgbox button {
    margin-top: 15px;
    padding: 8px 20px;
    border: none;
    background: #0078d4;
    color: white;
    border-radius: 6px;
    cursor: pointer;
  }

.mail-container {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  padding: 20px;
}

.contact-toolbar {
  height: var(--toolbar-height);
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  position: sticky;
  top: 0;
  z-index: 20;
  /* Sichtbarkeit über der Tabelle */
  background: #f5f5f5; /* oder dein Farbton */
  padding: 0; /* wichtig */ /* Win11-Style Schatten */
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.contact-list {
  max-height: 700px;
  /*max-height: calc(100vh - 40px);*/
  overflow-y: auto;
}

  .contact-list table thead th {
    position: sticky;
    top: var(--toolbar-height);
    background: #f5f5f5;
    z-index: 15;
  }

.contact-list table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.contact-list th, .contact-list td {
  padding: 8px;
  border-bottom: 1px solid #ddd;
}

.contact-row:hover {
  background: #f0f0f0;
  cursor: pointer;
}

.mail-editor label {
  display: block;
  margin-top: 10px;
  font-weight: bold;
}

.mail-editor input[type=text],
.mail-editor textarea {
  width: 100%;
  padding: 8px;
  margin-top: 5px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.mail-editor textarea {
  resize: vertical;
}

.send-btn {
  margin-top: 15px;
  padding: 10px 20px;
  background: #0078d4;
  color: white;
  border: none;
  border-radius: 6px;
}

.tb-btn {
  position: relative;
  font-family: "Segoe Fluent Icons";
  font-size: 20px;
  padding: 6px 12px;
  border: none;
  background: #e5e5e5;
  border-radius: 6px;
  cursor: pointer;
}

  .tb-btn:hover {
    background: #d0d0d0;
  }

  /* Tooltip */
  .tb-btn::after {
    font-family: "Inter", "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
    content: attr(data-tip);
    position: absolute;
    bottom: -42px;
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #0078d4;
    /* background: rgba(32, 32, 32, 0.92);*/
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    /* Win11‑like smoothness */
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    transition: opacity 0.18s ease-out, transform 0.18s ease-out;
  }

  .tb-btn:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

.tb-separator {
  width: 1px;
  height: 24px;
  background: rgba(0, 0, 0, 0.18);
  margin: 0 10px;
  align-self: center;
  border-radius: 1px;
}

.tb-group {
  display: flex;
  gap: 8px;
}

.file-popup {
  position: absolute;
  top: 60px;
  left: 20px;
  width: 260px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  padding: 10px 0;
  z-index: 200;
  animation: fadeIn 0.15s ease-out;
}

.hidden {
  display: none;
}

.file-popup-header {
  display: flex;
  justify-content: space-between;
  padding: 8px 14px;
  font-weight: 600;
  border-bottom: 1px solid #ddd;
}

.popup-close {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
}

.file-popup-list {
  max-height: 300px;
  overflow-y: auto;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.15s;
}

  .file-item:hover {
    background: #e5e5e5;
  }

.file-icon {
  font-family: "Segoe Fluent Icons";
  font-size: 18px;
}

