/**
 * Each property/class needs to be started with referbro to avoid issues in shopify because of same class  in the main app.
 */

/* CSS Custom Properties for Design System Consistency */
:root {
  --referbro-color-primary: #111827;
  --referbro-color-primary-hover: #333;
  --referbro-color-secondary: #9ca3af;
  --referbro-color-tertiary: #6b7280;
  --referbro-color-accent: #1e1e1e;
  --referbro-color-white: #ffffff;
  --referbro-color-overlay: rgba(0, 0, 0, 0.3);
  --referbro-color-shadow: #00000026;
  --referbro-color-tooltip-bg: #1f2937;
  --referbro-color-border: #9ca3af;
  --referbro-color-placeholder: #6b7280;
  --referbro-color-brand-start: #61045F;
  --referbro-color-brand-end: #AA076B;
  
  /* Z-index scale for better layering management */
  --referbro-z-index-base: 100;
  --referbro-z-index-overlay: 1000;
  --referbro-z-index-modal: 1001;
  --referbro-z-index-tooltip: 1002;
  --referbro-z-index-top: 10000000;
  
  /* Breakpoints */
  --referbro-breakpoint-tablet: 768px;
  
  /* Spacing and sizing */
  --referbro-tooltip-width-desktop: 280px;
  --referbro-tooltip-width-mobile: 250px;
}

.referbro-referral-container {
  font-weight: 400;
  font-size: 14px;
  line-height: 15px;
  letter-spacing: normal;
  z-index: var(--referbro-z-index-top);
}

.referbro-referral-container p {
  margin: 0px;
}

.referbro-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  z-index: var(--referbro-z-index-overlay);
  background: var(--referbro-color-overlay);
}


.referbro-overlay--center {
  align-items: center;
  justify-content: center;
}

.referbro-overlay--bottom {
  align-items: flex-end;
  justify-content: flex-end;
}

/* Common container styles */
.referbro-modal-container {
  background: var(--referbro-color-white);
  box-shadow: 0px 4px 8px 3px var(--referbro-color-shadow);
  position: relative;
  z-index: var(--referbro-z-index-modal);
}

.referbro-modal-container--rounded {
  border-radius: 8px;
}

.referbro-modal-container--top-rounded {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

/* Button styles */
.referbro-referral-button {
  display: flex;
  height: 44px;
  border-radius: 24px;
  padding: 12px 14px;
  gap: 4px;
  box-shadow: 0px 4px 8px 3px var(--referbro-color-shadow);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.referbro-btn-background {
  background-color: var(--referbro-color-primary);
  color: var(--referbro-color-white);
}

/* Position utilities */
.referbro-position-float-fixed {
  position: fixed;
  bottom: 36px;
  right: 12px;
}

.referbro-position-fixed {
  position: fixed;
  bottom: 0px;
  right: 0px;
}

/* Form styles */
.referbro-referral-form-content {
  height: 270px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
}

.referbro-referral-url {
  font-size: 16px;
  font-weight: bold;
  padding: 15px 25px;
}

.referbro-referral-success {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 20px;
  border-radius: 5px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: var(--referbro-z-index-overlay);
}

/* Responsive styles - Updated to standard breakpoint */
@media (max-width: 768px) {
  .referbro-referral-form-content {
    width: 100vw;
  }
}

@media (min-width: 769px) {
  .referbro-referral-form-content {
    width: 375px;
  }
}

/* Typography styles */
.referbro-referral-subheading {
  font-size: 16px;
  line-height: 16px;
  letter-spacing: 0;
}

.referbro-referral-heading {
  font-weight: 700;
  font-size: 24px;
  line-height: 34px;
  letter-spacing: 0;
  color: var(--referbro-color-secondary);
}

.referbro-highlight {
  color: var(--referbro-color-accent);
}

/* Layout styles */
.referbro-referral-actionable-area {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.referbro-align-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Form input styles */
.referbro-phone-input-field {
  display: block;
  border-radius: 4px;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--referbro-color-border);
}

.referbro-phone-input-field::placeholder {
  font-size: 16px;
  line-height: 16px;
  color: var(--referbro-color-placeholder);
}

/* Button styles */
.referbro-common-btn {
  display: flex;
  border-radius: 4px;
  padding: 16px;
  gap: 10px;
  cursor: pointer;
  font-size: 16px;
  line-height: 16px;
  width: 100%;
  justify-content: center;
}

.referbro-common-btn:hover {
  background: var(--referbro-color-primary-hover);
}

/* Footer styles */
.referbro-powered-by {
  align-self: flex-start;
  display: flex;
  justify-content: start;
  align-items: center;
  gap: 4px;
  line-height: 100%;
  letter-spacing: 0;
  color: var(--referbro-color-tertiary);
}

/* Tooltip styles - Improved width handling */
.referbro-tooltip-container {
  position: relative;
  display: inline-block;
}

.referbro-tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: var(--referbro-color-tertiary);
  color: var(--referbro-color-white);
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  margin-left: 4px;
  vertical-align: middle;
}

.referbro-tooltip-content {
  visibility: hidden;
  width: var(--referbro-tooltip-width-desktop);
  max-width: calc(100vw - 40px); /* Responsive max-width */
  background-color: var(--referbro-color-tooltip-bg);
  color: var(--referbro-color-white);
  text-align: left;
  border-radius: 6px;
  padding: 12px;
  position: absolute;
  z-index: var(--referbro-z-index-tooltip);
  bottom: 125%;
  left: 50%;
  margin-left: calc(var(--referbro-tooltip-width-desktop) / -2);
  opacity: 0;
  transition: opacity 0.3s;
  font-size: 12px;
  line-height: 16px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
}

.referbro-tooltip-content::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--referbro-color-tooltip-bg) transparent transparent transparent;
}

.referbro-tooltip-container:hover .referbro-tooltip-content {
  visibility: visible;
  opacity: 1;
}

/* Mobile responsive tooltip - Updated to standard breakpoint */
@media (max-width: 768px) {
  .referbro-tooltip-content {
    width: var(--referbro-tooltip-width-mobile);
    margin-left: calc(var(--referbro-tooltip-width-mobile) / -2);
    bottom: 120%;
  }
}

/* Brand styles */
.referbro-brand-shadding {
  background-image: linear-gradient(90deg, var(--referbro-color-brand-start) 0.5%, var(--referbro-color-brand-end) 86.5%);
  color: transparent;
  background-clip: text;
  text-decoration: none;
}

/* Popup specific styles */
.referbro-discount-popup-content {
  height: 285px;
  width: 375px;
  padding: 36px 20px 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
}

.referbro-discount-percent {
  font-weight: 700;
  font-size: 48px;
  line-height: 48px;
}

.referbro-close-btn-container {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 32px;
  cursor: pointer;
  color: var(--referbro-color-primary);
}

.referbro-close-btn {
  border: none;
  background: none;
}

.referbro-hidden {
  display: none;
}

.referbro-tick-icon {
  width: 32px;
  height: 32px;
}

.referbro-logo-icon {
  width: 79px;
  height: 16px;
}
