/*
  Tooltip styles adapted from popper.js
  https://popper.js.org/tooltip-examples.html
  
  This file contains styles for tooltips used throughout the DAC DB Plus plugin.
  The plugin uses Tippy.js (v6) for tooltip functionality.
  
  CUSTOMIZATION GUIDE FOR DEVELOPERS:
  ====================================
  
  To modify the calendar event tooltip appearance:
  
  1. BACKGROUND COLOR:
     - Line ~179: background-color: #FFFFFF !important;
     - Change to any color value (hex, rgb, etc.)
  
  2. BORDER:
     - Line ~181: border: 1px solid #CCCCCC !important;
     - Adjust width, style (solid/dashed/dotted), or color
     - To remove border entirely: border: none !important;
  
  3. ARROW COLOR:
     - Lines ~191-204: Controls arrow colors for different positions
     - Match these to your background color for seamless appearance
     - To remove arrow completely, add:
       .tippy-box[data-theme~='mmpro-dark'] .tippy-arrow {
           display: none !important;
       }
  
  4. SHADOW:
     - Line ~182: box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
     - Format: offset-x offset-y blur-radius color
     - For no shadow: box-shadow: none !important;
  
  5. Z-INDEX:
     - Multiple locations set to 2147483647 (maximum value)
     - This ensures tooltips appear above all other elements
     - Only modify if you have specific stacking context issues
  
  THEME USAGE:
  - Calendar tooltips use theme 'mmpro-dark' (despite the name, it's styled as light)
  - Other tooltips may use different themes or classes
  
  TROUBLESHOOTING:
  - If tooltips appear behind elements, check z-index values
  - If styles don't apply, check browser console for CSS conflicts
  - Ensure Tippy.js is properly loaded before attempting to style
*/

.mmpro-popper,
.mmpro-tooltip {
	position: absolute;
	z-index: 2147483647;
	background: #FFC107;
	color: black;
	width: 150px;
	border-radius: 3px;
	box-shadow: 0 0 2px rgba(0,0,0,0.5);
	padding: 10px;
	text-align: left;
	font-size: 14px;
}

/* Calendar-specific tooltip styles */
.mmpro-calendar-tooltip {
	background: #FFFFFF !important;
	color: #333333 !important;
	border: 1px solid #CCCCCC !important;
	border-radius: 6px !important;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
	padding: 12px !important;
	max-width: 300px !important;
	width: auto !important;
	font-size: 14px !important;
	line-height: 1.4 !important;
	z-index: 2147483647 !important;
}

.mmpro-calendar-tooltip__title {
	font-weight: bold !important;
	font-size: 16px !important;
	margin-bottom: 8px !important;
	color: #333333 !important;
}

.mmpro-calendar-tooltip__description {
	margin-bottom: 8px !important;
	color: #666666 !important;
}

.mmpro-calendar-tooltip__location,
.mmpro-calendar-tooltip__sector {
	font-size: 12px !important;
	color: #888888 !important;
	margin-bottom: 4px !important;
}

/* Simple fix for tooltip z-index issues */
[data-tippy-root] {
	z-index: 2147483647 !important;
}

.mmpro-tooltip--dark {
	background: #2f85d1;
	color: #FFFFFF;
	max-width: 200px;
	width: auto;
	font-size: .8rem;
	padding: .5em 1em;
}

.mmpro-popper .mmpro-popper__arrow,
.mmpro-tooltip .mmpro-tooltip-arrow {
	width: 0;
	height: 0;
	border-style: solid;
	position: absolute;
	margin: 5px;
}

.mmpro-tooltip .mmpro-tooltip-arrow,
.mmpro-popper .mmpro-popper__arrow {
	border-color: #FFC107;
}

.mmpro-tooltip--dark .mmpro-tooltip-arrow {
	border-color: #2f85d1;
}

.mmpro-popper[x-placement^="top"],
.mmpro-tooltip[x-placement^="top"] {
	margin-bottom: 5px;
}

.mmpro-popper[x-placement^="top"] .mmpro-popper__arrow,
.mmpro-tooltip[x-placement^="top"] .mmpro-tooltip-arrow {
	border-width: 5px 5px 0 5px;
	border-left-color: transparent;
	border-right-color: transparent;
	border-bottom-color: transparent;
	bottom: -5px;
	left: calc(50% - 5px);
	margin-top: 0;
	margin-bottom: 0;
}

.mmpro-popper[x-placement^="bottom"],
.mmpro-tooltip[x-placement^="bottom"] {
	margin-top: 5px;
}

.mmpro-tooltip[x-placement^="bottom"] .mmpro-tooltip-arrow,
.mmpro-popper[x-placement^="bottom"] .mmpro-popper__arrow {
	border-width: 0 5px 5px 5px;
	border-left-color: transparent;
	border-right-color: transparent;
	border-top-color: transparent;
	top: -5px;
	left: calc(50% - 5px);
	margin-top: 0;
	margin-bottom: 0;
}

.mmpro-tooltip[x-placement^="right"],
.mmpro-popper[x-placement^="right"] {
	margin-left: 5px;
}

.mmpro-popper[x-placement^="right"] .mmpro-popper__arrow,
.mmpro-tooltip[x-placement^="right"] .mmpro-tooltip-arrow {
	border-width: 5px 5px 5px 0;
	border-left-color: transparent;
	border-top-color: transparent;
	border-bottom-color: transparent;
	left: -5px;
	top: calc(50% - 5px);
	margin-left: 0;
	margin-right: 0;
}

.mmpro-tooltip[x-placement^="left"],
.mmpro-popper[x-placement^="left"] {
	margin-right: 5px;
}

.mmpro-popper[x-placement^="left"] .mmpro-popper__arrow,
.mmpro-tooltip[x-placement^="left"] .mmpro-tooltip-arrow {
	border-width: 5px 0 5px 5px;
	border-top-color: transparent;
	border-right-color: transparent;
	border-bottom-color: transparent;
	right: -5px;
	top: calc(50% - 5px);
	margin-left: 0;
	margin-right: 0;
}

/* Ensure calendar elements don't interfere with tooltip z-index */
.mmpro-calendar .fc-view-container {
	z-index: auto !important;
}

.mmpro-calendar .fc-view {
	z-index: auto !important;
}

.mmpro-calendar .fc-row {
	z-index: auto !important;
}

/* Ensure Tippy tooltips appear above all calendar elements */
.tippy-box[data-theme~='mmpro-dark'] {
	z-index: 2147483647 !important;
}

/* Additional specificity for calendar tooltips */
body > [data-tippy-root] {
	z-index: 2147483647 !important;
}

/* Customize Tippy.js tooltip appearance for calendar */
.tippy-box[data-theme~='mmpro-dark'] {
	background-color: #FFFFFF !important;
	color: #333333 !important;
	border: 1px solid #CCCCCC !important;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

/* Remove the default arrow and border */
.tippy-box[data-theme~='mmpro-dark'] .tippy-arrow {
	color: #FFFFFF !important;
}

.tippy-box[data-theme~='mmpro-dark'][data-placement^='top'] .tippy-arrow:before {
	border-top-color: #FFFFFF !important;
}

.tippy-box[data-theme~='mmpro-dark'][data-placement^='bottom'] .tippy-arrow:before {
	border-bottom-color: #FFFFFF !important;
}

.tippy-box[data-theme~='mmpro-dark'][data-placement^='left'] .tippy-arrow:before {
	border-left-color: #FFFFFF !important;
}

.tippy-box[data-theme~='mmpro-dark'][data-placement^='right'] .tippy-arrow:before {
	border-right-color: #FFFFFF !important;
}

/* Optional: Add a subtle border to the arrow */
.tippy-box[data-theme~='mmpro-dark'] .tippy-arrow:after {
	content: '';
	position: absolute;
	z-index: -1;
}

.tippy-box[data-theme~='mmpro-dark'][data-placement^='top'] .tippy-arrow:after {
	border-top-color: #CCCCCC !important;
	top: -1px;
}

/* Fix for interactive tooltips */
.tippy-box {
	z-index: 2147483647 !important;
}

/* Ensure the actual tooltip content is above everything */
[data-tippy-root] .tippy-box {
	z-index: 2147483647 !important;
	position: relative !important;
}

/* Remove any transform or will-change that might create stacking context issues */
.mmpro-calendar .fc-view-container,
.mmpro-calendar .fc-view,
.mmpro-calendar .fc-row,
.mmpro-calendar .fc-content-skeleton,
.mmpro-calendar .fc-helper-skeleton,
.mmpro-calendar .fc-bg {
	transform: none !important;
	will-change: auto !important;
}