/* ==========================================================================
   OPLive Website - GDPR & CCPA Compliant Cookie Banner & Preferences Modal
   ========================================================================== */

:root {
  --op-cb-primary: #ff3769;
  --op-cb-primary-hover: #e02857;
  --op-cb-secondary: #0ea4b9;
  --op-cb-bg-dark: #121624;
  --op-cb-text-dark: #ffffff;
  --op-cb-text-muted: #94a3b8;
  --op-cb-border: rgba(255, 255, 255, 0.12);
  --op-cb-modal-bg: #ffffff;
  --op-cb-modal-text: #1e293b;
  --op-cb-card-bg: #f8fafc;
  --op-cb-radius-lg: 20px;
  --op-cb-radius-md: 12px;
  --op-cb-radius-sm: 8px;
  --op-cb-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  --op-cb-font: "Inter", "Nunito Sans", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --- Banner Floating Box --- */
#op-cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: 24px;
  max-width: 1100px;
  margin: 0 auto;
  z-index: 999999;
  background: var(--op-cb-bg-dark);
  color: var(--op-cb-text-dark);
  font-family: var(--op-cb-font);
  border-radius: var(--op-cb-radius-lg);
  padding: 24px 28px;
  box-shadow: var(--op-cb-shadow);
  border: 1px solid var(--op-cb-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transform: translateY(120%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease, visibility 0.4s ease;
}

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

.op-cb-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.op-cb-content {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  flex: 1;
}

.op-cb-icon-box {
  width: 48px;
  height: 48px;
  min-width: 48px;
  background: rgba(255, 55, 105, 0.15);
  color: var(--op-cb-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.op-cb-text-box h4 {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.op-cb-badge {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(14, 164, 185, 0.2);
  color: var(--op-cb-secondary);
  padding: 3px 8px;
  border-radius: 12px;
}

.op-cb-text-box p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--op-cb-text-muted);
  margin: 0;
}

.op-cb-text-box p a {
  color: var(--op-cb-primary);
  text-decoration: underline;
  font-weight: 600;
  transition: color 0.2s ease;
}

.op-cb-text-box p a:hover {
  color: #ffffff;
}

.op-cb-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.op-cb-btn {
  font-family: var(--op-cb-font);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s ease;
  outline: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.op-cb-btn-accept {
  background-color: var(--op-cb-primary);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(255, 55, 105, 0.35);
}

.op-cb-btn-accept:hover {
  background-color: var(--op-cb-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 55, 105, 0.45);
}

.op-cb-btn-reject {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.op-cb-btn-reject:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.op-cb-btn-settings {
  background: transparent;
  color: var(--op-cb-text-muted);
  border: 1px solid transparent;
}

.op-cb-btn-settings:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* --- Preferences Modal Overlay & Content --- */
#op-cookie-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000000;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#op-cookie-modal-overlay.op-modal-active {
  opacity: 1;
  visibility: visible;
}

.op-cb-modal {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  background: var(--op-cb-modal-bg);
  color: var(--op-cb-modal-text);
  font-family: var(--op-cb-font);
  border-radius: var(--op-cb-radius-lg);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#op-cookie-modal-overlay.op-modal-active .op-cb-modal {
  transform: scale(1) translateY(0);
}

.op-cb-modal-header {
  padding: 24px 28px 18px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.op-cb-modal-header h3 {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.op-cb-modal-header h3 i {
  color: var(--op-cb-primary);
}

.op-cb-modal-close {
  background: #f1f5f9;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  font-size: 20px;
  transition: all 0.2s ease;
}

.op-cb-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.op-cb-modal-body {
  padding: 24px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.op-cb-modal-intro {
  font-size: 14px;
  line-height: 1.6;
  color: #475569;
  margin-bottom: 6px;
}

/* Category Cards */
.op-cb-category-card {
  background: var(--op-cb-card-bg);
  border: 1px solid #e2e8f0;
  border-radius: var(--op-cb-radius-md);
  padding: 18px 20px;
  transition: border-color 0.2s ease;
}

.op-cb-category-card:hover {
  border-color: #cbd5e1;
}

.op-cb-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.op-cb-category-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.op-cb-category-title h5 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.op-cb-always-active {
  font-size: 12px;
  font-weight: 700;
  color: var(--op-cb-secondary);
  background: rgba(14, 164, 185, 0.12);
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.op-cb-category-desc {
  font-size: 13px;
  line-height: 1.55;
  color: #64748b;
  margin: 0;
}

/* Custom Toggle Switch */
.op-cb-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
  flex-shrink: 0;
}

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

.op-cb-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: 0.3s;
  border-radius: 24px;
}

.op-cb-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.op-cb-switch input:checked + .op-cb-slider {
  background-color: var(--op-cb-primary);
}

.op-cb-switch input:focus + .op-cb-slider {
  box-shadow: 0 0 1px var(--op-cb-primary);
}

.op-cb-switch input:checked + .op-cb-slider:before {
  transform: translateX(22px);
}

.op-cb-switch input:disabled + .op-cb-slider {
  background-color: #94a3b8;
  opacity: 0.7;
  cursor: not-allowed;
}

.op-cb-modal-footer {
  padding: 18px 28px 24px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f8fafc;
}

.op-cb-btn-save {
  background-color: var(--op-cb-primary);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(255, 55, 105, 0.3);
}

.op-cb-btn-save:hover {
  background-color: var(--op-cb-primary-hover);
  box-shadow: 0 6px 20px rgba(255, 55, 105, 0.4);
}

.op-cb-btn-accept-modal {
  background-color: #0f172a;
  color: #ffffff;
}

.op-cb-btn-accept-modal:hover {
  background-color: #1e293b;
}

/* --- Persistent Trigger Badge Widget --- */
#op-cookie-badge {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 999990;
  background: var(--op-cb-bg-dark);
  color: #ffffff;
  border: 1px solid var(--op-cb-border);
  border-radius: 50px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--op-cb-font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.9);
}

#op-cookie-badge.op-badge-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

#op-cookie-badge:hover {
  background: var(--op-cb-primary);
  border-color: var(--op-cb-primary);
  box-shadow: 0 8px 25px rgba(255, 55, 105, 0.4);
  transform: translateY(-2px);
}

#op-cookie-badge i {
  font-size: 18px;
  color: var(--op-cb-primary);
  transition: color 0.3s ease;
}

#op-cookie-badge:hover i {
  color: #ffffff;
}

/* --- Responsive Adaptations --- */
@media (max-width: 768px) {
  #op-cookie-banner {
    bottom: 12px;
    left: 12px;
    right: 12px;
    padding: 18px;
    border-radius: var(--op-cb-radius-md);
  }

  .op-cb-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .op-cb-content {
    gap: 12px;
  }

  .op-cb-icon-box {
    width: 40px;
    height: 40px;
    min-width: 40px;
    font-size: 20px;
  }

  .op-cb-text-box h4 {
    font-size: 16px;
  }

  .op-cb-text-box p {
    font-size: 13px;
  }

  .op-cb-actions {
    flex-direction: column;
    width: 100%;
  }

  .op-cb-btn {
    width: 100%;
    padding: 11px;
  }

  .op-cb-modal {
    max-height: 95vh;
    border-radius: var(--op-cb-radius-md);
  }

  .op-cb-modal-header,
  .op-cb-modal-body,
  .op-cb-modal-footer {
    padding: 16px;
  }

  .op-cb-modal-footer {
    flex-direction: column;
  }

  .op-cb-modal-footer .op-cb-btn {
    width: 100%;
  }

  #op-cookie-badge {
    bottom: 16px;
    left: 16px;
    padding: 8px 14px;
    font-size: 12px;
  }
}
