/* ============================================================
   Outlook Web Style — ina-herzog.com
   MOBILE-FIRST: Basisstyles für Mobile, erweitert per min-width
   Breakpoints:
     640px  → Tablet  (Nav-Rail, kein Bottom-Nav)
     900px  → Desktop (Nachrichtenliste)
    1100px  → Wide    (Ordnerbereich)
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
}

/* ===== BASE: MOBILE ===== */

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', sans-serif;
  font-size: 14px;
  color: #242424;
  background: #ffffff;
  /* Mobile: body scrollt, kein overflow-clip */
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* ===== SUITE BAR ===== */

.suite-bar {
  height: 48px;
  background: #0078d4;
  display: flex;
  align-items: center;
  padding: 0 8px;
  gap: 4px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 200;
}

.suite-icon-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}
.suite-icon-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.suite-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  color: white;
  font-size: 15px;
  font-weight: 600;
  padding: 0 6px 0 2px;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

/* Suchleiste: auf Mobile versteckt */
.suite-search {
  display: none;
  flex: 1;
  max-width: 540px;
  margin: 0 auto;
}
.suite-search input {
  width: 100%;
  height: 32px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid transparent;
  border-radius: 4px;
  color: white;
  font-size: 14px;
  padding: 0 12px;
  outline: none;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.suite-search input::placeholder { color: rgba(255, 255, 255, 0.72); }
.suite-search input:focus {
  background: white;
  color: #242424;
  border-color: #005a9e;
}
.suite-search input:focus::placeholder { color: #a19f9d; }

.suite-right {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-shrink: 0;
}

.suite-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #8764b8;
  color: white;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* ===== APP-BODY (Mobile: einfacher Block-Flow) ===== */

.app-body {
  display: flex;
  flex: 1;
}

/* ===== LINKE NAV-LEISTE: Mobile versteckt ===== */

.nav-rail {
  display: none;
  width: 48px;
  background: #1b1a19;
  flex-direction: column;
  align-items: center;
  padding: 4px 0;
  flex-shrink: 0;
}

.nav-btn {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 2px;
  position: relative;
  text-decoration: none;
  border: none;
  background: transparent;
  transition: background 0.1s, color 0.1s;
}
.nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}
.nav-btn.active { color: white; }
.nav-btn.active::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: #0078d4;
  border-radius: 0 2px 2px 0;
}
.nav-rail-spacer { flex: 1; }

/* ===== ORDNERBEREICH: Mobile versteckt ===== */

.folder-pane {
  display: none;
  width: 220px;
  flex-shrink: 0;
  background: #faf9f8;
  border-right: 1px solid #e1dfdd;
  flex-direction: column;
  overflow: hidden;
}

.folder-header {
  padding: 16px 12px 10px;
  font-size: 18px;
  font-weight: 700;
  color: #242424;
  flex-shrink: 0;
}

.new-mail-btn {
  margin: 0 8px 12px;
  height: 32px;
  background: #0078d4;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  flex-shrink: 0;
  transition: background 0.1s;
}
.new-mail-btn:hover { background: #106ebe; }

.folder-list {
  overflow-y: auto;
  flex: 1;
  padding: 2px 0 8px;
}

.folder-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 14px;
  color: #242424;
  border-radius: 4px;
  margin: 0 4px;
  text-decoration: none;
  transition: background 0.1s;
}
.folder-item:hover { background: #f3f2f1; color: #242424; }
.folder-item.active { background: #deecf9; font-weight: 600; color: #0d3f70; }
.folder-item svg { flex-shrink: 0; opacity: 0.65; }
.folder-item.active svg { opacity: 1; }

.folder-badge {
  margin-left: auto;
  font-size: 12px;
  font-weight: 700;
  color: #0078d4;
}

.folder-section-label {
  font-size: 11px;
  font-weight: 600;
  color: #a19f9d;
  padding: 12px 16px 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ===== INHALTSBEREICH ===== */

.content-area {
  flex: 1;
  display: flex;
  min-width: 0;
}

/* ===== NACHRICHTENLISTE: Mobile versteckt ===== */

.msg-list {
  display: none;
  width: 348px;
  flex-shrink: 0;
  background: #ffffff;
  border-right: 1px solid #e1dfdd;
  flex-direction: column;
  overflow: hidden;
}

.msg-list-header {
  padding: 10px 16px 8px;
  border-bottom: 1px solid #f3f2f1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.msg-list-title { font-size: 18px; font-weight: 700; color: #242424; }
.msg-list-subtitle { font-size: 12px; color: #616161; }

.msg-list-filter {
  display: flex;
  align-items: center;
  padding: 4px 12px;
  gap: 4px;
  border-bottom: 1px solid #f3f2f1;
  flex-shrink: 0;
}
.filter-pill {
  height: 24px;
  padding: 0 10px;
  border: 1px solid #e1dfdd;
  border-radius: 12px;
  font-size: 12px;
  cursor: pointer;
  background: white;
  color: #242424;
  font-family: inherit;
  display: flex;
  align-items: center;
}
.filter-pill.active {
  background: #deecf9;
  border-color: #c7e0f4;
  color: #0d3f70;
  font-weight: 600;
}

.msg-items { overflow-y: auto; flex: 1; }

.msg-item {
  padding: 12px 16px;
  border-bottom: 1px solid #f3f2f1;
  cursor: pointer;
  display: flex;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  align-items: flex-start;
  position: relative;
  transition: background 0.1s;
}
.msg-item:hover { background: #f3f2f1; }
.msg-item.active { background: #deecf9; }
.msg-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: #0078d4;
}

.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  margin-top: 1px;
}

.msg-body { flex: 1; min-width: 0; }
.msg-sender-name { font-size: 14px; font-weight: 600; color: #242424; margin-bottom: 1px; }
.msg-subject { font-size: 13px; color: #242424; margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-preview { font-size: 12px; color: #616161; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-item.active .msg-sender-name,
.msg-item.active .msg-subject { color: #0d3f70; }

.msg-meta { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; gap: 4px; }
.msg-time { font-size: 11px; color: #616161; white-space: nowrap; }
.msg-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: #0078d4; }

/* ===== LESEBEREICH: Mobile = volle Breite, body scrollt ===== */

.reading-pane {
  flex: 1;
  background: #ffffff;
  min-width: 0;
  /* Mobile: kein eigenes overflow, body übernimmt scroll */
  padding-bottom: 64px; /* Platz für Bottom-Nav */
}

.rp-toolbar {
  padding: 8px 16px;
  border-bottom: 1px solid #f3f2f1;
  display: flex;
  align-items: center;
  gap: 4px;
  position: sticky;
  top: 48px; /* unter suite-bar */
  background: white;
  z-index: 100;
}

.rp-btn {
  height: 30px;
  padding: 0 10px;
  background: white;
  color: #242424;
  border: 1px solid #e1dfdd;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  transition: background 0.1s, border-color 0.1s;
  white-space: nowrap;
}
.rp-btn:hover { background: #f3f2f1; border-color: #c8c6c4; color: #242424; }

.rp-content {
  padding: 20px 16px;
  flex: 1;
}

.rp-subject {
  font-size: 20px;
  font-weight: 300;
  color: #242424;
  margin-bottom: 16px;
  line-height: 1.3;
}

.rp-from-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.rp-from-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.rp-from-info { flex: 1; }
.rp-from-name { font-size: 14px; font-weight: 600; color: #242424; line-height: 1.4; }
.rp-from-addr { font-size: 12px; color: #616161; }
.rp-date { font-size: 12px; color: #616161; flex-shrink: 0; }

.rp-divider { border: none; border-top: 1px solid #e1dfdd; margin: 16px 0 20px; }

.rp-body { font-size: 14px; line-height: 1.75; color: #242424; }
.rp-body p { margin-bottom: 14px; }
.rp-body a { color: #0078d4; text-decoration: none; }
.rp-body a:hover { text-decoration: underline; }
.rp-body strong { font-weight: 600; }

.rp-logo {
  max-width: 100%;
  width: 320px;
  height: auto;
  margin-bottom: 20px;
  display: block;
}

/* Kontaktkarte */
.contact-card {
  background: #faf9f8;
  border: 1px solid #e1dfdd;
  border-radius: 4px;
  padding: 14px 16px;
  display: block; /* volle Breite auf Mobile */
  margin: 4px 0 20px;
}
.contact-card table { border-collapse: collapse; width: 100%; }
.contact-card td { padding: 5px 10px 5px 0; vertical-align: top; font-size: 14px; }
.contact-card td:first-child {
  color: #616161;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  min-width: 66px;
  padding-top: 6px;
}

/* Impressum-Abschnitte */
.imprint-section { margin-bottom: 20px; }
.imprint-section h3 {
  font-size: 11px;
  font-weight: 600;
  color: #616161;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.imprint-section p { margin-bottom: 4px; }

/* ===== BOTTOM NAVIGATION (nur Mobile) ===== */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #1b1a19;
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 300;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  font-size: 10px;
  padding: 6px 14px;
  border-radius: 8px;
  position: relative;
  transition: color 0.1s;
}
.bottom-nav-item:hover { color: rgba(255,255,255,0.85); }
.bottom-nav-item.active { color: white; }
.bottom-nav-item.active svg { /* leichter Highlight */
  filter: drop-shadow(0 0 4px rgba(0,120,212,0.7));
}
.bottom-nav-badge {
  position: absolute;
  top: 4px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0078d4;
  border: 1px solid #1b1a19;
}

/* ===================================================
   TABLET: min-width 640px
   - Suite-Bar: Suchleiste erscheint
   - Nav-Rail erscheint
   - Body: overflow hidden (App-Modus)
   - Reading-Pane: eigener Scroll
   - Bottom-Nav: verschwindet
   =================================================== */

@media (min-width: 640px) {
  body {
    height: 100%;
    overflow: hidden;
  }

  .suite-search { display: block; }

  .app-body {
    overflow: hidden;
    min-height: 0;
    flex: 1;
  }

  .nav-rail { display: flex; }

  .content-area { overflow: hidden; }

  .reading-pane {
    overflow-y: auto;
    padding-bottom: 0;
  }

  .rp-content { padding: 24px 28px; }

  .rp-subject { font-size: 22px; }

  .rp-toolbar { padding: 8px 28px; top: 48px; }

  .contact-card { display: inline-block; }

  .bottom-nav { display: none; }
}

/* ===================================================
   DESKTOP: min-width 900px
   - Nachrichtenliste erscheint (348px)
   =================================================== */

@media (min-width: 900px) {
  .msg-list { display: flex; }
}

/* ===================================================
   WIDE DESKTOP: min-width 1100px
   - Ordnerbereich erscheint (220px)
   =================================================== */

@media (min-width: 1100px) {
  .folder-pane { display: flex; }

  .rp-content { padding: 28px 36px; }

  .rp-subject { font-size: 24px; }
}
