/* ═══════════════════════════════════════════════════════════ */
/*  Optistream — UX Global Fixes                             */
/*  Accessibility, Focus, Cursor, Motion, Scroll             */
/*  Applied site-wide via functions.php                       */
/* ═══════════════════════════════════════════════════════════ */

/* ═══ Skip to Content (a11y) ═══ */
.os-skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    background: #2579e8;
    color: #fff !important;
    padding: 0.75rem 1.5rem;
    border-radius: 0 0 12px 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: top 0.2s ease;
}
.os-skip-link:focus {
    top: 0;
    outline: none;
}

/* ═══ Focus States — Global ═══ */
*:focus-visible {
    outline: 2px solid #2579e8;
    outline-offset: 2px;
    border-radius: 4px;
}
/* Remove focus ring for mouse users */
*:focus:not(:focus-visible) {
    outline: none;
}

/* ═══ Cursor Pointer — All Clickable Elements ═══ */
a, button, [role="button"],
input[type="submit"], input[type="button"],
.os-article-card, .os-archive-card,
.os-guide-card, .os-setup-card,
.os-popular-card, .os-sidebar-guide-item,
.os-sidebar-pop-item, .os-sidebar-cta,
.os-trending-item, .os-cat-banner,
.os-s-card, .os-emote-card,
.os-error-card, .os-streamer-card,
.os-btn-outline, .os-btn-primary,
.os-pagination .page-numbers,
.os-filter-item select,
.os-hero-tag,
.toc-toggle,
.copypasta-btn {
    cursor: pointer;
}

/* ═══ Smooth Scroll ═══ */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* account for sticky header */
}

/* ═══ Reduced Motion ═══ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ═══ Selection Color ═══ */
::selection {
    background: rgba(37, 121, 232, 0.3);
    color: #fff;
}
::-moz-selection {
    background: rgba(37, 121, 232, 0.3);
    color: #fff;
}

/* ═══ Scrollbar Styling (site-wide) ═══ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #0f0f14;
}
::-webkit-scrollbar-thumb {
    background: #2a2a3a;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #3a3a4e;
}
/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #2a2a3a #0f0f14;
}

/* ═══ Image Loading ═══ */
img {
    max-width: 100%;
    height: auto;
}
img[loading="lazy"] {
    background: #16161e;
}

/* ═══ Card Hover Lift Effect — Universal ═══ */
.os-article-card:hover,
.os-archive-card:hover,
.os-setup-card:hover,
.os-s-card:hover {
    transform: translateY(-2px);
}

/* ═══ Link Underline Animation ═══ */
.entry-content a:not(.os-btn-primary):not(.os-btn-outline):not(.os-cta-link):not([class*="os-"]) {
    color: #2579e8;
    text-decoration: none;
    background-image: linear-gradient(#2579e8, #2579e8);
    background-size: 0% 1px;
    background-position: 0 100%;
    background-repeat: no-repeat;
    transition: background-size 0.25s ease;
}
.entry-content a:not(.os-btn-primary):not(.os-btn-outline):not(.os-cta-link):not([class*="os-"]):hover {
    background-size: 100% 1px;
}

/* ═══ Button Press Effect ═══ */
.os-btn-primary:active,
.os-btn-outline:active,
.os-sidebar-cta:active,
.copypasta-btn:active {
    transform: scale(0.97);
}

/* ═══ Toast / Notification (for copy-to-clipboard etc.) ═══ */
.os-toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #16161e;
    color: #e8e8ed;
    border: 1px solid rgba(37, 121, 232, 0.3);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    z-index: 99999;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.os-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ═══ Loading Skeleton ═══ */
@keyframes os-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.os-skeleton {
    background: linear-gradient(90deg, #16161e 25%, #1e1e2e 50%, #16161e 75%);
    background-size: 200% 100%;
    animation: os-shimmer 1.5s infinite;
    border-radius: 8px;
}

/* ═══ Better Table Styling (article content) ═══ */
.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: #16161e;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
}
.entry-content table th {
    background: rgba(37, 121, 232, 0.1);
    color: #e8e8ed;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.8rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.entry-content table td {
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    color: #b0b0c0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.entry-content table tr:last-child td {
    border-bottom: none;
}
.entry-content table tr:hover td {
    background: rgba(255,255,255,0.02);
}

/* ═══ Better Blockquote ═══ */
.entry-content blockquote {
    border-left: 3px solid #2579e8;
    background: rgba(37, 121, 232, 0.05);
    margin: 1.5rem 0;
    padding: 1.2rem 1.5rem;
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: #b0b0c0;
}

/* ═══ Code Blocks ═══ */
.entry-content code {
    background: rgba(255,255,255,0.06);
    color: #e8e8ed;
    padding: 0.15em 0.4em;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
}
.entry-content pre {
    background: #0a0a10;
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 1.2rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}
.entry-content pre code {
    background: none;
    padding: 0;
}

/* ═══ HR Separator ═══ */
.entry-content hr {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(37,121,232,0.3), transparent);
    margin: 2.5rem 0;
}

/* ═══ List Styling (articles) ═══ */
.entry-content ul:not([class]),
.entry-content ol:not([class]) {
    padding-left: 1.5rem;
    margin: 1rem 0;
}
.entry-content li {
    margin-bottom: 0.4rem;
    line-height: 1.7;
    color: #c8c8d8;
}
.entry-content ul:not([class]) li::marker {
    color: #2579e8;
}
.entry-content ol:not([class]) li::marker {
    color: #2579e8;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
}

/* ═══ Mobile Touch Target Fix ═══ */
@media (max-width: 768px) {
    .os-nav-list li a,
    .os-footer-nav a,
    .os-pagination .page-numbers {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Fix post navigation and related articles overflow */
.os-post-nav {
    max-width: 100% !important;
    overflow: hidden !important;
}
.os-related {
    max-width: 100% !important;
    overflow: hidden !important;
}
.articles-similaires {
    background: #16161e !important;
    border-left-color: #2579e8 !important;
    color: #ccc !important;
}
.articles-similaires h3 {
    color: #f1f5f9 !important;
}
.articles-similaires a {
    color: #60a5fa !important;
}
.bottom-bar {
    max-width: 100% !important;
    overflow: hidden !important;
}

/* === Comparatif Product Cards === */
.product-card {
    background: #16161e !important;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}
.product-card .product-cta,
a.product-cta {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    background: #ff9900 !important;
    color: #000 !important;
    font-weight: 700 !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    text-decoration: none !important;
    font-size: 0.95rem;
    transition: background 0.2s;
    border: none !important;
}
.product-card .product-cta:hover,
a.product-cta:hover {
    background: #e68a00 !important;
    color: #000 !important;
}
.price-tag {
    background: transparent !important;
    color: #fbbf24 !important;
    font-size: 1.3rem;
    font-weight: 700;
    padding: 0 !important;
    border: none !important;
}
.product-specs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}
.product-specs-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #1e293b;
    color: #ccc;
}
.product-specs-table td:first-child {
    color: #94a3b8;
    font-weight: 600;
    width: 40%;
}
.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin: 16px 0;
}
.pros-list, .cons-list {
    background: rgba(22,22,30,0.5);
    border-radius: 8px;
    padding: 16px;
}
.pros-list h4 { color: #4ade80 !important; }
.cons-list h4 { color: #f87171 !important; }
.pros-list li, .cons-list li {
    color: #ccc;
    margin-bottom: 6px;
}
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
}
.comparison-table th {
    background: #1e293b;
    color: #f1f5f9;
    padding: 10px;
    text-align: left;
}
.comparison-table td {
    padding: 10px;
    border-bottom: 1px solid #1e293b;
    color: #ccc;
}
.comparison-table tr:hover td {
    background: rgba(37,121,232,0.05);
}
.badge-best, .badge-value, .badge-budget {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.badge-best { background: #fbbf24; color: #000; }
.badge-value { background: #2579e8; color: #fff; }
.badge-budget { background: #4ade80; color: #000; }
.faq-item h3 {
    color: #f1f5f9 !important;
    cursor: pointer;
}
.bottom-bar {
    background: #16161e !important;
    border-top: 1px solid #1e293b;
    padding: 16px 24px;
    border-radius: 0 0 12px 12px;
}
.bottom-bar .product-cta,
.bottom-bar a.product-cta {
    background: #ff9900 !important;
    color: #000 !important;
}
@media (max-width: 768px) {
    .pros-cons { grid-template-columns: 1fr; }
}

/* ─── Bottom Bar Mobile Fix (Feb 28) ─── */
.bottom-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9999 !important;
    background: rgba(22,22,30,0.97) !important;
    backdrop-filter: blur(12px) !important;
    border-top: 1px solid rgba(37,121,232,0.3) !important;
    padding: 10px 16px !important;
    border-radius: 0 !important;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5) !important;
}
.bottom-bar-content {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    max-width: 900px !important;
    margin: 0 auto !important;
}
.bottom-bar-left {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 1 !important;
    min-width: 0 !important;
    overflow: hidden !important;
}
.bottom-bar-icon {
    width: 40px !important;
    height: 40px !important;
    border-radius: 6px !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
    background: rgba(255,255,255,0.05) !important;
}
/* Hide broken images gracefully */
.bottom-bar-icon[src=""],
.bottom-bar-icon:not([src]),
.bottom-bar-icon[src*="placeholder"] {
    display: none !important;
}
.bottom-bar-text strong {
    font-size: 0.8rem !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: block !important;
    max-width: 200px !important;
}
.bottom-bar-cta {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding: 8px 16px !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    border-radius: 6px !important;
    background: linear-gradient(135deg, #ff9900, #e68a00) !important;
    color: #000 !important;
    text-decoration: none !important;
}
@media (max-width: 768px) {
    .bottom-bar { padding: 8px 12px !important; }
    .bottom-bar-text { display: none !important; }
    .bottom-bar-icon { width: 32px !important; height: 32px !important; }
    .bottom-bar-cta { padding: 10px 20px !important; font-size: 0.85rem !important; }
    .bottom-bar-content { justify-content: flex-end !important; }
}
