/* ==========================================================================
   Google CMP (Consent Management Platform) - 3-Option GDPR/TCF 2.2 Modal
   Compliant with Google AdSense, Google Ad Manager, and IAB TCF 2.2
   ========================================================================== */

.google-cmp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: #1f2937;
}

.google-cmp-overlay.active {
  opacity: 1;
  visibility: visible;
}

.google-cmp-modal {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: cmpZoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cmpZoomIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.cmp-header {
  padding: 1.5rem 1.5rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-bottom: 1px solid #f3f4f6;
}

.cmp-shield-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #e8f0fe;
  color: #1a73e8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cmp-header-text h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 2px 0;
  line-height: 1.25;
}

.cmp-header-text span {
  font-size: 0.78rem;
  color: #6b7280;
}

.cmp-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #4b5563;
}

.cmp-body p {
  margin-bottom: 0.85rem;
}

.cmp-purposes-summary {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 0.85rem;
  margin: 0.85rem 0;
  font-size: 0.82rem;
}

.cmp-purposes-summary strong {
  display: block;
  color: #1f2937;
  margin-bottom: 0.4rem;
}

.cmp-purposes-summary ul {
  padding-left: 1.2rem;
  margin: 0;
  color: #4b5563;
}

.cmp-purposes-summary li {
  margin-bottom: 0.25rem;
}

/* Manage Options Granular View */
.cmp-manage-view {
  display: none;
  margin-top: 1rem;
  border-top: 1px solid #e5e7eb;
  padding-top: 1rem;
}

.cmp-manage-view.open {
  display: block;
}

.cmp-option-group {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid #f3f4f6;
  gap: 1rem;
}

.cmp-option-desc strong {
  display: block;
  font-size: 0.85rem;
  color: #1f2937;
  margin-bottom: 2px;
}

.cmp-option-desc span {
  font-size: 0.75rem;
  color: #6b7280;
  display: block;
}

/* Switch */
.cmp-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.cmp-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cmp-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: 0.2s ease;
  border-radius: 22px;
}

.cmp-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.2s ease;
  border-radius: 50%;
}

.cmp-switch input:checked + .cmp-slider {
  background-color: #1a73e8;
}

.cmp-switch input:checked + .cmp-slider:before {
  transform: translateX(18px);
}

.cmp-switch input:disabled + .cmp-slider {
  background-color: #94a3b8;
  cursor: not-allowed;
}

/* 3-Button Footer */
.cmp-footer {
  padding: 1.25rem 1.5rem;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cmp-actions-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.6rem;
}

.cmp-btn {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.15s ease;
}

/* Option 1: Consent */
.cmp-btn-consent {
  background: #1a73e8;
  color: #ffffff;
  border-color: #1a73e8;
  font-weight: 700;
}

.cmp-btn-consent:hover {
  background: #1557b0;
  border-color: #1557b0;
}

/* Option 2: Do Not Consent */
.cmp-btn-reject {
  background: #ffffff;
  color: #374151;
  border-color: #d1d5db;
}

.cmp-btn-reject:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

/* Option 3: Manage Options */
.cmp-btn-manage {
  background: #f3f4f6;
  color: #1f2937;
  border-color: #e5e7eb;
}

.cmp-btn-manage:hover {
  background: #e5e7eb;
  border-color: #d1d5db;
}

.cmp-manage-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.cmp-privacy-policy-link {
  font-size: 0.72rem;
  color: #6b7280;
  text-align: center;
  margin-top: 0.25rem;
}

.cmp-privacy-policy-link a {
  color: #1a73e8;
  text-decoration: underline;
}

/* Footer Trigger Button on Webpages */
.footer-privacy-btn {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0.8;
  transition: opacity 0.2s, background 0.2s;
}

.footer-privacy-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
}

@media (max-width: 600px) {
  .cmp-actions-3 {
    grid-template-columns: 1fr;
  }
  .cmp-btn {
    width: 100%;
    padding: 12px;
  }
}
