/* ========================================
   Fonts
   ======================================== */
@font-face {
  font-family: 'Nunito Sans';
  src: url('https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,opsz,wght@0,6..12,200..1000;1,6..12,200..1000&display=swap')
    format('truetype-variations');
  font-weight: 1 1000;
  font-style: normal;
}

/* @font-face {
  font-family: 'Nunito Sans';
  src: url('./assets/NunitoSans-Italic-VariableFont_YTLC,opsz,wdth,wght.ttf') format('truetype-variations');
  font-weight: 1 1000;
  font-style: italic;
} */

/* ========================================
   CSS Variables
   ======================================== */
:root {
  --primary-color: #004eeb;
  --warning-color: #eab308;
  --warning-dark-color: #ca8a04;
  --white-color: #ffffff;
  --border-color: #e1e1e1;
  --text-color: #606266;
  --text-dark-color: #18181b;
}

/* ========================================
   Notifier Base
   ======================================== */
.cilia-credit-notifier.hidden {
  display: none;
}

/* ========================================
   Dialog (Banner Modal)
   ======================================== */
.cilia-credit-dialog {
  width: 840px;
  max-width: 90vw;
  aspect-ratio: 840 / 440;
  padding: 0;
  border: 1px solid var(--white-color);
  border-radius: 16px;
  background: var(--primary-color);
  font-family: 'Nunito Sans', sans-serif;
  font-size: 16px;
  overflow: hidden;
}

.cilia-credit-dialog::backdrop {
  background-color: #1d1d1d;
  opacity: 0.2;
  backdrop-filter: blur(4px);
}

.cilia-credit-dialog .cilia-credit-button.is-primary {
  --border-color: var(--white-color);
  --button-color: var(--primary-color);
  --button-bg-color: var(--white-color);
}

/* ========================================
   Banner Styles
   ======================================== */
.cilia-credit-banner-container {
  display: flex;
  width: 100%;
  height: 100%;
  gap: 16px;
  background: var(--primary-color);
}

.cilia-credit-banner-left {
  flex: 1 1 0;
  min-width: 0;
  background: var(--primary-color);
  padding: 40px 20px 40px 40px;
  display: flex;
  flex-direction: column;
  color: var(--white-color);
  font-family: 'Nunito Sans', sans-serif;
  overflow: hidden;
}

.cilia-credit-banner-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--white-color);
  font-family: 'Nunito Sans', sans-serif;
}

.cilia-credit-banner-description {
  margin: 8px 0 0 0;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.15;
  color: var(--white-color);
  font-family: 'Nunito Sans', sans-serif;
}

.cilia-credit-banner-features {
  margin: 24px 0 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.cilia-credit-banner-feature {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  color: var(--white-color);
  font-family: 'Nunito Sans', sans-serif;
}

.cilia-credit-banner-feature-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cilia-credit-banner-feature-text {
  flex: 1;
}

.cilia-credit-banner-actions {
  margin: 32px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.cilia-credit-banner-actions .cilia-credit-button--accept {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  height: 24px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  color: var(--primary-color);
  background-color: var(--white-color);
  border: 1px solid var(--white-color);
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Nunito Sans', sans-serif;
}

.cilia-credit-banner-actions .cilia-credit-button--close {
  color: var(--white-color);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  line-height: 24px;
  background: none;
  border: none;
  border-bottom: 1px solid var(--white-color);
  padding: 0;
  cursor: pointer;
  font-family: 'Nunito Sans', sans-serif;
}

.cilia-credit-banner-actions .cilia-credit-button--close:hover {
  opacity: 0.8;
}

.cilia-credit-banner-right {
  flex: 1 1 0;
  min-width: 0;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cilia-credit-banner-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ========================================
   Credit Communication Popovers
   ======================================== */

/* Base popover container */
.cilia-credit-popover {
  width: 377px;
  height: 218px;
  border-radius: 16px;
  background: var(--white-color);
  box-shadow:
    0px 6px 6px -1px rgba(0, 0, 0, 0.1),
    0px 4px 4px -2px rgba(0, 0, 0, 0.1);
  position: relative;
}

/* Popover arrow pointing upward at top-right */
.cilia-credit-popover::before {
  content: '';
  position: absolute;
  top: -8px;
  right: 45px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid var(--primary-color);
  filter: drop-shadow(0px -2px 2px rgba(0, 0, 0, 0.08));
  z-index: 10;
}

/* Flipped arrow pointing downward at bottom-right when popover is above trigger */
.cilia-credit-popover.flipped::before {
  top: auto;
  bottom: -8px;
  border-bottom: none;
  border-top: 8px solid var(--white-color);
  filter: drop-shadow(0px 2px 2px rgba(0, 0, 0, 0.08));
}

/* Content layout */
.cilia-credit-popover__content {
  position: relative;
  padding: 16px;
  display: flex;
  align-items: stretch;
  gap: 4px;
  height: 100%;
  border-radius: 16px;
  overflow: hidden;
}

/* Text section */
.cilia-credit-popover__text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  min-width: 185px;
  max-width: 185px;
}

.cilia-credit-popover__title {
  font-family: 'Nunito Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--primary-color);
  margin: 0;
}

.cilia-credit-popover__description {
  font-family: 'Nunito Sans', sans-serif;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.15;
  color: #52525b;
  margin: 0;
}

/* Actions (buttons) */
.cilia-credit-popover__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

/* Button base styles */
.cilia-credit-popover__actions .cilia-credit-button {
  font-family: 'Nunito Sans', sans-serif;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cilia-credit-popover__actions .cilia-credit-button--accept {
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  color: var(--white-color);
  background: var(--primary-color);
  border: 1px solid var(--primary-color);
  border-radius: 4px;
}

.cilia-credit-popover__actions .cilia-credit-button--accept:hover {
  opacity: 0.9;
}

.cilia-credit-popover__actions .cilia-credit-button--close {
  font-size: 12px;
  font-weight: 500;
  line-height: 22px;
  color: var(--text-dark-color);
  border-bottom: 1px solid var(--primary-color);
  padding-bottom: 2px;
}

.cilia-credit-popover__actions .cilia-credit-button--close:hover {
  opacity: 0.8;
}

.cilia-credit-popover__actions .cilia-credit-button__icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

/* Image container */
.cilia-credit-popover__image-container {
  position: absolute;
  top: 0;
  right: 0;
  flex-shrink: 0;
  width: 172px;
  height: 100%;
  max-height: 218px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
}

/* SVG Background shape */
.cilia-credit-popover__image-background {
  position: absolute;
  top: 0;
  right: 0;
  width: 160px;
  z-index: 1;
  border-top-right-radius: 16px;
}

/* Person image */
.cilia-credit-popover__image {
  position: absolute;
  bottom: 0;
  right: 0;
  z-index: 2;
  width: 171px;
  height: 182px;
  max-height: 100%;
  object-fit: contain;
  object-position: bottom;
}

/* Close button (X icon) */
.cilia-credit-popover__close-icon {
  position: absolute;
  top: 11px;
  right: 11px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 3;
  padding: 4px;
  width: 19px;
  height: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.cilia-credit-popover__close-icon:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.cilia-credit-popover__close-icon svg {
  width: 11px;
  height: 11px;
  display: block;
}

.cilia-credit-popover__close-icon svg path {
  stroke: var(--white-color);
  stroke-width: 1.5;
}

/* Warning popover modifiers */
.cilia-credit-popover--warning {
  width: 373px;
  height: 194px;
}

/* Warning popover arrow (same position) */
.cilia-credit-popover--warning::before {
  border-bottom: 8px solid var(--warning-color);
}

.cilia-credit-popover__title--dark {
  color: #18181b;
}

.cilia-credit-popover__warning-text {
  font-weight: 700;
  color: var(--warning-dark-color);
}

.cilia-credit-popover__actions .cilia-credit-button--accept.cilia-credit-button--warning {
  background: var(--warning-color);
  border-color: var(--warning-color);
  color: #18181b;
}

.cilia-credit-popover__actions .cilia-credit-button--accept.cilia-credit-button--warning:hover {
  background: var(--warning-dark-color);
  border-color: var(--warning-dark-color);
}

.cilia-credit-popover__warning-icon {
  position: absolute;
  top: 22px;
  right: 16px;
  z-index: 2;
}

.cilia-credit-popover--warning .cilia-credit-popover__close-icon svg path {
  stroke: var(--text-dark-color);
  stroke-width: 1.5;
}
