/* Critical overrides to ensure styles are always applied */
html body .highlighted-content,
html body span.highlighted-content,
html body span[class*="highlighted-content"],
html body div.highlighted-content,
html body [class*="highlighted-content"],
html body [id*="highlight-"],
.highlighted-content,
span.highlighted-content,
div.highlighted-content,
[class*="highlighted-content"],
[id*="highlight-"] {
    background: #FFF134 !important;
    background-color: #FFF134 !important;
    color: #000000 !important;
    border-radius: 4px !important;
    padding: 2px 4px !important;
    display: inline !important;
    position: relative !important;
    box-shadow: none !important;
    line-height: inherit !important;
    margin: 0 !important;
    -webkit-box-decoration-break: clone !important;
    box-decoration-break: clone !important;
    text-shadow: none !important;
    -webkit-text-fill-color: #000000 !important;
    z-index: 100 !important;
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    cursor: default !important;
    transition: none !important;
    animation: none !important;
}

/* Hover effect for highlights */
html body .highlighted-content:hover,
html body [class*="highlighted-content"]:hover,
html body [id*="highlight-"]:hover,
.highlighted-content:hover,
[class*="highlighted-content"]:hover,
[id*="highlight-"]:hover {
    box-shadow: 0 0 0 1px rgba(255, 241, 52, 0.5) !important;
}

/* Special styling for highlights with annotations */
html body .highlighted-content[data-annotation],
html body [class*="highlighted-content"][data-annotation],
html body [id*="highlight-"][data-annotation],
.highlighted-content[data-annotation],
[class*="highlighted-content"][data-annotation],
[id*="highlight-"][data-annotation] {
    border-bottom: 2px dashed rgba(0,0,0,0.3) !important;
    cursor: help !important;
}

/* Fix for nested content that might inherit wrong styles */
html body .highlighted-content *,
html body [class*="highlighted-content"] *,
html body [id*="highlight-"] *,
.highlighted-content *,
[class*="highlighted-content"] *,
[id*="highlight-"] * {
    background: transparent !important;
    background-color: transparent !important;
}

/* Highlight remove button */
html body .remove-highlight-btn,
html body button.remove-highlight-btn,
.remove-highlight-btn {
    position: absolute !important;
    top: -10px !important;
    right: -10px !important;
    width: 20px !important;
    height: 20px !important;
    background-color: rgba(255,255,255,0.9) !important;
    border: 1px solid rgba(0,0,0,0.1) !important;
    border-radius: 10px !important;
    color: #000 !important;
    font-size: 12px !important;
    line-height: 1 !important;
    text-align: center !important;
    cursor: pointer !important;
    z-index: 100 !important;
    padding: 0 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.2s ease !important;
}

/* Show remove button on highlight hover */
html body .highlighted-content:hover .remove-highlight-btn,
html body [id*="highlight-"]:hover .remove-highlight-btn,
.highlighted-content:hover .remove-highlight-btn,
[id*="highlight-"]:hover .remove-highlight-btn {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Force dark, cyberpunk popup styles with maximum specificity */
html body .clipboard-save-popup,
html body div.clipboard-save-popup,
div.clipboard-save-popup,
.clipboard-save-popup {
    background: rgba(0, 0, 0, 0.95) !important;
    color: #00ff00 !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid #00ff00 !important;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5), inset 0 0 1px rgba(255, 255, 255, 0.2) !important;
}

/* Ensure popup content stays dark */
html body .clipboard-save-content,
.clipboard-save-content {
    background: rgba(0, 0, 0, 0.95) !important;
}

html body .clipboard-save-header,
.clipboard-save-header {
    background: rgba(0, 20, 0, 0.95) !important;
    border-bottom: 1px solid #00ff00 !important;
}

html body .clipboard-save-preview,
.clipboard-save-preview {
    background: rgba(0, 20, 0, 0.3) !important;
    color: #00ff00 !important;
}

/* Annotation styling */
html body #highlight-annotation,
#highlight-annotation {
    background-color: rgba(0, 20, 0, 0.3) !important;
    border: 1px solid rgba(0, 255, 0, 0.2) !important;
    color: #00ff00 !important;
}

/* Override all article content to ensure text selection works */
#articleView *,
.article-content *,
.article-content p,
.article-content div,
.article-content span,
article *,
.post-content * {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
}

/* Make sure selection is visible before saving */
::selection {
    background: #FFF134 !important;
    color: #000000 !important;
}
::-moz-selection {
    background: #FFF134 !important;
    color: #000000 !important;
}

/* Fallback for execCommand highlighting */
font[style*="background-color: rgb(255, 241, 52)"],
font[style*="background-color: #FFF134"],
font[style*="background-color: #fff134"],
font[style*="background: rgb(255, 241, 52)"],
font[style*="background: #FFF134"],
font[style*="background: #fff134"] {
    background: #FFF134 !important;
    background-color: #FFF134 !important;
    color: #000000 !important;
    border-radius: 4px !important;
    padding: 2px 4px !important;
}

/* Force cyberpunk dark style on notification alerts too */
.clipboard-notification {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    padding: 14px 18px !important;
    background: rgba(22, 22, 26, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 0 1px rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    font-size: 14px !important;
    z-index: 99999 !important;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif !important;
    animation: notification-appear 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    max-width: 320px !important;
    display: flex !important;
    align-items: center !important;
    border: 1px solid rgba(50, 50, 60, 0.8) !important;
}

/* Add animation keyframes */
@keyframes popup-appear {
    0% { opacity: 0; transform: translateY(10px) scale(0.98); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes notification-appear {
    0% { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Make sure links remain clickable */
.campaign-item a,
.blog-post-link,
.post-link,
article a,
.post-card a,
.post a,
.wp-block-latest-posts a,
.campaigns-of-week a {
    position: relative !important;
    z-index: 5 !important;
    cursor: pointer !important;
    text-decoration: underline !important;
    color: #0078D4 !important;
}

/* Ensure links have proper hover effects */
.campaign-item a:hover,
.blog-post-link:hover,
.post-link:hover,
article a:hover,
.post-card a:hover,
.post a:hover,
.wp-block-latest-posts a:hover,
.campaigns-of-week a:hover {
    text-decoration: underline !important;
    color: #0056b3 !important;
}

/* Ensure link focus states remain visible */
.campaign-item a:focus,
.blog-post-link:focus,
.post-link:focus,
article a:focus,
.post-card a:focus,
.post a:focus,
.wp-block-latest-posts a:focus,
.campaigns-of-week a:focus {
    outline: 2px solid #0078D4 !important;
    outline-offset: 2px !important;
}

/* Fix for annotation popups - ensure they don't cover content */
.highlighted-content .remove-highlight-btn {
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.2s ease !important;
}

.highlighted-content:hover .remove-highlight-btn {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Make database page links extra clickable */
.database-page a,
body[class*="database"] a,
.database a,
[class*="campaigns-of-week"] a,
[class*="campaign-item"] a,
[class*="blog-post"] a,
[class*="post-link"] a,
[class*="featured-campaign"] a {
    position: relative !important;
    z-index: 1000 !important;
    cursor: pointer !important;
    text-decoration: underline !important;
    color: #0078D4 !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    pointer-events: auto !important;
}

/* Extra styling for database links */
.campaign-item a,
.blog-post-link,
.post-link,
.post-title a,
.campaigns-of-week a,
.featured-campaigns a,
.latest-posts a {
    font-weight: 500 !important;
    display: inline-block !important;
    padding: 4px 0 !important;
    transition: all 0.2s ease !important;
    border-bottom: 1px solid transparent !important;
}

/* Special hover effects for database links */
.campaign-item a:hover,
.blog-post-link:hover,
.post-link:hover,
.post-title a:hover,
.campaigns-of-week a:hover,
.featured-campaigns a:hover,
.latest-posts a:hover {
    color: #005a9e !important;
    text-decoration: underline !important;
    text-decoration-thickness: 2px !important;
    border-bottom-color: currentColor !important;
}

/* Fix the database page link container */
.campaign-item,
.campaign-content,
.post-item,
.post-content,
.campaign-title,
.post-title {
    position: relative !important;
    z-index: 10 !important;
}

/* Ensure highlight functionality doesn't interfere with database links */
.campaign-item *::selection,
.blog-post-link *::selection,
.post-link *::selection,
.post-title *::selection,
.campaigns-of-week *::selection {
    background: transparent !important;
} 