/**
 * Reference ID Badge Styles
 * Visual styling for unique reference IDs on all content cards
 */

/* Badge Container */
.ref-id-badge {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.85);
    color: #ffee00;
    font-size: 0.7em;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    border: 1px solid #ffee00;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 100;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

/* Position Variants */
.ref-id-top-right {
    top: 8px;
    right: 8px;
}

.ref-id-top-left {
    top: 8px;
    left: 8px;
}

.ref-id-bottom-right {
    bottom: 8px;
    right: 8px;
}

.ref-id-bottom-left {
    bottom: 8px;
    left: 8px;
}

/* Badge Text */
.ref-id-text {
    letter-spacing: 0.5px;
    line-height: 1;
}

/* Copy Icon */
.ref-id-copy-icon {
    font-size: 0.9em;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

/* Hover State */
.ref-id-badge:hover {
    background: #ffee00;
    color: #000000;
    border-color: #000000;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(255, 238, 0, 0.4);
}

.ref-id-badge:hover .ref-id-copy-icon {
    opacity: 1;
}

/* Active/Click State */
.ref-id-badge:active {
    transform: scale(0.98);
}

/* Copied State */
.ref-id-badge.copied {
    background: #28a745;
    color: #ffffff;
    border-color: #28a745;
    animation: copyPulse 0.3s ease;
}

/* Copy Pulse Animation */
@keyframes copyPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Type-Specific Colors */
.ref-id-badge[data-ref-id^="AGY-"] {
    border-color: #ffee00;
}

.ref-id-badge[data-ref-id^="NEWS-"] {
    border-color: #00d4ff;
    color: #00d4ff;
}

.ref-id-badge[data-ref-id^="NEWS-"]:hover {
    background: #00d4ff;
    color: #000000;
    border-color: #000000;
}

.ref-id-badge[data-ref-id^="GDE-"] {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.ref-id-badge[data-ref-id^="GDE-"]:hover {
    background: #ff6b6b;
    color: #ffffff;
    border-color: #ffffff;
}

.ref-id-badge[data-ref-id^="FAQ-"] {
    border-color: #a855f7;
    color: #a855f7;
}

.ref-id-badge[data-ref-id^="FAQ-"]:hover {
    background: #a855f7;
    color: #ffffff;
    border-color: #ffffff;
}

/* Mobile Responsiveness */
@media screen and (max-width: 768px) {
    .ref-id-badge {
        font-size: 0.65em;
        padding: 3px 8px;
        gap: 4px;
    }

    .ref-id-top-right,
    .ref-id-top-left,
    .ref-id-bottom-right,
    .ref-id-bottom-left {
        top: 6px;
        right: 6px;
    }

    .ref-id-copy-icon {
        display: none; /* Hide icon on mobile to save space */
    }
}

/* Print Styles - Show but don't style for printing */
@media print {
    .ref-id-badge {
        background: transparent;
        color: #000000;
        border: 1px solid #000000;
        font-size: 0.6em;
        box-shadow: none;
    }

    .ref-id-copy-icon {
        display: none;
    }
}

/* Tooltip on Desktop */
@media (hover: hover) and (pointer: fine) {
    .ref-id-badge::after {
        content: attr(title);
        position: absolute;
        bottom: calc(100% + 8px);
        left: 50%;
        transform: translateX(-50%);
        padding: 6px 10px;
        background: rgba(0, 0, 0, 0.9);
        color: #ffffff;
        font-size: 0.9em;
        font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
        font-weight: normal;
        white-space: nowrap;
        border-radius: 4px;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
        z-index: 1000;
    }

    .ref-id-badge:hover::after {
        opacity: 1;
    }
}

/* Accessibility - Focus State */
.ref-id-badge:focus {
    outline: 2px solid #ffee00;
    outline-offset: 2px;
}

.ref-id-badge:focus-visible {
    outline: 2px solid #ffee00;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .ref-id-badge {
        border-width: 2px;
        font-weight: 700;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .ref-id-badge,
    .ref-id-copy-icon {
        transition: none;
        animation: none;
    }

    .ref-id-badge:hover {
        transform: none;
    }

    .copyPulse {
        animation: none;
    }
}

/* Dark Mode Support (if implemented) */
@media (prefers-color-scheme: dark) {
    .ref-id-badge {
        background: rgba(0, 0, 0, 0.95);
    }
}
