/**
 * YSP Tooltips System Styles
 * Toast-style tooltips with multiple positions
 */

/* ============================================
   TOAST BASE STYLES
   ============================================ */

.ysp-toast {
    position: fixed;
    max-width: 320px;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.4;
    z-index: 999999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-out, transform 0.2s ease-out;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.ysp-toast.ysp-toast-visible {
    opacity: 1;
}

/* ============================================
   TOAST POSITIONS
   ============================================ */

/* Bottom Left (default) */
.ysp-toast-bottom-left {
    bottom: 20px;
    left: 20px;
    transform: translateY(10px);
}

.ysp-toast-bottom-left.ysp-toast-visible {
    transform: translateY(0);
}

/* Bottom Right */
.ysp-toast-bottom-right {
    bottom: 20px;
    right: 20px;
    transform: translateY(10px);
}

.ysp-toast-bottom-right.ysp-toast-visible {
    transform: translateY(0);
}

/* Top Left */
.ysp-toast-top-left {
    top: 20px;
    left: 20px;
    transform: translateY(-10px);
}

.ysp-toast-top-left.ysp-toast-visible {
    transform: translateY(0);
}

/* Top Right */
.ysp-toast-top-right {
    top: 20px;
    right: 20px;
    transform: translateY(-10px);
}

.ysp-toast-top-right.ysp-toast-visible {
    transform: translateY(0);
}

/* Bottom Center */
.ysp-toast-bottom-center {
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
}

.ysp-toast-bottom-center.ysp-toast-visible {
    transform: translateX(-50%) translateY(0);
}

/* Top Center */
.ysp-toast-top-center {
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
}

.ysp-toast-top-center.ysp-toast-visible {
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   TOOLTIP TRIGGER ELEMENTS
   ============================================ */

.ysp-has-tooltip {
    cursor: help;
    position: relative;
}

/* Subtle underline hint for text elements */
.ysp-has-tooltip:not(button):not(.ysp-taxonomy-filter-item) {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: rgba(0, 0, 0, 0.3);
}

.ysp-has-tooltip:hover:not(button) {
    text-decoration-color: rgba(0, 0, 0, 0.6);
}

/* Focus state for accessibility */
.ysp-has-tooltip:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: 2px;
}

/* ============================================
   TAXONOMY FILTER SPECIFIC
   ============================================ */

.ysp-taxonomy-filter {
    margin: 16px 0;
}

.ysp-taxonomy-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
}

.ysp-taxonomy-filter-header > span {
    font-weight: 600;
    font-size: 1rem;
    color: #2c3e50;
}

.ysp-taxonomy-filter-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ysp-taxonomy-filter-item {
    padding: 8px 14px;
    border-radius: 6px;
    background: #f5f5f5;
    color: #333;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.ysp-taxonomy-filter-item:hover {
    background: #e8e8e8;
    border-color: #667eea;
    transform: translateY(-1px);
}

.ysp-taxonomy-filter-item:active {
    transform: translateY(0);
}

.ysp-taxonomy-filter-item.active {
    background: #667eea;
    color: white;
    font-weight: 500;
}

/* ============================================
   TOAST TOGGLE CONTROL
   ============================================ */

.ysp-toast-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #666;
    cursor: pointer;
    user-select: none;
}

.ysp-toast-toggle input[type="checkbox"] {
    cursor: pointer;
    margin: 0;
}

.ysp-toast-toggle:hover {
    color: #333;
}

/* ============================================
   INFO ICON STYLE
   ============================================ */

.ysp-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    font-size: 12px;
    font-weight: bold;
    cursor: help;
    margin-left: 4px;
}

.ysp-info-icon:hover {
    background: #5568d3;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 640px) {
    .ysp-toast {
        max-width: calc(100vw - 40px);
        font-size: 0.85rem;
    }
    
    /* On mobile, always use bottom center */
    .ysp-toast {
        bottom: 20px !important;
        top: auto !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) translateY(10px) !important;
    }
    
    .ysp-toast.ysp-toast-visible {
        transform: translateX(-50%) translateY(0) !important;
    }
    
    .ysp-taxonomy-filter-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .ysp-taxonomy-filter-item {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
}

/* ============================================
   DARK MODE SUPPORT (optional)
   ============================================ */

@media (prefers-color-scheme: dark) {
    .ysp-toast {
        background: rgba(255, 255, 255, 0.95);
        color: #1a1a1a;
    }
    
    .ysp-taxonomy-filter-item {
        background: #2a2a2a;
        color: #e0e0e0;
    }
    
    .ysp-taxonomy-filter-item:hover {
        background: #3a3a3a;
    }
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */

/* High contrast mode support */
@media (prefers-contrast: high) {
    .ysp-toast {
        background: #000;
        border: 2px solid #fff;
    }
    
    .ysp-has-tooltip:focus {
        outline: 3px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .ysp-toast {
        transition: opacity 0.05s ease;
    }
    
    .ysp-taxonomy-filter-item {
        transition: none;
    }
}