/**
 * Scripture Tooltips Styles
 * 
 * @package WA_Scripture_Tooltips
 */

/* Reference Spans */
.wa-st-ref {
    color: inherit;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: currentColor;
    cursor: pointer;
    outline: none;
    transition: opacity 0.2s ease;
}

.wa-st-ref:hover,
.wa-st-ref:focus {
    opacity: 0.7;
    text-decoration-style: solid;
}

.wa-st-ref:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    border-radius: 2px;
}

/* Tooltip Container */
#wa-st-tooltip {
    position: absolute;
    z-index: 2147483647; /* bring to front */
    max-width: var(--wa-st-max-width, 420px);
    background: var(--wa-st-bg, #0f172a);
    color: var(--wa-st-text, #ffffff);
    border-radius: var(--wa-st-radius, 12px);
    border: var(--wa-st-border-width, 0) solid var(--wa-st-border-color, transparent);
    padding: 16px 16px 18px 16px;
    font-size: 14px;
    line-height: 1.6;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    pointer-events: none;
}

/* Placement animations */
#wa-st-tooltip.wa-st-placement-above {
    transform: translateY(4px);
}

#wa-st-tooltip.wa-st-placement-below {
    transform: translateY(-4px);
}

#wa-st-tooltip.wa-st-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Shadow */
#wa-st-tooltip {
    box-shadow: var(--wa-st-shadow, 0 10px 25px rgba(0, 0, 0, 0.3));
}

/* Copy Button */
.wa-st-copy {
    position: absolute;
    top: 12px;
    right: 12px;
    background: transparent; /* no background by default */
    border: none;
    border-radius: 4px;
    padding: 6px;
    cursor: pointer;
    color: inherit; /* inherit tooltip text color so it works on white or dark */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease;
    z-index: 1;
}

.wa-st-copy:hover,
.wa-st-copy:focus {
    background: rgba(0, 0, 0, 0.15); /* increased contrast */
}

.wa-st-copy:active {
    background: rgba(0, 0, 0, 0.22);
}

/* Success state */
.wa-st-copy.wa-st-copied {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.wa-st-copy svg {
    display: block;
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

/* Header (verse reference) */
.wa-st-header {
    margin: 0 0 10px 0;
    padding-top: 0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.01em;
    opacity: 1;
}

/* Content */
.wa-st-content {
    margin: 0;
    padding: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.65;
}

/* Responsive */
@media (max-width: 768px) {
    #wa-st-tooltip {
        max-width: calc(100vw - 32px);
        font-size: 13px;
    }
}

/* Touch devices - larger hit target */
@media (hover: none) and (pointer: coarse) {
    .wa-st-ref {
        padding: 4px 0;
        margin: -4px 0;
    }

    .wa-st-copy {
        padding: 10px;
    }

    .wa-st-copy svg {
        width: 20px;
        height: 20px;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .wa-st-ref {
        text-decoration-style: solid;
        text-decoration-thickness: 2px;
    }
    
    #wa-st-tooltip {
        border: 2px solid currentColor;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .wa-st-ref,
    #wa-st-tooltip {
        transition: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    /* Tooltip already uses dark colors by default */
}

/* Print styles */
@media print {
    .wa-st-ref {
        text-decoration: none;
    }
    
    #wa-st-tooltip {
        display: none !important;
    }
}

