/* GMG Consent Manager – Banner & Modal Styles */

/* ── Reset/Base ─────────────────────────────────────────── */
#gmg-consent-banner *,
#gmg-pref-modal *,
.gmg-reopen * {
  box-sizing: border-box;
}

/* ── Banner ──────────────────────────────────────────────── */
.gmg-banner {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 99999;
  background: #1a1a2e;
  color: #e8e8f0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.35);
  padding: 0;
  animation: gmgSlideIn 0.3s ease;
}

.gmg-banner--bottom { bottom: 0; top: auto; border-top: 3px solid #4f46e5; }
.gmg-banner--top    { top: 0; bottom: auto; border-bottom: 3px solid #4f46e5; }

.gmg-banner--modal {
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  border-radius: 12px;
  width: 90%;
  max-width: 560px;
  border: none;
  outline: 3px solid #4f46e5;
}

.gmg-banner__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 24px;
}

.gmg-banner__content {
  flex: 1 1 300px;
}

.gmg-banner__title {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 6px;
  color: #fff;
}

.gmg-banner__desc {
  margin: 0;
  color: #b0b0c8;
  font-size: 13px;
}

.gmg-banner__desc a {
  color: #818cf8;
  text-decoration: underline;
}

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

.gmg-banner__powered {
  width: 100%;
  font-size: 11px;
  color: #606080;
  padding-top: 4px;
}

/* ── Buttons ─────────────────────────────────────────────── */
.gmg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  white-space: nowrap;
  line-height: 1.3;
}

.gmg-btn--primary {
  background: #4f46e5;
  color: #fff;
  border-color: #4f46e5;
}
.gmg-btn--primary:hover {
  background: #4338ca;
  border-color: #4338ca;
}

.gmg-btn--secondary {
  background: transparent;
  color: #e8e8f0;
  border-color: #4b5563;
}
.gmg-btn--secondary:hover {
  border-color: #9ca3af;
  color: #fff;
}

.gmg-btn--ghost {
  background: transparent;
  color: #818cf8;
  border-color: transparent;
  padding-left: 6px;
  padding-right: 6px;
}
.gmg-btn--ghost:hover {
  color: #a5b4fc;
  text-decoration: underline;
}

/* ── Modal ───────────────────────────────────────────────── */
.gmg-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
}

.gmg-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(2px);
}

.gmg-modal__box {
  position: relative;
  z-index: 1;
  background: #1a1a2e;
  color: #e8e8f0;
  border-radius: 12px;
  width: 90%;
  max-width: 580px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 48px rgba(0,0,0,0.55);
  border: 1px solid #2e2e50;
  outline: none;
}

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

.gmg-modal__header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.gmg-modal__close {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s;
}
.gmg-modal__close:hover { color: #fff; }

.gmg-modal__body {
  overflow-y: auto;
  flex: 1;
  padding: 8px 0;
}

.gmg-modal__footer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 24px;
  border-top: 1px solid #2e2e50;
}

/* ── Cookie categories ───────────────────────────────────── */
.gmg-category {
  padding: 16px 24px;
  border-bottom: 1px solid #2e2e50;
}
.gmg-category:last-child { border-bottom: none; }

.gmg-category--required { opacity: 0.7; }

.gmg-category__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.gmg-category__info {
  flex: 1;
}

.gmg-category__info strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.gmg-category__info p {
  margin: 0;
  font-size: 12px;
  color: #9ca3af;
  line-height: 1.5;
}

/* ── Toggle switch ───────────────────────────────────────── */
.gmg-toggle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.gmg-toggle--disabled {
  cursor: default;
}

.gmg-toggle__label {
  font-size: 11px;
  font-weight: 600;
  color: #4ade80;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.gmg-toggle__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.gmg-toggle__slider {
  display: inline-block;
  width: 44px;
  height: 24px;
  background: #374151;
  border-radius: 12px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.gmg-toggle__slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.gmg-toggle__input:checked + .gmg-toggle__slider {
  background: #4f46e5;
}

.gmg-toggle__input:checked + .gmg-toggle__slider::after {
  transform: translateX(20px);
}

.gmg-toggle__input:disabled + .gmg-toggle__slider {
  background: #4ade80;
  opacity: 0.85;
}

.gmg-toggle__input:disabled + .gmg-toggle__slider::after {
  transform: translateX(20px);
}

.gmg-toggle__input:focus + .gmg-toggle__slider {
  outline: 2px solid #818cf8;
  outline-offset: 2px;
}

/* ── Reopen widget ───────────────────────────────────────── */
.gmg-reopen {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 99998;
  background: #1a1a2e;
  color: #818cf8;
  border: 1px solid #2e2e50;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.gmg-reopen:hover {
  background: #252545;
  border-color: #4f46e5;
  color: #a5b4fc;
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes gmgSlideIn {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

.gmg-banner--top {
  animation-name: gmgSlideInTop;
}

@keyframes gmgSlideInTop {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .gmg-banner__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .gmg-banner__actions {
    flex-direction: column;
  }

  .gmg-btn { width: 100%; text-align: center; justify-content: center; }

  .gmg-modal__footer {
    flex-direction: column;
  }

  .gmg-modal__footer .gmg-btn { width: 100%; }
}

/* ── [hidden] support ────────────────────────────────────── */
[hidden] { display: none !important; }
