/**
 * Footnote Marker Styles for Maharashtra Prohibition Act
 * -------------------------------------------------------
 * Superscript markers that show amendment details on hover/click.
 * Works with the existing sfn() modal system.
 */

/* Superscript footnote marker link */
.fn-marker {
    color: #d35400;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.75em;
    vertical-align: super;
    line-height: 0;
    padding: 0 1px;
    cursor: pointer;
    transition: color 0.2s ease, background-color 0.2s ease;
    border-bottom: 1px dotted #d35400;
    position: relative;
}

.fn-marker:hover {
    color: #fff;
    background-color: #d35400;
    border-radius: 2px;
    border-bottom-color: transparent;
}

/* Make superscript not affect line height */
sup:has(.fn-marker) {
    line-height: 0;
    vertical-align: baseline;
    position: relative;
    top: -0.4em;
}

/* Tooltip on hover (CSS-only, fallback for non-JS) */
.fn-marker[title] {
    position: relative;
}

.fn-marker[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 400;
    white-space: normal;
    max-width: 300px;
    width: max-content;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    line-height: 1.4;
    pointer-events: none;
}

.fn-marker[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #2c3e50;
    z-index: 1001;
}

/* Existing highlighted amendment text (yellow background in current system) */
.section-block span[style*="background-color:#f1c40f"] {
    background-color: #fef9e7 !important;
    border-bottom: 2px solid #f39c12;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .fn-marker {
        color: #e67e22;
        border-bottom-color: #e67e22;
    }
    .fn-marker:hover {
        color: #fff;
        background-color: #e67e22;
    }
    .fn-marker[title]:hover::after {
        background: #1a252f;
    }
    .fn-marker[title]:hover::before {
        border-top-color: #1a252f;
    }
}

/* Print: show footnote number only, no tooltip */
@media print {
    .fn-marker {
        color: #333 !important;
        border: none !important;
        background: none !important;
    }
    .fn-marker::after,
    .fn-marker::before {
        display: none !important;
    }
}
