/* Autor: Marc Herdina */
/* Autor: Lukas Schmidt */
/* Autor: Manuel Fina */
/* Autor: Benjamin Reng */


:root {
  --md-sys-color-primary: #6750a4;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #eaddff;
  --md-sys-color-on-primary-container: #21005d;
  --md-sys-color-primary-variant: #8a6bb1;
  --md-sys-color-secondary: #625b71;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #e8def8;
  --md-sys-color-on-secondary-container: #1d192b;
  --md-sys-color-tertiary: #7d5260;
  --md-sys-color-on-tertiary: #ffffff;
  --md-sys-color-tertiary-container: #ffd8e4;
  --md-sys-color-on-tertiary-container: #31111d;
  --md-sys-color-error: #b3261e;
  --md-sys-color-error-hover: #911e18;
  --md-sys-color-on-error: #ffffff;
  --md-sys-color-error-container: #f9dedc;
  --md-sys-color-on-error-container: #410e0b;
  --md-sys-color-background: #fffbfe;
  --md-sys-color-on-background: #1c1b1f;
  --md-sys-color-surface: #fffbfe;
  --md-sys-color-on-surface: #1c1b1f;
  --md-sys-color-surface-variant: #e7e0ec;
  --md-sys-color-on-surface-variant: #49454f;
  --md-sys-color-surface-container-low: #f7f2fa;
  --md-sys-color-surface-container-high: #ece6f0;
  --md-sys-color-outline: #79747e;
  --md-sys-color-shadow: #000000;
  --md-sys-color-inverse-surface: #313033;
  --md-sys-color-inverse-on-surface: #f4eff4;
  --md-sys-color-inverse-primary: #d0bcff;
}

body {
  font-family: "Roboto", sans-serif;
  background-color: var(--md-sys-color-background);
  color: var(--md-sys-color-on-background);
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  color: var(--md-sys-color-on-background);
  margin-top: 1.5em;
  margin-bottom: 0.75em;
}

header {
  background-color: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface-variant);
  padding: 1rem 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem; /* Increased gap */
}

header .logo-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

header h1 a {
  text-decoration: none;
  color: var(--md-sys-color-primary);
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

nav ul li a {
  text-decoration: none;
  color: var(--md-sys-color-on-surface-variant);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0;
}

nav ul li a .material-icons {
  font-size: 1.1rem;
}

nav ul li a:hover,
nav ul li a.active {
  color: var(--md-sys-color-primary);
}

.header-search {
  display: flex;
  align-items: center;
  flex-grow: 1;
  max-width: 400px;
}

.header-search input[type="text"] {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--md-sys-color-outline);
  border-right: none;
  border-radius: 4px 0 0 4px;
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  flex-grow: 1;
}

.header-search button {
  padding: 0.5rem 0.75rem;
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border: 1px solid var(--md-sys-color-primary);
  border-radius: 0 4px 4px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-search button .material-icons {
  font-size: 1.2rem;
  padding: 0;
  margin: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-actions .user-greeting {
  font-size: 0.9rem;
  white-space: nowrap;
}

.header-actions a {
  white-space: nowrap;
}

#theme-toggle {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border: none;
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

#theme-toggle .material-icons {
  font-size: 1.25rem;
}

.container {
  flex: 1;
  padding: 20px 30px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

footer {
  background-color: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface-variant);
  text-align: center;
  padding: 1.5rem 1rem;
  margin-top: auto;
}

body.dark-theme {
  --md-sys-color-primary: #d0bcff;
  --md-sys-color-on-primary: #381e72;
  --md-sys-color-primary-container: #4f378b;
  --md-sys-color-on-primary-container: #eaddff;
  --md-sys-color-primary-variant: #b8a7e0;
  --md-sys-color-secondary: #ccc2dc;
  --md-sys-color-on-secondary: #332d41;
  --md-sys-color-secondary-container: #4a4458;
  --md-sys-color-on-secondary-container: #e8def8;
  --md-sys-color-tertiary: #efb8c8;
  --md-sys-color-on-tertiary: #492532;
  --md-sys-color-tertiary-container: #633b48;
  --md-sys-color-on-tertiary-container: #ffd8e4;
  --md-sys-color-error: #f2b8b5;
  --md-sys-color-on-error: #601410;
  --md-sys-color-error-container: #8c1d18;
  --md-sys-color-on-error-container: #f9dedc;
  --md-sys-color-background: #1c1b1f;
  --md-sys-color-on-background: #e6e1e5;
  --md-sys-color-surface: #1c1b1f;
  --md-sys-color-on-surface: #e6e1e5;
  --md-sys-color-surface-variant: #49454f;
  --md-sys-color-on-surface-variant: #cac4d0;
  --md-sys-color-surface-container-low: #211f26;
  --md-sys-color-surface-container-high: #2b2930;
  --md-sys-color-outline: #938f99;
  --md-sys-color-inverse-surface: #e6e1e5;
  --md-sys-color-inverse-on-surface: #313033;
  --md-sys-color-inverse-primary: #6750a4;
}

@media (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: stretch;
  }

  .logo-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
  }

  header h1 {
    text-align: center;
  }

  nav ul {
    flex-direction: column;
    align-items: stretch;
  }

  nav ul li {
    margin-bottom: 0.5rem;
  }

  nav ul li a {
    display: block;
    text-align: center;
  }

  .header-search {
    order: 3;
    margin-top: 0.5rem;
    width: 100%;
    max-width: none;
  }

  .header-actions {
    order: 2;
    justify-content: space-between;
    width: 100%;
  }
}

@media (max-width: 480px) {
  nav ul li a {
    font-size: 0.85rem;
  }

  nav ul li a .material-icons {
    font-size: 1rem;
  }

  .header-search input[type="text"] {
    padding: 0.4rem 0.6rem;
  }

  .header-search button {
    padding: 0.4rem 0.6rem;
  }

  .header-actions {
    gap: 0.5rem;
  }

  .header-actions a,
  .header-actions .user-greeting {
    font-size: 0.85rem;
  }
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.product-card {
  border: 1px solid var(--md-sys-color-outline);
  padding: 1rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.product-card:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-5px);
}

.product-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #fff;
  border-radius: 5px;
}

.product-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Allgemeine Formularstile */
form label {
  display: block;
  margin-bottom: 5px;
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form textarea {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 6px;
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

form button {
  padding: 10px 20px;
  color: var(--md-sys-color-on-primary);
  background-color: var(--md-sys-color-primary);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s ease-in-out, transform 0.1s ease,
    box-shadow 0.2s ease-in-out;
  height: 43px;
}

form button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

form button:active {
  transform: translateY(0);
}

.btn-primary {
  text-decoration: none;
  padding: 10px 20px;
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border-radius: 6px;
  cursor: pointer;
  display: inline-block;
  font-weight: 500;
  transition: background-color 0.2s ease-in-out, transform 0.1s ease,
    box-shadow 0.2s ease-in-out;
  width: 9vw;
  text-align: center;
}

.btn-primary:hover {
  background-color: var(--md-sys-color-primary-variant);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  text-decoration: none;
  width: 7vw;
  padding: 10px 20px;
  background-color: var(--md-sys-color-secondary);
  color: var(--md-sys-color-on-secondary);
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: inline-block;
  font-weight: 500;
  transition: background-color 0.2s ease-in-out, transform 0.1s ease,
    box-shadow 0.2s ease-in-out;
  height: 41px;
}

.btn-secondary:hover {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn-secondary-container {
  text-decoration: none;
  padding: 10px 20px;
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: inline-block;
  font-weight: 500;
  transition: background-color 0.2s ease-in-out, transform 0.1s ease,
    box-shadow 0.2s ease-in-out;
}

.btn-secondary-container:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-secondary-container:active {
  transform: translateY(0);
}

.btn-error {
  text-decoration: none;
  padding: 10px 20px;
  background-color: var(--md-sys-color-error);
  color: var(--md-sys-color-on-error);
  border-radius: 6px;
  border: none;
  cursor: pointer;
  display: inline-block;
  font-weight: 500;
  transition: background-color 0.2s ease-in-out, transform 0.1s ease,
    box-shadow 0.2s ease-in-out;
  height: 43px;
}

.btn-error:hover {
  background-color: var(--md-sys-color-error-hover);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-error:active {
  transform: translateY(0);
}

.btn-small {
  padding: 6px 12px;
  font-weight: 500;
  border-radius: 6px;
}

.margin-bottom {
  margin-bottom: 15px;
}

.margin-bottom-small {
  margin-bottom: 5px;
}

.margin-bottom-large {
  margin-bottom: 20px;
}

.margin-top {
  margin-top: 20px;
}

.margin-top-large {
  margin-top: 30px;
}

.padding {
  padding: 10px;
}

.form-container {
  max-width: 600px;
  margin: auto;
  padding: 20px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 5px;
  background-color: var(--md-sys-color-surface-container-low);
  box-sizing: border-box;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 6px;
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.table-full-width {
  width: 100%;
  border-collapse: collapse;
}

.table-header {
  border-bottom: 2px solid var(--md-sys-color-outline);
}

.table-row {
  border-bottom: 1px solid var(--md-sys-color-surface-variant);
}

.table-cell {
  padding: 10px;
  text-align: left;
}

.table-cell-center {
  padding: 10px;
  text-align: center;
}

.table-cell-nowrap {
  padding: 10px;
  text-align: center;
  white-space: nowrap;
}

/* Hilfsklassen */
.text-center {
  text-align: center;
}

.text-small {
  font-size: 0.9em;
  color: var(--md-sys-color-on-surface-variant);
}

.text-tiny {
  font-size: 0.8em;
  color: var(--md-sys-color-on-surface-variant);
}

.search-container {
  display: flex;
  justify-content: center;
  width: 100%;
}

.search-button {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border: none;
  padding: 10px 15px;
  border-radius: 4px;
  cursor: pointer;
  height: 33px;
}

/* Bildstile */
.img-thumbnail {
  max-width: 150px;
  max-height: 150px;
  border-radius: 4px;
  border: 1px solid var(--md-sys-color-outline);
}

.form-inline {
  display: inline;
}

.auth-form-container {
  max-width: 400px;
  margin: 50px auto;
  padding: 20px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 8px;
  background-color: var(--md-sys-color-surface-variant);
}

.auth-form-title {
  text-align: center;
  color: var(--md-sys-color-primary);
  margin-bottom: 20px;
  font-size: 1.5rem;
  font-weight: 600;
}

.auth-form {
  width: 100%;
}

.form-group {
  margin-bottom: 15px;
}

.form-group:last-of-type,
.form-group-last {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
}

.form-label-optional {
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 400;
}

.form-input:focus {
  outline: none;
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 2px var(--md-sys-color-primary-container);
}

.form-help {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.3;
}

.auth-submit-btn {
  width: 100%;
  padding: 10px;
  font-size: 16px;
  font-weight: 500;
  border-radius: 4px;
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border: none;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.auth-submit-btn:hover {
  transform: translateY(-1px);
}

.auth-submit-btn:active {
  transform: translateY(0);
}

.auth-link-text {
  text-align: center;
  margin-top: 20px;
  color: var(--md-sys-color-on-surface);
  font-size: 14px;
}

.auth-link {
  color: var(--md-sys-color-primary);
  text-decoration: underline;
  transition: color 0.2s ease;
}

.auth-link:hover {
  color: var(--md-sys-color-primary-variant);
  text-decoration: none;
}

.newsletter-section {
  margin-top: 15px;
}

.newsletter-title {
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 1.1rem;
}

.newsletter-form {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.newsletter-email-input {
  padding: 8px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: 4px;
  min-width: 200px;
  flex-grow: 1;
  max-width: 300px;
}

.newsletter-submit-btn {
  padding: 8px 15px;
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}

.newsletter-submit-btn:hover {
  background-color: #1565c0;
}

/* Sweepstake Checkbox Styles */
.sweepstake-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.sweepstake-checkbox {
  margin-right: 5px;
  accent-color: var(--md-sys-color-primary);
}

.sweepstake-label {
  position: relative;
  cursor: pointer;
  font-size: 0.9rem;
}

/* Tooltip Styles */
.tooltip {
  display: none;
  position: absolute;
  top: 130%;
  left: 0;
  background-color: #333;
  color: white;
  padding: 8px 10px;
  border-radius: 4px;
  white-space: nowrap;
  z-index: 10;
  font-size: 0.8rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tooltip::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 10px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-bottom: 5px solid #333;
}

.sweepstake-label:hover .tooltip {
  display: block;
}

/* Responsive Design */
@media (max-width: 768px) {
  .newsletter-form {
    flex-direction: column;
    align-items: stretch;
  }

  .newsletter-email-input {
    min-width: auto;
    max-width: none;
  }

  .sweepstake-container {
    justify-content: center;
  }
}

.flash-message {
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
  text-align: center;
  font-size: 14px;
  line-height: 1.4;
}

.button {
  display: inline-block;
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s ease-in-out, transform 0.1s ease,
    box-shadow 0.2s ease-in-out; /* Updated transition */
  box-sizing: border-box;
  border-radius: 6px;
  padding: 10px 20px;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.button:active {
  transform: translateY(0);
}

.button-primary {
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.button-primary:hover {
  background-color: var(--md-sys-color-primary-variant);
}

.button-primary:disabled {
  background-color: var(--md-sys-color-outline);
  color: var(--md-sys-color-on-surface-variant);
  cursor: not-allowed;
}

.flash-message {
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
  text-align: center;
  font-size: 14px;
  line-height: 1.4;
}

.flash-success {
  color: var(--md-sys-color-on-primary-container);
  background-color: var(--md-sys-color-primary-container);
}

.flash-error {
  color: var(--md-sys-color-on-error-container);
  background-color: var(--md-sys-color-error-container);
}

.flash-info {
  color: var(--md-sys-color-on-secondary-container);
  background-color: var(--md-sys-color-secondary-container);
}

.flash-warning {
  color: #9f6000;
  background-color: #feefb3;
}
