:root {
  --c-primary: #ffa22b;
  --c-primary-dark: #ff8c00;
  --c-bg-dark: #121212;
  --c-bg-light: #1e1e1e;
  --c-bg-lighter: #2a2a2a;
  --c-text-light: #e0e0e0;
  --c-text-dark: #121212;
  --c-text-muted: #999;
  --c-border: #333;
  --c-success: #2a9d8f;
  --c-danger: #e76f51;
  --c-info: #29b6f6;
  --border-radius: 8px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  --font-sans: "Arial", sans-serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-sans);
  background-color: var(--c-bg-dark);
  color: var(--c-text-light);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
}

a {
  color: var(--c-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover,
a:focus {
  color: var(--c-primary-dark);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

#open-ai-modal-btn{
  margin-left: 1rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 1rem 0;
  font-weight: 600;
  color: var(--c-text-light);
}

h1,
.page-head {
  font-size: 2.2rem;
  color: var(--c-primary);
  margin-bottom: 1.5rem;
}
h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
}
h3 {
  font-size: 1.4rem;
}
p {
  margin: 0 0 1rem 0;
}

ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
}

hr {
  border: none;
  border-top: 1px solid var(--c-border);
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  background-color: var(--c-bg-light);
  border-bottom: 2px solid var(--c-primary);
  padding: 0.75rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--c-primary);
}

.logo img {
  height: 45px;
}

.logo h1 {
  font-size: 1.5rem;
  margin: 0;
}

main {
  flex: 1 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--c-bg-light);
  border-top: 2px solid var(--c-primary);
  padding: 1rem 1.5rem;
  font-size: 0.9rem;
  color: var(--c-text-muted);
}

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

.nav-wrapper {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.nav-menu {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.main-nav > .main-menu {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1rem;
}

.nav-menu a,
.nav-menu .disabled {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  font-weight: bold;
  transition: color 0.2s ease;
  color: var(--c-text-light);
}

.nav-menu a:hover {
  color: var(--c-primary);
}

.nav-menu .disabled {
  color: var(--c-text-muted);
  cursor: not-allowed;
}

#campaign-select {
  background-color: var(--c-bg-lighter);
  color: var(--c-text-light);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 0.5rem;
  font-weight: bold;
}

.btn,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background-color 0.2s ease, color 0.2s ease,
    border-color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.btn:hover,
button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn:focus,
button:focus {
  outline: none;
  box-shadow: none;
}

.btn,
button,
.btn-primary {
  background-color: var(--c-primary);
  color: var(--c-text-dark);
  border-color: var(--c-primary);
}

.btn:hover,
button:hover,
.btn-primary:hover {
  background-color: var(--c-primary-dark);
  color: var(--c-text-dark);
  border-color: var(--c-primary-dark);
}

.btn-outline {
  background-color: transparent;
  color: var(--c-primary);
  border-color: var(--c-primary);
}

.btn-outline:hover,
.btn-outline.active {
  background-color: var(--c-primary);
  color: var(--c-text-dark);
}

.btn-danger {
  background-color: var(--c-danger);
  color: var(--c-text-light);
  border-color: var(--c-danger);
}

.btn-danger:hover {
  background-color: var(--c-danger);
  opacity: 0.85;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

.login-button{
  margin-top: 1rem;
  margin-bottom: 1rem;
}

form.inline-form {
  display: contents;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.form-group.checkbox-group input {
  width: auto;
  margin: 0;
  flex-shrink: 0;
}

.form-group.checkbox-group label {
  margin-bottom: 0;
  font-weight: normal;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: bold;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  margin: 0;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  background: var(--c-bg-lighter);
  color: var(--c-text-light);
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--c-primary);
}

.card {
  background: var(--c-bg-light);
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.card-grid .card {
  text-align: center;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card-grid .card h3 {
  color: var(--c-primary);
}
.card-grid .card p {
  color: var(--c-text-muted);
  margin-bottom: 0.5rem;
}
.card-grid .card .preview {
  margin: 1rem auto;
  border-radius: 6px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.card-grid .card .card-actions {
  margin-top: auto;
  padding-top: 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.card-grid .card .card-actions > * {
  width: 100%;
}

table {
  background-color: var(--c-bg-light);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
table th {
  background-color: var(--c-bg-lighter);
  color: var(--c-primary);
  text-align: left;
  padding: 1rem;
  font-size: 1rem;
  font-weight: bold;
}
table td {
  padding: 1rem;
  border-bottom: 1px solid var(--c-border);
}
table tr:last-child td {
  border-bottom: none;
}
table tbody tr:hover {
  background-color: var(--c-bg-lighter);
}
.table-auto {
  table-layout: auto;
}
.actions-cell {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-start;
  align-items: center;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--c-bg-light);
  color: var(--c-text-light);
  padding: 2rem;
  border-radius: var(--border-radius);
  width: 100%;
  max-width: 500px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 1.75rem;
  font-weight: bold;
  cursor: pointer;
  color: var(--c-text-muted);
}
.modal-close:hover {
  color: var(--c-text-light);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 1.5rem;
  gap: 0.75rem;
}

.flashes {
  list-style: none;
  padding: 0;
  margin: 0 auto 1.5rem auto;
  max-width: 1200px;
}
.flashes li {
  padding: 1rem;
  margin-bottom: 0.5rem;
  border-radius: 6px;
  font-weight: bold;
  color: var(--c-text-light);
}
.flashes .success {
  background-color: var(--c-success);
}
.flashes .danger {
  background-color: var(--c-danger);
}
.flashes .info {
  background-color: var(--c-info);
}

.grid {
  display: grid;
}
.gap-4 {
  gap: 1rem;
}
.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}
.mb-2 {
  margin-bottom: 0.5rem;
}
.mb-3 {
  margin-bottom: 1.5rem;
}
.mb-4 {
  margin-bottom: 1rem;
}
.mb-6 {
  margin-bottom: 1.5rem;
}
.mb-8 {
  margin-bottom: 2rem;
}
.mt-1 {
  margin-top: 0.25rem;
}
.mt-2 {
  margin-top: 0.5rem;
}
.mt-4 {
  margin-top: 1rem;
}
.my-6 {
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
}
.p-4 {
  padding: 1rem;
}
.w-full {
  width: 100%;
}
.space-y-4 > * + * {
  margin-top: 1rem;
}
.flex {
  display: flex;
}
.items-center {
  align-items: center;
}
.space-x-2 > * + * {
  margin-left: 0.5rem;
}
.text-center {
  text-align: center;
}
.font-bold {
  font-weight: bold;
}
.text-3xl {
  font-size: 1.875rem;
}
.text-xl {
  font-size: 1.25rem;
}
.text-sm {
  font-size: 0.875rem;
}
.text-yellow-500 {
  color: var(--c-primary);
}
.text-gray-500 {
  color: var(--c-text-muted);
}
.text-gray-600 {
  color: #b0b0b0;
}
.text-blue-600 {
  color: var(--c-info);
}
.hover\:underline:hover {
  text-decoration: underline;
}
.shadow {
  box-shadow: var(--shadow);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}
.stat-card {
  background-color: var(--c-bg-light);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}
.stat-card .icon {
  font-size: 2.5rem;
  color: var(--c-primary);
  margin-bottom: 1rem;
}
.stat-card .value {
  font-size: 2.2rem;
  font-weight: bold;
}
.stat-card .label {
  color: var(--c-text-muted);
}
.doughnut-chart {
  --size: 150px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background-image: conic-gradient(
    var(--c-success) 0deg 120deg,
    var(--c-danger) 120deg 190deg,
    var(--c-info) 190deg 360deg
  );
  position: relative;
  margin: 1rem auto;
}
.doughnut-chart::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 65%;
  height: 65%;
  background: var(--c-bg-light);
  border-radius: 50%;
}

.email-list > li {
  background-color: var(--c-bg-light);
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.email-header {
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background-color: var(--c-bg-lighter);
}
.email-header:hover {
  background-color: #383838;
}
.email-details {
  padding: 1.5rem;
  border-top: 1px solid var(--c-border);
  display: none;
}
.email-list > li.open .email-details {
  display: block;
}
.email-header .arrow {
  transition: transform 0.3s ease;
}
.email-list > li.open .email-header .arrow {
  transform: rotate(90deg);
}

.home-content {
  text-align: center;
}
.home-content h2 {
  margin-top: 2em;
}
.home-content ul {
  list-style: disc;
  display: inline-block;
  text-align: left;
  margin-top: 1em;
}

@media (min-width: 640px) {
  .sm\:grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }
  /* KORREKTUR: Fehlende Klasse für 3 Spalten hinzugefügt */
  .sm\:grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  h1,
  .page-head {
    font-size: 1.8rem;
  }
  h2 {
    font-size: 1.5rem;
  }

  .source-item {
    margin-left: 1rem;
}

  header {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  .nav-wrapper {
    width: 100%;
    justify-content: center;
  }
  .nav-menu {
    justify-content: center;
    gap: 1rem;
    width: 100%;
  }
  .main-nav > .main-menu {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
  #campaign-select {
    max-width: 300px;
    width: 100%;
  }

  table,
  .table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .modal-content {
    padding: 1.5rem;
  }
}
