/**
 * ELIO SOLAR - HEADER ACTIONS STYLES
 * Trust badge and CTA button styles
 * Version: 2.0
 */

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */

:root {
  /* Trust Badge */
  --trust-badge-gap: 8px;
  --trust-badge-font-size: 14px;
  --trust-badge-font-size-scrolled: 13px;
  --trust-badge-icon-size: 16px;
  --trust-badge-color: #f59e0b;

  /* CTA Button */
  --cta-gradient: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
  --cta-gradient-hover: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  --cta-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
  --cta-shadow-hover: 0 8px 24px rgba(59, 130, 246, 0.4);
  --cta-shadow-active: 0 2px 8px rgba(59, 130, 246, 0.2);
  --cta-border-radius: 12px;
  --cta-padding-y: 12px;
  --cta-padding-x: 24px;
  --cta-font-size: 16px;
  --cta-font-weight: 600;
  --cta-gap: 8px;
  --cta-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   TRUST BADGE
   ============================================ */

.trust-badge {
  display: flex;
  align-items: center;
  gap: var(--trust-badge-gap);
  font-size: var(--trust-badge-font-size);
  font-weight: 500;
  opacity: 0.9;
  transition: opacity 0.3s ease;
  cursor: default;
  position: relative;
}

.trust-badge:hover {
  opacity: 1;
}

/* Trust icon (star) */
.trust-icon {
  width: var(--trust-badge-icon-size);
  height: var(--trust-badge-icon-size);
  flex-shrink: 0;
  fill: var(--trust-badge-color);
}

/* Trust text container */
.trust-text {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.trust-rating {
  font-weight: 600;
}

.trust-divider {
  opacity: 0.5;
}

.trust-count {
  font-weight: 400;
}

/* Compact version when scrolled (hide count on smaller screens) */
.site-header[data-header-scrolled="true"] .trust-badge {
  font-size: var(--trust-badge-font-size-scrolled);
}

/* Tooltip on hover */
.trust-badge[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: white;
  color: #1f2937;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 1001;
}

.trust-badge[data-tooltip]::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid white;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1001;
}

.trust-badge[data-tooltip]:hover::before,
.trust-badge[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   CTA BUTTON
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--cta-gap);
  padding: var(--cta-padding-y) var(--cta-padding-x);
  font-family: 'Inter', sans-serif;
  font-size: var(--cta-font-size);
  font-weight: var(--cta-font-weight);
  line-height: 1.5;
  text-decoration: none;
  border: none;
  border-radius: var(--cta-border-radius);
  cursor: pointer;
  transition: var(--cta-transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn--primary {
  background: var(--cta-gradient);
  color: white;
  box-shadow: var(--cta-shadow);
}

.btn--primary:hover {
  background: var(--cta-gradient-hover);
  box-shadow: var(--cta-shadow-hover);
  transform: scale(1.02);
  color: white;
  text-decoration: none;
}

.btn--primary:active {
  transform: scale(0.98);
  box-shadow: var(--cta-shadow-active);
}

.btn--primary:focus {
  outline: none;
  box-shadow: var(--cta-shadow-hover), 0 0 0 3px rgba(59, 130, 246, 0.25);
}

/* CTA icon */
.btn-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.btn--primary:hover .btn-icon {
  transform: translateX(2px);
}

/* CTA text */
.btn-text {
  flex-shrink: 0;
}

/* Loading state */
.btn[data-loading="true"] {
  cursor: wait;
  opacity: 0.7;
  pointer-events: none;
}

.btn[data-loading="true"] .btn-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   SCROLLED STATE ADJUSTMENTS
   ============================================ */

/* When header is scrolled, adjust CTA colors */
.site-header[data-header-scrolled="true"] .btn--primary {
  background: var(--cta-gradient);
  color: white;
}

.site-header[data-header-scrolled="true"] .btn--primary:hover {
  background: var(--cta-gradient-hover);
  color: white;
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */

@media (max-width: 1200px) {
  /* Hide trust count text on tablet */
  .trust-count {
    display: none;
  }

  .trust-divider {
    display: none;
  }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 1023px) {
  :root {
    --cta-padding-y: 10px;
    --cta-padding-x: 20px;
    --cta-font-size: 14px;
  }

  .trust-badge {
    display: none; /* Hide on mobile header, show in menu */
  }

  .btn-text {
    display: none; /* Show only icon on very small screens */
  }

  .btn-icon {
    margin: 0;
  }
}

@media (max-width: 480px) {
  :root {
    --cta-padding-y: 8px;
    --cta-padding-x: 16px;
  }

  /* Show abbreviated text on small mobile */
  .btn-text--short {
    display: inline;
  }

  .btn-text--full {
    display: none;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .header-actions {
    display: none;
  }
}

/* ============================================
   REDUCED MOTION SUPPORT
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .trust-badge,
  .btn,
  .btn-icon,
  .trust-badge[data-tooltip]::before,
  .trust-badge[data-tooltip]::after {
    transition: none !important;
    animation: none !important;
  }

  .btn--primary:hover {
    transform: none;
  }

  .btn--primary:active {
    transform: none;
  }

  .btn--primary:hover .btn-icon {
    transform: none;
  }

  .btn[data-loading="true"] .btn-icon {
    animation: none;
  }
}
