/* =====================================================
   POWERSELL Cookie Consent Banner & Modal Styles
   Brand: #006fa4 (primary blue), #24284c (navy)
   ===================================================== */

/* ---------- Banner ---------- */
#ps-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #24284c;
  color: #ffffff;
  padding: 16px 24px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.25);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

#ps-cookie-banner.ps-visible {
  opacity: 1;
  transform: translateY(0);
}

#ps-cookie-banner.ps-hidden {
  display: none !important;
}

.ps-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}

.ps-banner-text {
  flex: 1 1 300px;
  color: rgba(255, 255, 255, 0.88);
}

.ps-banner-text strong {
  color: #ffffff;
  font-weight: 600;
}

.ps-banner-text a {
  color: #5bbfe6;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.2s;
}

.ps-banner-text a:hover {
  color: #82d0f0;
}

.ps-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* Buttons */
.ps-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  line-height: 1;
  transition: background 0.2s, color 0.2s, border-color 0.2s, opacity 0.2s;
  white-space: nowrap;
}

.ps-btn:focus-visible {
  outline: 2px solid #5bbfe6;
  outline-offset: 2px;
}

.ps-btn-accept {
  background: #006fa4;
  color: #ffffff;
}

.ps-btn-accept:hover {
  background: #0086c3;
}

.ps-btn-reject {
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.ps-btn-reject:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.6);
}

.ps-btn-customize {
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.ps-btn-customize:hover {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.4);
}

/* ---------- Modal Overlay ---------- */
#ps-cookie-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

#ps-cookie-modal-overlay.ps-visible {
  opacity: 1;
}

#ps-cookie-modal-overlay.ps-hidden {
  display: none !important;
}

/* ---------- Modal ---------- */
#ps-cookie-modal {
  background: #ffffff;
  color: #1a1a2e;
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  transform: scale(0.96);
  transition: transform 0.25s ease;
}

#ps-cookie-modal-overlay.ps-visible #ps-cookie-modal {
  transform: scale(1);
}

.ps-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e8eaed;
}

.ps-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #24284c;
  margin: 0;
}

.ps-modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: #f0f2f5;
  color: #6b7280;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.ps-modal-close:hover {
  background: #e2e5ea;
  color: #24284c;
}

.ps-modal-close:focus-visible {
  outline: 2px solid #006fa4;
  outline-offset: 2px;
}

.ps-modal-body {
  padding: 20px 24px;
}

.ps-modal-desc {
  color: #4b5563;
  margin-bottom: 20px;
  line-height: 1.6;
}

/* ---------- Category Row ---------- */
.ps-category {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
  transition: border-color 0.2s;
}

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

.ps-category-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ps-category-info {
  flex: 1;
}

.ps-category-name {
  font-weight: 600;
  color: #24284c;
  font-size: 14px;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ps-badge-required {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #e0f2fe;
  color: #006fa4;
  padding: 2px 7px;
  border-radius: 9999px;
}

.ps-category-desc {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
}

/* ---------- Toggle Switch ---------- */
.ps-toggle-wrap {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.ps-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.ps-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ps-toggle-track {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: #d1d5db;
  transition: background 0.25s;
  position: relative;
  flex-shrink: 0;
}

.ps-toggle input:checked + .ps-toggle-track {
  background: #006fa4;
}

.ps-toggle input:disabled + .ps-toggle-track {
  background: #9dc8e3;
  cursor: not-allowed;
  opacity: 0.7;
}

.ps-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s;
}

.ps-toggle input:checked + .ps-toggle-track::after {
  transform: translateX(18px);
}

.ps-toggle input:focus-visible + .ps-toggle-track {
  outline: 2px solid #5bbfe6;
  outline-offset: 2px;
}

/* ---------- Modal Footer ---------- */
.ps-modal-footer {
  padding: 16px 24px 20px;
  border-top: 1px solid #e8eaed;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.ps-btn-save {
  background: #006fa4;
  color: #ffffff;
  padding: 10px 22px;
  font-size: 14px;
}

.ps-btn-save:hover {
  background: #0086c3;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  #ps-cookie-banner {
    padding: 14px 16px;
  }

  .ps-banner-inner {
    gap: 10px 16px;
  }

  .ps-banner-text {
    flex: 1 1 100%;
    font-size: 13px;
  }

  .ps-banner-actions {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .ps-btn {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
  }

  .ps-modal-header,
  .ps-modal-body,
  .ps-modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .ps-modal-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .ps-btn-save {
    width: 100%;
    justify-content: center;
  }
}
