/**
 * Instabooster Cookie Consent - Premium UI
 * Glassmorphism dark theme matching homepage
 */

/* ==========================================
   BANNER - Bottom bar
   ========================================== */
#ib-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99998;
  padding: 0 20px 20px;
  pointer-events: none;
  transform: translateY(100%);
  opacity: 0;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
}

#ib-consent-banner.ib-cb-show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

#ib-consent-banner.ib-cb-hide {
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s ease-in, opacity 0.25s ease;
}

.ib-cb-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 24px;
  border-radius: 18px;
  background: rgba(15, 10, 25, 0.92);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.ib-cb-text {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
}

.ib-cb-icon {
  flex-shrink: 0;
  color: #ff4d94;
  margin-top: 2px;
}

.ib-cb-text p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.7);
}

.ib-cb-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.ib-cb-btn {
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  border: none;
  white-space: nowrap;
  transition: all 0.25s ease;
}

.ib-cb-btn-accept {
  background: linear-gradient(135deg, #e61c72, #ff4d94);
  color: #fff;
  box-shadow: 0 4px 16px rgba(230, 28, 114, 0.3);
}

.ib-cb-btn-accept:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(230, 28, 114, 0.45);
}

.ib-cb-btn-reject {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ib-cb-btn-reject:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.ib-cb-btn-settings {
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  padding: 10px 14px;
}

.ib-cb-btn-settings:hover {
  color: #ff4d94;
}

/* ==========================================
   PREFERENCES MODAL
   ========================================== */
#ib-consent-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0);
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
  padding: 20px;
}

#ib-consent-overlay.ib-co-show {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
}

#ib-consent-overlay.ib-co-hide {
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0);
  pointer-events: none;
}

.ib-cp-modal {
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  background: rgba(18, 12, 30, 0.95);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  transform: translateY(30px) scale(0.96);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.ib-co-show .ib-cp-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.ib-co-hide .ib-cp-modal {
  transform: translateY(20px) scale(0.97);
  opacity: 0;
}

.ib-cp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ib-cp-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.ib-cp-close {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-radius: 10px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.4);
  transition: all 0.2s;
}

.ib-cp-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.ib-cp-body {
  padding: 20px 28px;
  overflow-y: auto;
  flex: 1;
}

.ib-cp-intro {
  font-size: 13.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 20px;
}

/* Category blocks */
.ib-cp-category {
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.ib-cp-category:last-of-type {
  border-bottom: none;
}

.ib-cp-cat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.ib-cp-cat-info {
  flex: 1;
}

.ib-cp-cat-info h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.ib-cp-cat-info p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.4);
}

/* Toggle switch */
.ib-cp-toggle {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.ib-cp-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.ib-cp-slider {
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  position: relative;
  cursor: pointer;
  transition: background 0.3s;
}

.ib-cp-slider::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  top: 3px;
  left: 3px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s;
}

.ib-cp-toggle input:checked + .ib-cp-slider {
  background: linear-gradient(135deg, #e61c72, #ff4d94);
}

.ib-cp-toggle input:checked + .ib-cp-slider::after {
  transform: translateX(20px);
  background: #fff;
}

.ib-cp-toggle-locked .ib-cp-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.ib-cp-required {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  white-space: nowrap;
}

/* Services tags */
.ib-cp-services {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.ib-cp-service {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* Legal text */
.ib-cp-legal {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.ib-cp-legal p {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.3);
}

.ib-cp-legal a {
  color: #ff4d94;
  text-decoration: none;
}

.ib-cp-legal a:hover {
  text-decoration: underline;
}

/* Footer actions */
.ib-cp-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 16px 28px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ==========================================
   RESPONSIVE
   ========================================== */
@media (max-width: 640px) {
  .ib-cb-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 16px 18px;
    border-radius: 16px;
  }

  .ib-cb-actions {
    justify-content: stretch;
  }

  .ib-cb-btn {
    flex: 1;
    text-align: center;
    padding: 12px 12px;
  }

  .ib-cb-btn-settings {
    display: none;
  }

  .ib-cp-modal {
    max-height: 92vh;
    border-radius: 20px;
  }

  .ib-cp-header,
  .ib-cp-body,
  .ib-cp-footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .ib-cp-footer {
    flex-direction: column;
  }

  .ib-cp-footer .ib-cb-btn {
    width: 100%;
    text-align: center;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  #ib-consent-banner,
  .ib-cp-modal,
  #ib-consent-overlay,
  .ib-cp-slider::after {
    transition-duration: 0.01ms !important;
  }
}
