/* Tooltip styling for Climocast */
/* Custom theme for Tippy.js tooltips */

/* ===================================
   Tippy.js Custom Theme - Climocast
   =================================== */

.tippy-box[data-theme~="climocast"] {
  background-color: #1e293b;
  color: #f1f5f9;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
}

.tippy-box[data-theme~="climocast"][data-placement^="top"]
  > .tippy-arrow::before {
  border-top-color: #1e293b;
}

.tippy-box[data-theme~="climocast"][data-placement^="bottom"]
  > .tippy-arrow::before {
  border-bottom-color: #1e293b;
}

.tippy-box[data-theme~="climocast"][data-placement^="left"]
  > .tippy-arrow::before {
  border-left-color: #1e293b;
}

.tippy-box[data-theme~="climocast"][data-placement^="right"]
  > .tippy-arrow::before {
  border-right-color: #1e293b;
}

/* ===================================
   Tooltip Content Structure
   =================================== */

.tooltip-content {
  padding: 4px;
  line-height: 1.5;
}

.tooltip-title {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: #60a5fa;
  letter-spacing: -0.01em;
}

.tooltip-brief {
  margin: 0 0 8px 0;
  font-weight: 500;
  font-size: 14px;
  color: #f1f5f9;
  line-height: 1.4;
}

.tooltip-detail {
  margin: 0 0 12px 0;
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.5;
}

/* ===================================
   Tooltip Examples (for rain probabilities)
   =================================== */

.tooltip-examples {
  margin: 12px 0;
  padding: 8px 0;
  border-top: 1px solid rgba(203, 213, 225, 0.2);
}

.tooltip-example {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 12px;
  line-height: 1.4;
}

.tooltip-example:last-child {
  margin-bottom: 0;
}

.example-range {
  font-weight: 600;
  color: #60a5fa;
  white-space: nowrap;
  min-width: 60px;
}

.example-label {
  color: #cbd5e1;
  flex: 1;
}

/* ===================================
   Tooltip Link
   =================================== */

.tooltip-link {
  display: inline-block;
  color: #60a5fa;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(203, 213, 225, 0.2);
  transition: color 0.2s ease;
}

.tooltip-link:hover {
  color: #93c5fd;
  text-decoration: underline;
}

/* ===================================
   Info Icons (tooltip triggers)
   =================================== */

.info-icon {
  display: inline-block;
  margin-left: 4px;
  color: #60a5fa;
  cursor: help;
  font-style: normal;
  font-size: 16px;
  line-height: 1;
  vertical-align: middle;
  transition: color 0.2s ease, transform 0.2s ease;
}

.info-icon:hover {
  color: #93c5fd;
  transform: scale(1.1);
}

/* SVG info icons */
.info-icon svg {
  width: 18px;
  height: 18px;
  vertical-align: middle;
}

/* ===================================
   Responsive Adjustments
   =================================== */

/* Mobile devices */
@media (max-width: 640px) {
  .tippy-box[data-theme~="climocast"] {
    max-width: 280px !important;
    font-size: 13px;
  }

  .tooltip-title {
    font-size: 15px;
  }

  .tooltip-brief {
    font-size: 13px;
  }

  .tooltip-detail {
    font-size: 12px;
  }

  .tooltip-link {
    font-size: 12px;
  }

  .tooltip-example {
    font-size: 11px;
  }
}

/* Very small mobile devices */
@media (max-width: 380px) {
  .tippy-box[data-theme~="climocast"] {
    max-width: 240px !important;
    font-size: 12px;
  }

  .tooltip-title {
    font-size: 14px;
  }

  .tooltip-content {
    padding: 2px;
  }
}

/* ===================================
   Accessibility
   =================================== */

/* Ensure tooltips are keyboard accessible */
.tippy-box:focus {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .tippy-box[data-theme~="climocast"] {
    border: 2px solid #60a5fa;
  }

  .tooltip-link {
    text-decoration: underline;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .tippy-box[data-theme~="climocast"] {
    animation: none !important;
  }

  .info-icon:hover {
    transform: none;
  }
}

/* ===================================
   Dark Mode Support (future-proofing)
   =================================== */

@media (prefers-color-scheme: dark) {
  /* Tooltips already use dark theme, so no changes needed */
  /* But we can ensure consistency */
  .tippy-box[data-theme~="climocast"] {
    background-color: #1e293b;
  }
}

/* ===================================
   Print Styles (hide tooltips)
   =================================== */

@media print {
  .tippy-box {
    display: none !important;
  }

  .info-icon {
    display: none !important;
  }
}
