/**
 * Contextual Help Tooltip Styles
 * Mobile-first responsive design with zoo-themed colors
 */

/* Base tooltip styles */
.contextual-help-tooltip {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: 400;
    text-align: left;
    word-wrap: break-word;
    background-clip: padding-box;
}

.contextual-help-tooltip strong {
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

/* Help indicators */
.help-indicator {
    animation: helpPulse 2s infinite;
    transition: opacity 0.2s ease;
}

.help-indicator:hover {
    opacity: 1 !important;
}

@keyframes helpPulse {
    0%, 70%, 100% { opacity: 0.7; }
    35% { opacity: 1; }
}

/* Interactive elements with help */
[data-help] {
    cursor: help;
    position: relative;
}

[data-help]:hover .help-indicator {
    opacity: 1;
}

/* Tooltip positioning variants */
.tooltip-top {
    margin-bottom: 8px;
}

.tooltip-bottom {
    margin-top: 8px;
}

.tooltip-left {
    margin-right: 8px;
}

.tooltip-right {
    margin-left: 8px;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .contextual-help-tooltip {
        max-width: calc(100vw - 20px) !important;
        font-size: 13px;
        padding: 10px 14px;
        border-radius: 10px;
        box-shadow: 0 2px 15px rgba(45, 90, 61, 0.25);
    }
    
    .help-indicator {
        font-size: 10px !important;
        top: -6px !important;
        right: -6px !important;
    }
    
    /* Larger touch targets on mobile */
    [data-help] {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .contextual-help-tooltip {
        border-width: 3px;
        font-weight: 500;
    }
    
    .tooltip-arrow {
        border-width: 10px !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .contextual-help-tooltip {
        transition: none;
    }
    
    .help-indicator {
        animation: none;
    }
    
    @keyframes helpPulse {
        0%, 100% { opacity: 0.7; }
    }
}

/* Dark mode support */
/* REMOVED DARK MODE MEDIA QUERY - TOOLTIPS USE CONSISTENT COLORS */
/* Tooltips maintain consistent styling regardless of device dark mode setting */

/* Focus styles for accessibility */
[data-help]:focus {
    outline: 2px solid #e6941a;
    outline-offset: 2px;
}

[data-help]:focus .help-indicator {
    opacity: 1;
    color: #e6941a;
}

/* Special styling for specific contexts */
.search-container [data-help] .help-indicator {
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
}

.form-group [data-help] .help-indicator {
    top: 0;
    right: 0;
}

.card [data-help] .help-indicator {
    top: 10px;
    right: 10px;
}

/* Button help indicators */
.btn[data-help] .help-indicator {
    top: -5px;
    right: -5px;
    background: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

/* Table cell help indicators */
td[data-help] .help-indicator,
th[data-help] .help-indicator {
    position: absolute;
    top: 2px;
    right: 2px;
}

/* Navigation help indicators */
.nav-item[data-help] .help-indicator {
    top: -3px;
    right: -3px;
}

/* Card help indicators */
.card-title[data-help] .help-indicator {
    position: relative;
    top: 0;
    right: 0;
    margin-left: 8px;
    display: inline-block;
}

/* Badge help indicators */
.badge[data-help] .help-indicator {
    top: -8px;
    right: -8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    padding: 2px;
}

/* Print styles */
@media print {
    .contextual-help-tooltip,
    .help-indicator {
        display: none !important;
    }
}

/* Loading state */
.contextual-help-loading .help-indicator {
    opacity: 0.3;
    animation: none;
}

/* Success/error states */
.contextual-help-success .help-indicator {
    color: #10b981;
}

.contextual-help-error .help-indicator {
    color: #ef4444;
}

/* Tooltip content styling */
.contextual-help-tooltip .fas,
.contextual-help-tooltip .far {
    margin-right: 6px;
    width: 14px;
    text-align: center;
}

.contextual-help-tooltip br + .fas,
.contextual-help-tooltip br + .far {
    margin-left: 22px;
    margin-right: 6px;
}

/* Custom tooltip themes */
.tooltip-theme-warning {
    border-color: #f59e0b !important;
    background: #fef3c7 !important;
    color: #92400e !important;
}

.tooltip-theme-info {
    border-color: #3b82f6 !important;
    background: #dbeafe !important;
    color: #1e40af !important;
}

.tooltip-theme-success {
    border-color: #10b981 !important;
    background: #d1fae5 !important;
    color: #047857 !important;
}

.tooltip-theme-error {
    border-color: #ef4444 !important;
    background: #fee2e2 !important;
    color: #dc2626 !important;
}