/* Base Theme Adjustments */
html {
    scroll-behavior: smooth;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.dark ::-webkit-scrollbar-track {
    background: #1f2937;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #4b5563;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* Input Placeholder Color tweaks for dark mode */
.dark ::placeholder {
    color: #9ca3af;
    opacity: 1;
}

/* Social Share floating button animation on hover */
.fixed.bottom-4.end-4 a,
.fixed.bottom-4.right-4 a {
    transition: transform 0.2s ease, filter 0.2s ease;
}

.fixed.bottom-4.end-4 a:hover,
.fixed.bottom-4.right-4 a:hover {
    transform: translateY(-2px);
    filter: brightness(1.2);
}

/* Glassmorphism utility */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.dark .glass {
    background: rgba(31, 41, 55, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Pulse Animation for progress bar text */
@keyframes pulse-soft {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

#progress-container:not(.hidden) #progress-text {
    animation: pulse-soft 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Fade In Animation for results */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#results-section:not(.hidden) {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Make standard text links inside paragraphs and prose red */
p a:not([class]),
.prose a {
    color: #e60023;
    text-decoration: underline;
    transition: color 0.2s;
}

p a:not([class]):hover,
.prose a:hover {
    color: #7f1d1d;
}

.dark p a:not([class]),
.dark .prose a {
    color: #ef4444;
}

.dark p a:not([class]):hover,
.dark .prose a:hover {
    color: #fca5a5;
}

/* RTL & Logical CSS Support */
[dir="rtl"] .rtl-flip {
    transform: scaleX(-1);
}

[dir="rtl"] .group:hover .rtl-flip-hover {
    transform: scaleX(-1) translateX(0.25rem);
}

/* Keep Pinterest URLs readable in LTR inside RTL layouts while preserving natural placeholder alignment */
input.pinterest-url-input {
    direction: ltr;
    unicode-bidi: plaintext;
    text-align: start;
}

[dir="rtl"] input.pinterest-url-input:placeholder-shown {
    direction: rtl;
    text-align: start;
}

/* Code blocks and kbd tags stay LTR even inside RTL articles */
[dir="rtl"] code,
[dir="rtl"] pre,
[dir="rtl"] kbd {
    direction: ltr;
    unicode-bidi: embed;
    margin-inline-start: 0.125rem;
    margin-inline-end: 0.125rem;
}

/* Logical spacing helper for prose lists */
.prose ul,
.prose ol {
    padding-inline-start: 1.5rem;
    text-align: start;
}
