/**
 * eAuction Nigeria - Proxy Bid Tooltip Styles (v1.1 - Hover + Wider Modal)
 */

/* ═══════════════════════════════════════════════════════════════════════════ */
/* TOOLTIP ICON - Conspicuous & Animated                                       */
/* ═══════════════════════════════════════════════════════════════════════════ */

.es-tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #008751;
  color: #fff;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-left: 8px;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(0, 135, 81, 0.25);
  animation: es-pulse 2.5s infinite;
  position: relative;
}

/* Pulsing ring animation to draw attention */
@keyframes es-pulse {
  0%   { box-shadow: 0 0 0 3px rgba(0, 135, 81, 0.35); }
  50%  { box-shadow: 0 0 0 7px rgba(0, 135, 81, 0.10); }
  100% { box-shadow: 0 0 0 3px rgba(0, 135, 81, 0.35); }
}

.es-tooltip-icon:hover,
.es-tooltip-icon:focus {
  background: #006b40;
  transform: scale(1.15);
  animation: none;
  box-shadow: 0 0 0 5px rgba(0, 135, 81, 0.3);
}

.es-tooltip-icon:focus {
  outline: 2px solid #00a854;
  outline-offset: 3px;
}

.es-tooltip-icon svg {
  width: 13px;
  height: 13px;
  display: block;
  stroke-width: 2.5;
}

/* "Hover for info" label beside the icon */
.es-tooltip-hint-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: #008751;
  background: rgba(0, 135, 81, 0.08);
  border: 1px solid rgba(0, 135, 81, 0.2);
  border-radius: 20px;
  padding: 2px 8px 2px 4px;
  margin-left: 6px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.es-tooltip-hint-label:hover {
  background: rgba(0, 135, 81, 0.15);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* TOOLTIP CONTAINER & POSITIONING - Wider                                     */
/* ═══════════════════════════════════════════════════════════════════════════ */

.es-tooltip-container {
  position: fixed;
  display: none;
  z-index: 10000;
  background: white;
  border: 1px solid #d4edda;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18), 0 4px 16px rgba(0, 135, 81, 0.12);
  /* Wider: was 420px */
  width: 560px;
  max-width: 560px;
  animation: es-slideIn 0.25s ease;
  pointer-events: auto;
  border-top: 3px solid #008751;
}

@keyframes es-slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* TOOLTIP CONTENT                                                             */
/* ═══════════════════════════════════════════════════════════════════════════ */

.es-tooltip-content {
  padding: 22px 24px;
  max-height: 520px;
  overflow-y: auto;
  position: relative;
}

.es-tooltip-title {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 700;
  color: #008751;
  border-bottom: 2px solid rgba(0, 135, 81, 0.2);
  padding-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.es-tooltip-title::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #008751;
  flex-shrink: 0;
}

.es-tooltip-body {
  font-size: 13.5px;
  color: #444;
  line-height: 1.7;
}

.es-tooltip-body p {
  margin: 8px 0;
}

.es-tooltip-body h5 {
  margin: 14px 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: #222;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.es-tooltip-body ol,
.es-tooltip-body ul {
  margin: 8px 0;
  padding-left: 20px;
}

.es-tooltip-body li {
  margin: 7px 0;
  line-height: 1.6;
  color: #555;
}

.es-tooltip-body li strong {
  color: #222;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* EXAMPLE BOX                                                                 */
/* ═══════════════════════════════════════════════════════════════════════════ */

.es-tooltip-example {
  background: #f0fdf4;
  border-left: 3px solid #00a854;
  padding: 12px 14px;
  margin: 12px 0;
  border-radius: 8px;
  font-size: 12.5px;
  color: #3a5c45;
  font-family: 'Courier New', 'Courier', monospace;
  line-height: 1.6;
}

.es-tooltip-example p {
  margin: 4px 0;
}

.es-tooltip-example p:first-child {
  margin-top: 0;
  font-weight: 700;
  color: #1a3a25;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* NOTE BOX                                                                    */
/* ═══════════════════════════════════════════════════════════════════════════ */

.es-tooltip-note {
  background: #fef8e7;
  border: 1px solid #fce08a;
  border-left: 3px solid #f59e0b;
  padding: 11px 14px;
  margin-top: 14px;
  border-radius: 8px;
  font-size: 12.5px;
  color: #7c5c0a;
  line-height: 1.6;
}

.es-tooltip-note strong {
  color: #5a3e00;
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* TOOLTIP LINK                                                                */
/* ═══════════════════════════════════════════════════════════════════════════ */

.es-tooltip-link {
  font-size: 11px;
  color: #00a854;
  font-weight: 600;
  margin-left: 4px;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.es-tooltip-link:hover {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* CLOSE BUTTON                                                                */
/* ═══════════════════════════════════════════════════════════════════════════ */

.es-tooltip-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0,0,0,0.05);
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #777;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.2s ease;
  line-height: 1;
}

.es-tooltip-close:hover {
  background: #f0f0f0;
  color: #222;
}

.es-tooltip-close:focus {
  outline: 2px solid #00a854;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* SCROLLBAR STYLING                                                           */
/* ═══════════════════════════════════════════════════════════════════════════ */

.es-tooltip-content::-webkit-scrollbar { width: 6px; }
.es-tooltip-content::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
.es-tooltip-content::-webkit-scrollbar-thumb { background: #00a854; border-radius: 10px; }
.es-tooltip-content::-webkit-scrollbar-thumb:hover { background: #008751; }
.es-tooltip-content { scrollbar-color: #00a854 #f1f1f1; scrollbar-width: thin; }

/* ═══════════════════════════════════════════════════════════════════════════ */
/* DARK MODE SUPPORT                                                           */
/* ═══════════════════════════════════════════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
  .es-tooltip-container {
    background: #1e2d26;
    border-color: #2d4a38;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  }
  .es-tooltip-title { color: #4ade80; border-bottom-color: rgba(74, 222, 128, 0.2); }
  .es-tooltip-body { color: #ccc; }
  .es-tooltip-body h5 { color: #e0e0e0; }
  .es-tooltip-body li strong { color: #e0e0e0; }
  .es-tooltip-example { background: #142a1e; border-left-color: #4ade80; color: #9ecfb0; }
  .es-tooltip-example p:first-child { color: #d0f0d8; }
  .es-tooltip-note { background: #2a2a14; border-color: #555522; color: #d0c080; }
  .es-tooltip-note strong { color: #ffd700; }
  .es-tooltip-link { color: #4ade80; }
  .es-tooltip-close:hover { background: #333; color: #ddd; }
  .es-tooltip-content::-webkit-scrollbar-track { background: #1a2a20; }
  .es-tooltip-content::-webkit-scrollbar-thumb { background: #2d6040; }
  .es-tooltip-hint-label { background: rgba(74,222,128,0.1); border-color: rgba(74,222,128,0.25); color: #4ade80; }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* MOBILE & TABLET RESPONSIVE DESIGN                                           */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* Tablet – slightly narrower */
@media (max-width: 640px) {
  .es-tooltip-container {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
  }
}

/* Mobile – full-width bottom sheet style */
@media (max-width: 768px) {
  .es-tooltip-container {
    position: fixed !important;
    /* Bottom sheet on mobile */
    bottom: 0 !important;
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 20px 20px 0 0 !important;
    border-top: 3px solid #008751 !important;
    animation: es-slideUp 0.3s ease !important;
    max-height: 85vh;
  }

  @keyframes es-slideUp {
    from { transform: translateY(100%); opacity: 0.5; }
    to   { transform: translateY(0);    opacity: 1; }
  }

  .es-tooltip-content {
    max-height: calc(85vh - 20px);
    padding: 18px 18px 28px;
    /* Extra bottom padding for iOS home bar */
    padding-bottom: max(28px, env(safe-area-inset-bottom, 28px));
  }

  .es-tooltip-title { font-size: 16px; }
  .es-tooltip-body  { font-size: 13px; }

  .es-tooltip-icon {
    width: 24px;
    height: 24px;
  }

  /* Drag handle indicator for bottom sheet */
  .es-tooltip-container::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: rgba(0,0,0,0.15);
    border-radius: 2px;
    margin: 10px auto 0;
  }

  /* Hide hint label on very small screens to save space */
  .es-tooltip-hint-label {
    display: none;
  }
}

@media (max-width: 480px) {
  .es-tooltip-body  { font-size: 12.5px; }
  .es-tooltip-example, .es-tooltip-note { font-size: 12px; padding: 10px 12px; }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* PRINT STYLES                                                                */
/* ═══════════════════════════════════════════════════════════════════════════ */

@media print {
  .es-tooltip-icon, .es-tooltip-container, .es-tooltip-hint-label { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ACCESSIBILITY - HIGH CONTRAST MODE                                          */
/* ═══════════════════════════════════════════════════════════════════════════ */

@media (prefers-contrast: more) {
  .es-tooltip-icon { border: 2px solid #fff; background: #008751; }
  .es-tooltip-container { border-width: 2px; }
  .es-tooltip-title { border-bottom-width: 3px; }
  .es-tooltip-example { border-left-width: 4px; }
  .es-tooltip-note { border-width: 2px; }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* REDUCED MOTION SUPPORT                                                      */
/* ═══════════════════════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  .es-tooltip-icon { transition: none; animation: none; }
  .es-tooltip-container { animation: none; }
  .es-tooltip-link, .es-tooltip-close { transition: none; }
}
