
/* styles.css */

/* Design-Variablen: hell/dunkel */
:root {
  --bg: #F7F8FA;
  --text: #1F2937;
  --muted: #6B7280;
  --card: #FFFFFF;
  --border: #E5E7EB;
  --shadow: 0 6px 14px rgba(17, 24, 39, 0.08);
  --radius: 10px;
  --gap: 8px;
  --accent: #2563EB; /* Standard Blau */
}

:root.dark {
  --bg: #0F172A;         /* Slate 900 */
  --text: #E5E7EB;       /* Grau 200 */
  --muted: #9CA3AF;      /* Grau 400 */
  --card: #111827;       /* Grau 900 */
  --border: #374151;     /* Grau 700 */
  --shadow: 0 6px 14px rgba(0, 0, 0, 0.6);
  --accent: #3B82F6; /* Helles Blau für Dark Mode */
}

/* Farbschemata */
:root.color-blue {
  --accent: #2563EB;
}
:root.color-blue.dark {
  --accent: #3B82F6;
  --bg: #0F172A;
  --card: #1E293B;
}

:root.color-green {
  --accent: #16A34A;
}
:root.color-green.dark {
  --accent: #22C55E;
  --bg: #0F1F15;
  --card: #1A2E22;
}

:root.color-red {
  --accent: #DC2626;
}
:root.color-red.dark {
  --accent: #EF4444;
  --bg: #1F0F0F;
  --card: #2E1A1A;
}

:root.color-purple {
  --accent: #9333EA;
}
:root.color-purple.dark {
  --accent: #A855F7;
  --bg: #1A0F1F;
  --card: #2A1A2E;
}

:root.color-orange {
  --accent: #EA580C;
}
:root.color-orange.dark {
  --accent: #F97316;
  --bg: #1F150F;
  --card: #2E221A;
}

/* Grundsetup */
html, body { 
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  margin: 0;
  padding: 0;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  display: flex;
  flex-direction: column;
}

/* Container */
.container {
  max-width: 1280px;
  margin: 24px auto 64px;
  padding: 0 16px;
}

/* Main mit voller Breite für Grid */
.main-fullwidth {
  width: 100%;
  height: calc(100vh - 220px); /* Volle Höhe minus Topbar */
  margin: 0;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Gemeinsame Card-/Flächen-Styles */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Top-Bar mit Hamburger-Menü */
.topbar {
  position: relative;
  top: 0;
  z-index: 1000;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  height: 220px;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  height: 220px;
  box-sizing: border-box;
}

/* Hamburger-Button (3 Striche) */
.hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
}
.hamburger:hover {
  background: rgba(127,127,127,0.08);
}
.hamburger .bar {
  width: 20px;
  height: 2px;
  background: var(--text);
  display: block;
  margin: 3px 0;
}

/* Menü-Panel (Dropdown/Offcanvas‑ähnlich) */
.menu-panel {
  position: absolute;
  right: 16px;
  top: 220px;
  min-width: 220px;
  padding: 10px;
  display: none;
}
.menu-panel.open { display: block; }
.menu-title {
  font-weight: 600;
  margin-bottom: 8px;
}
.menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  transition: background 150ms ease;
}
.menu-item:hover {
  background: rgba(127, 127, 127, 0.08);
}
.menu-item a {
  text-decoration: none;
  color: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.menu-item + .menu-item { margin-top: 8px; }

/* Toggle-Schalter (hell/dunkel) */
.switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 999px;
  cursor: pointer;
}
.switch .knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--card);
  box-shadow: var(--shadow);
  transition: left 160ms ease;
}
.switch.active .knob { left: 22px; }

/* Grid 9 × 2 */
.grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: var(--gap);
  padding: 16px;
  width: 100%;
  height: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
.cell {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px;
  min-height: 0;
  min-width: 0;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
  overflow: hidden;
}
.cell:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.12);
  border-color: #D1D5DB;
}

/* Inhalte in Zellen */
.visual { 
  width: 70%; 
  height: 60%; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  margin-bottom: 6px; 
}
.visual img { 
  max-width: 100%; 
  max-height: 100%; 
  object-fit: contain; 
}
.label { font-size: 13px; color: var(--text); }

/* Responsive: weniger Spalten bei schmalen Viewports */
@media (max-width: 1024px) { .grid { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 720px)  { .grid { grid-template-columns: repeat(3, 1fr); } }

/* Calculator spezifisch */
.calc-wrap { max-width: 360px; margin: 32px auto; }
.calc-display {
  font-size: 24px;
  text-align: right;
  letter-spacing: .5px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  min-height: 58px;
  overflow-x: auto;
}
.calc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 12px;
}
.calc-btn {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  transition: all 120ms ease;
  font-size: 16px;
  color: var(--text);
}
.calc-btn:hover { background: rgba(127,127,127,0.08); }
.calc-btn.op {
  background: #2563EB;
  color: #fff;
  border-color: #1D4ED8;
}
.calc-btn.op:hover { background: #1D4ED8; }
.calc-btn.eq {
  background: #22C55E;
  color: #fff;
  border-color: #16A34A;
}
.calc-btn.eq:hover { background: #16A34A; }
.calc-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

/*emailer*/
    /* Das Herzstück: Ein echtes 6-Spalten-Grid */
    .tabtu-grid {
        display: grid;
        grid-template-columns: repeat(6, 1fr); /* Genau 6 Spalten */
        gap: 15px; /* Abstand zwischen den Kacheln */
        padding: 15px;
    }

    .mail-tile {
        height: 180px; /* Feste Höhe für alle Kacheln */
        display: flex;
        flex-direction: column;
        border-radius: 12px;
        overflow: hidden;
        background: white;
        transition: transform 0.2s;
    }

    .mail-tile:hover {
        transform: scale(1.02);
    }

    .mail-body-preview {
        flex-grow: 1;
        overflow: hidden;
        line-height: 1.2;
        font-size: 0.85rem;
    }


    /* Das sorgt dafür, dass das Menü erscheint */
#menuPanel.open {
    display: block !important;
    visibility: visible !important;
}

.w3-modal {
    padding-top: 50px;
}
.w3-modal-content {
    margin: auto;
    width: 80%;
    max-width: 800px;
    box-shadow: var(--shadow);
}