/* === VARIABLES === */
:root {
  --color-bg: #f7f7f7;
  --color-bg-light: #fff;
  --color-primary: #6c63ff;
  --color-primary-dark: #574fd6;
  --color-danger: #f44336;
  --color-danger-dark: #b71c1c;
  --color-text: #333;
  --radius: 12px;
  --shadow: 0 0 20px rgba(0, 0, 0, 0.05);
  --font-base: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

/* === GLOBAL === */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: var(--font-base);
  background-color: var(--color-bg);
  color: var(--color-text);
  overflow-x: hidden;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}
body > main {
  flex: 1;
}

/* === HEADER === */
.hero-section {
  text-align: center;
  padding: 80px 20px;
  background: linear-gradient(135deg, #6c63ff, #63a4ff);
  color: white;
}

.hero-section h1 {
  font-size: 3rem;
}

.hero-section p {
  font-size: 1.25rem;
}

/* === BUTTONS === */
.btn,
.cta-button {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  text-align: center;
}

.btn-primary,
.cta-button {
  background: var(--color-primary);
  color: white;
}

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

.btn-light {
  background: #eee;
  color: var(--color-text);
}

.btn-light:hover {
  background: #e0e0e0;
}

.btn-danger {
  background: var(--color-danger);
  color: white;
}

.btn-danger:hover {
  background: var(--color-danger-dark);
}

/* === CONTAINERS === */
.section-box {
  max-width: 700px;
  margin: 20px auto;
  background-color: var(--color-bg-light);
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* === IMAGE === */
.app-screenshot {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin-top: 20px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* === FORM / LOGIN === */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 70vh;
  padding: 20px;
}

.login-wrapper {
  max-width: 400px;
  width: 100%;
  background: white;
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.login-wrapper input {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  box-sizing: border-box;
}

.login-wrapper button {
  width: 100%;
  padding: 12px;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

.login-wrapper button:hover {
  background: var(--color-primary-dark);
}

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

.form-control {
  width: 100%;
  max-width: 400px;
  /* maximale Breite */
  margin: 0 auto;
  /* zentriert innerhalb des Elternelements */
  padding: 0.6rem 0.8rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 10px;
  background-color: #fff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: border-color 0.3s, box-shadow 0.3s;
  display: block;
}

.form-control:focus {
  outline: none;
  border-color: #6a5acd;
  box-shadow: 0 0 0 3px rgba(106, 90, 205, 0.2);
}

.error-box {
  background-color: #ffe0e0;
  color: #a00;
  padding: 10px;
  margin-bottom: 15px;
  border-radius: 6px;
}

/* === DASHBOARD === */
.dashboard-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.dashboard-buttons a {
  min-width: 160px;
}

.dashboard-buttons form {
  display: inline-block;
}


/* === TABLE === */
.material-table {
  width: 100%;
  border-collapse: collapse;
}

.material-table th,
.material-table td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.material-table th {
  background-color: #f0f0f0;
}

/* === SEARCH === */
#materialSearch {
  width: 100%;
  padding: 8px;
  margin: 10px 0 20px 0;
  font-size: 1rem;
}

/* === MODAL === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-box {
  background: white;
  padding: 24px;
  border-radius: var(--radius);
  max-width: 95%;
  box-shadow: var(--shadow);
}

.modal-box input,
.modal-box select {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
}

.button-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  margin-bottom: 30px;
}

.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.inline-form {
  display: inline;
}

/* === FOOTER === */
.footer {
  text-align: center;
  padding: 20px;
  font-size: 0.9rem;
  background-color: #eee;
  color: #555;
}

.footer a {
  margin: 0 10px;
  color: #555;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.member-table-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.member-table {
  width: 100%;
  max-width: 500px;
  border-collapse: collapse;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.member-table th,
.member-table td {
  padding: 12px 16px;
  text-align: center;
}

.member-table thead {
  background: #f7f7f7;
  font-weight: bold;
}

.member-table tbody tr:nth-child(even) {
  background-color: #fafafa;
}

.member-table button.btn-small {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  font-size: 1.1rem;
  transition: background 0.2s;
  border-radius: 50%;
}

.member-table button.btn-small:hover {
  background: #ffe6e6;
}

.slide-toggle {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  opacity: 0;
}

.slide-toggle.open {
  max-height: 1000px;
  /* ausreichend groß wählen */
  opacity: 1;
}

.expense-entry {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  padding: 16px;
  margin: 12px auto;
  max-width: 600px;
  text-align: left;
}

.table-container {
  overflow-x: auto;
  width: 100%;
}

.card-entry {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  padding: 15px 20px;
  margin: 15px 0;
  border-left: 5px solid #5c6ac4;
}

.card-entry strong {
  font-size: 1.1em;
}

.card-entry form {
  margin-top: 10px;
}

.user-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.group-section h2 {
  margin-bottom: 15px;
}

.group-buttons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}

.btn-group-card {
  background: white;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 1rem 1.5rem;
  min-width: 160px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
}

.btn-group-card:hover {
  transform: translateY(-3px);
  background: #f0f0f0;
}

/* === GROUP CARDS === */
.group-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
}

.group-card {
  background: white;
  border-radius: 12px;
  width: 140px;
  padding: 16px 12px;
  text-align: center;
  text-decoration: none;
  color: var(--color-text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
}

.group-card:hover {
  transform: translateY(-4px);
  background-color: #f9f9f9;
}

.group-image {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  /* bisher 8px */
  object-fit: cover;
  margin-bottom: 10px;
  border: 2px solid #ddd;
}

.group-placeholder {
  width: 100%;
  height: 120px;
  background-color: #f3f4f6;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: #9ca3af;
}

.group-name {
  font-weight: 600;
  font-size: 1rem;
  word-break: break-word;
}

.done {
  text-decoration: line-through;
  color: #999;
  opacity: 0.6;
}

/* === RESPONSIVE === */
@media (max-width: 700px) {
  .dashboard-buttons {
    flex-direction: column;
    align-items: center;
  }

  .dashboard-buttons form,
  .dashboard-buttons a,
  .dashboard-buttons button {
    width: auto;
  }

  .hero-section h1 {
    font-size: 2.2rem;
  }

  .hero-section p {
    font-size: 1.1rem;
  }

  .login-wrapper {
    padding: 20px;
  }
}