/**
 * tablewizzard.app – Cookie-Consent-Management Styling
 * Banner, Modal, Toggle-Switches
 */

/* ========================================================================
   Banner (fixiert unten)
   ======================================================================== */

.tw-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10001;
  background: rgba(44, 62, 64, 0.97);
  color: #f5f5f5;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  padding: 20px 24px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
  animation: tw-consent-slide-in 0.35s ease-out;
}

.tw-consent-banner__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.tw-consent-banner__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding-top: 2px;
  opacity: 0.8;
}

.tw-consent-banner__text {
  flex: 1;
  min-width: 260px;
}

.tw-consent-banner__text a {
  color: #D4A853;
  text-decoration: underline;
}

.tw-consent-banner__text a:hover {
  color: #e6be6a;
}

.tw-consent-banner__actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
}

.tw-consent-btn {
  padding: 9px 20px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, transform 0.1s;
  font-family: inherit;
}

.tw-consent-btn:active {
  transform: scale(0.97);
}

.tw-consent-btn--accept {
  background: #5A9A7A;
  color: #fff;
}

.tw-consent-btn--accept:hover {
  background: #4a8a6a;
}

.tw-consent-btn--necessary {
  background: transparent;
  color: #f5f5f5;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
}

.tw-consent-btn--necessary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.5);
}

.tw-consent-btn--settings {
  background: transparent;
  color: #D4A853;
  border: 1.5px solid #D4A853;
}

.tw-consent-btn--settings:hover {
  background: rgba(212, 168, 83, 0.1);
}

/* ========================================================================
   Modal-Overlay
   ======================================================================== */

.tw-consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 10002;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: tw-consent-fade-in 0.2s ease-out;
}

/* ========================================================================
   Modal
   ======================================================================== */

.tw-consent-modal {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: tw-consent-modal-in 0.25s ease-out;
  font-family: system-ui, -apple-system, sans-serif;
  color: #2C3E40;
}

.tw-consent-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.tw-consent-modal__title {
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: #2C3E40;
}

.tw-consent-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #5D6D6E;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}

.tw-consent-modal__close:hover {
  background: #f3f4f6;
  color: #2C3E40;
}

.tw-consent-modal__body {
  padding: 20px 24px;
}

.tw-consent-modal__intro {
  font-size: 14px;
  color: #5D6D6E;
  line-height: 1.6;
  margin: 0 0 20px;
}

/* ========================================================================
   Cookie-Kategorie
   ======================================================================== */

.tw-consent-category {
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.15s;
}

.tw-consent-category:last-child {
  margin-bottom: 0;
}

.tw-consent-category.is-active {
  border-color: #2D5A47;
}

.tw-consent-category__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #f9fafb;
  gap: 12px;
}

.tw-consent-category__info {
  flex: 1;
  min-width: 0;
}

.tw-consent-category__name {
  font-size: 15px;
  font-weight: 600;
  color: #2C3E40;
  margin: 0 0 3px;
}

.tw-consent-category__desc {
  font-size: 12px;
  color: #5D6D6E;
  line-height: 1.4;
  margin: 0;
}

.tw-consent-category__badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: #E8F0EC;
  color: #2D5A47;
  white-space: nowrap;
  margin-left: 8px;
}

/* ========================================================================
   Toggle-Switch
   ======================================================================== */

.tw-consent-toggle {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
}

.tw-consent-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.tw-consent-toggle__track {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}

.tw-consent-toggle__track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s;
}

.tw-consent-toggle input:checked + .tw-consent-toggle__track {
  background: #2D5A47;
}

.tw-consent-toggle input:checked + .tw-consent-toggle__track::after {
  transform: translateX(20px);
}

.tw-consent-toggle input:focus-visible + .tw-consent-toggle__track {
  outline: 2px solid #2D5A47;
  outline-offset: 2px;
}

.tw-consent-toggle input:disabled + .tw-consent-toggle__track {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ========================================================================
   Modal Footer
   ======================================================================== */

.tw-consent-modal__footer {
  display: flex;
  gap: 8px;
  padding: 16px 24px 20px;
  border-top: 1px solid #e5e7eb;
  flex-wrap: wrap;
}

.tw-consent-modal__footer .tw-consent-btn {
  flex: 1;
  min-width: 120px;
  text-align: center;
}

.tw-consent-btn--save {
  background: #2D5A47;
  color: #fff;
}

.tw-consent-btn--save:hover {
  background: #234a39;
}

.tw-consent-btn--accept-all {
  background: #5A9A7A;
  color: #fff;
}

.tw-consent-btn--accept-all:hover {
  background: #4a8a6a;
}

/* ========================================================================
   Footer-Link
   ======================================================================== */

.tw-consent-footer-link {
  cursor: pointer;
  text-decoration: underline;
}

/* ========================================================================
   Animationen
   ======================================================================== */

@keyframes tw-consent-slide-in {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes tw-consent-slide-out {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(100%); opacity: 0; }
}

@keyframes tw-consent-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes tw-consent-modal-in {
  from { transform: scale(0.95) translateY(10px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

/* ========================================================================
   Responsive
   ======================================================================== */

@media (max-width: 600px) {
  .tw-consent-banner {
    padding: 16px;
  }

  .tw-consent-banner__inner {
    flex-direction: column;
    text-align: center;
    gap: 14px;
  }

  .tw-consent-banner__icon {
    display: none;
  }

  .tw-consent-banner__actions {
    justify-content: center;
    width: 100%;
  }

  .tw-consent-btn {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
  }

  .tw-consent-modal__footer {
    flex-direction: column;
  }

  .tw-consent-modal__footer .tw-consent-btn {
    min-width: auto;
  }
}
