/* Extrait de article.php (bloc <style> inline) le 2026-08-30.
   Externalise pour etre mis en cache par le navigateur : le .htaccess applique
   max-age=1an + immutable aux .css, et injectStyles ajoute ?v=filemtime.
   Avant : ces 35593 octets etaient retelecharges a CHAQUE page vue. */

/* ========================================
   ARTICLE PAGE - PREMIUM READING EXPERIENCE
   ======================================== */

/* Reading Progress Bar */
.reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, #4da900, #76b900, #4da900);
    background-size: 200% 100%;
    animation: shimmerLine 2s linear infinite;
    z-index: 9999;
    transition: width 0.1s linear;
    box-shadow: 0 0 8px rgba(77,169,0,0.4);
}

/* Entrance animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes shimmerLine {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.article-page {
    padding: 30px 0 80px;
    background: linear-gradient(180deg, #f8f9fb 0%, #f0f2f5 100%);
    min-height: 100vh;
}

/* Breadcrumb */
.article-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: #666;
    margin-bottom: 24px;
    padding: 14px 20px;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.04);
    animation: fadeIn 0.4s ease;
}

.article-breadcrumb a {
    color: #666;
    text-decoration: none;
    transition: color 0.25s;
}

.article-breadcrumb a:hover {
    color: #4da900;
}

.article-breadcrumb .separator {
    color: #ccc;
    font-size: 11px;
}

.article-breadcrumb .current {
    color: #1a1a1a;
    font-weight: 600;
}

/* Article Header */
.article-header {
    margin-bottom: 28px;
    animation: fadeInUp 0.5s ease both;
}

.article-category-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 18px;
    background: linear-gradient(135deg, #4da900 0%, #3d8600 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-radius: 20px;
    text-decoration: none;
    margin-bottom: 18px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(77,169,0,0.25);
}

.article-category-badge:hover {
    background: linear-gradient(135deg, #3d8600 0%, #2d6400 100%);
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(77,169,0,0.35);
}

.article-title {
    font-size: 36px;
    font-weight: 800;
    line-height: 1.2;
    color: #0f172a;
    margin: 0 0 16px;
    letter-spacing: -0.5px;
    animation: fadeInUp 0.5s ease 0.1s both;
}

.article-subtitle {
    font-size: 22px;
    line-height: 1.5;
    color: #334155;
    margin-bottom: 16px;
    font-weight: 600;
    animation: fadeInUp 0.5s ease 0.1s both;
}
.article-excerpt {
    font-size: 19px;
    line-height: 1.65;
    color: #475569;
    margin-bottom: 24px;
    font-weight: 400;
    animation: fadeInUp 0.5s ease 0.15s both;
}

/* Article Meta - Glass card */
.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    padding: 18px 24px;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 14px;
    margin-bottom: 28px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
    animation: fadeInUp 0.5s ease 0.2s both;
}

.article-author {
    display: flex;
    align-items: center;
    gap: 14px;
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4da900 0%, #2d6400 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 3px 12px rgba(77,169,0,0.3);
    transition: transform 0.3s ease;
}

.article-author:hover .author-avatar {
    transform: scale(1.08);
}

.author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.author-name {
    font-weight: 700;
    color: #0f172a;
    font-size: 15px;
    transition: color 0.2s;
}

.article-author:hover .author-name {
    color: #4da900;
}

.article-date {
    font-size: 13px;
    color: #64748b;
}

.article-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-wrap: wrap;
}

.article-stat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: #475569;
    padding: 6px 14px;
    background: #f1f5f9;
    border-radius: 20px;
    transition: all 0.25s ease;
    font-weight: 500;
}

.article-stat:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.article-stat i {
    color: #4da900;
    font-size: 13px;
}

/* Featured Image */
.article-featured-image {
    margin-bottom: 32px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    animation: scaleIn 0.6s ease 0.25s both;
    position: relative;
}

.article-featured-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, rgba(0,0,0,0.15), transparent);
    pointer-events: none;
}

.article-featured-image img {
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.article-featured-image:hover img {
    transform: scale(1.02);
}

/* Article Body */
.article-body {
    background: #fff;
    padding: 48px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    position: relative;
    animation: fadeInUp 0.5s ease 0.3s both;
}

.article-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 48px;
    right: 48px;
    height: 3px;
    background: linear-gradient(90deg, #4da900, #76b900, #4da900);
    border-radius: 0 0 2px 2px;
}

.article-content {
    font-size: 17.5px;
    line-height: 1.9;
    color: #334155;
}

.article-content p {
    margin-bottom: 22px;
}

.article-content p:first-of-type::first-letter {
    font-size: 3.2em;
    float: left;
    line-height: 0.85;
    margin: 4px 12px 0 0;
    font-weight: 800;
    color: #4da900;
}

.article-content h2 {
    font-size: 26px;
    font-weight: 800;
    margin: 40px 0 20px;
    color: #0f172a;
    padding-left: 18px;
    border-left: 4px solid #4da900;
    border-bottom: none;
    padding-bottom: 0;
    position: relative;
}

.article-content h3 {
    font-size: 22px;
    font-weight: 700;
    margin: 34px 0 16px;
    color: #1e293b;
}

.article-content h4 {
    font-size: 18px;
    font-weight: 600;
    margin: 28px 0 12px;
    color: #334155;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 30px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: box-shadow 0.3s ease;
}

.article-content img:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.14);
}

.article-content blockquote {
    margin: 32px 0;
    padding: 28px 32px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-left: 5px solid #4da900;
    font-style: italic;
    font-size: 18px;
    color: #334155;
    border-radius: 0 14px 14px 0;
    box-shadow: 0 2px 12px rgba(77,169,0,0.08);
    position: relative;
}

.article-content blockquote::before {
    content: '\201C';
    position: absolute;
    top: -8px;
    left: 16px;
    font-size: 60px;
    color: #4da900;
    opacity: 0.2;
    font-family: Georgia, serif;
    line-height: 1;
}

.article-content a {
    color: #4da900;
    text-decoration: none;
    border-bottom: 1px solid rgba(77,169,0,0.3);
    transition: all 0.2s;
}

.article-content a:hover {
    color: #3d8600;
    border-bottom-color: #3d8600;
}

.article-content ul, .article-content ol {
    margin: 22px 0;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 10px;
    padding-left: 6px;
}

.article-content ul li::marker {
    color: #4da900;
}

/* Tags */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid #e2e8f0;
    align-items: center;
}

.article-tags-label {
    font-weight: 700;
    color: #0f172a;
    font-size: 14px;
    margin-right: 4px;
}

.article-tag {
    display: inline-flex;
    align-items: center;
    padding: 7px 18px;
    background: #f1f5f9;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

/* Chips statiques (non cliquables) : pas d'effet hover facon bouton/lien. */
.article-tag:hover {
    background: #e2e8f0;
    color: #475569;
    text-decoration: none;
}

/* Share Section */
.article-share {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid #e2e8f0;
}

.share-label {
    font-weight: 700;
    color: #0f172a;
    font-size: 14px;
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 16px;
}

.share-btn:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    color: #fff;
}

.share-btn.facebook { background: linear-gradient(135deg, #1877f2, #0d65d9); }
.share-btn.twitter { background: linear-gradient(135deg, #1da1f2, #0d8ecf); }
.share-btn.linkedin { background: linear-gradient(135deg, #0077b5, #005e8c); }
.share-btn.whatsapp { background: linear-gradient(135deg, #25d366, #1ebe57); }
.share-btn.telegram { background: linear-gradient(135deg, #0088cc, #006da3); }

/* Loading State */
.article-loading {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: 16px;
}

.article-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f0f0f0;
    border-top-color: #4da900;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error State */
.article-error {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 16px;
}

.article-error i {
    font-size: 70px;
    color: #cbd5e1;
    margin-bottom: 20px;
}

.article-error h3 {
    font-size: 24px;
    color: #0f172a;
    margin-bottom: 10px;
}

.article-error p {
    color: #64748b;
    margin-bottom: 25px;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #4da900, #3d8600);
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(77,169,0,0.25);
}

.btn-back:hover {
    background: linear-gradient(135deg, #3d8600, #2d6400);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(77,169,0,0.35);
}

/* ============================================================
   AUDIO PLAYER (TTS) - Charte AlphaEco
   ============================================================ */
.audio-player {
    margin: 0 auto 28px;
    max-width: 100%;
    background: linear-gradient(135deg, #f8fffa 0%, #f0fdf4 100%);
    border: 1px solid #d1f0c8;
    border-radius: 16px;
    padding: 18px 22px;
    box-shadow: 0 2px 12px rgba(77, 169, 0, 0.06);
    transition: box-shadow .25s, transform .25s;
}
.audio-player:hover {
    box-shadow: 0 6px 24px rgba(77, 169, 0, 0.12);
}
.audio-player.is-playing {
    border-color: #4da900;
    box-shadow: 0 4px 20px rgba(77, 169, 0, 0.18);
}
.audio-player-header {
    display: flex;
    align-items: center;
    gap: 14px;
}
.audio-player-icon {
    flex: 0 0 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4da900 0%, #3d8600 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    box-shadow: 0 4px 12px rgba(77, 169, 0, 0.3);
}
.audio-player.is-playing .audio-player-icon {
    animation: ap-pulse 2s ease-in-out infinite;
}
@keyframes ap-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 12px rgba(77, 169, 0, 0.3); }
    50%      { transform: scale(1.06); box-shadow: 0 4px 20px rgba(77, 169, 0, 0.5); }
}
.audio-player-info {
    flex: 1 1 auto;
    min-width: 0;
}
.audio-player-title {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 2px;
    line-height: 1.3;
}
.audio-player-subtitle {
    font-size: 12px;
    color: #64748b;
    margin: 0;
}
.audio-player-play {
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 0;
    background: #4da900;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all .2s;
    box-shadow: 0 3px 10px rgba(77, 169, 0, 0.35);
}
.audio-player-play:hover {
    background: #3d8600;
    transform: scale(1.06);
    box-shadow: 0 5px 14px rgba(77, 169, 0, 0.5);
}
.audio-player-play:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}
.audio-player-play .icon-play  { display: inline-flex; }
.audio-player-play .icon-pause { display: none; }
.audio-player.is-playing .audio-player-play .icon-play  { display: none; }
.audio-player.is-playing .audio-player-play .icon-pause { display: inline-flex; }
.audio-player-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ap-spin .8s linear infinite;
}
.audio-player.is-loading .audio-player-spinner { display: block; }
.audio-player.is-loading .audio-player-play .icon-play,
.audio-player.is-loading .audio-player-play .icon-pause { display: none; }
@keyframes ap-spin { to { transform: rotate(360deg); } }

/* Controls (apparaissent au 1er play) */
.audio-player-controls {
    display: none;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed #d1f0c8;
}
.audio-player.is-active .audio-player-controls { display: block; }

.audio-player-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}
.audio-player-time {
    font-size: 12px;
    color: #64748b;
    font-variant-numeric: tabular-nums;
    flex: 0 0 auto;
    min-width: 38px;
    text-align: center;
}
.audio-player-bar {
    flex: 1 1 auto;
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: visible;
}
.audio-player-bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    background: linear-gradient(90deg, #4da900, #6cc91a);
    border-radius: 3px;
    transition: width .12s linear;
}
.audio-player-bar-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    background: #fff;
    border: 2px solid #4da900;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(77, 169, 0, 0.4);
    transition: left .12s linear;
    pointer-events: none;
}

.audio-player-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.audio-player-btn {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #475569;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all .18s;
}
.audio-player-btn:hover {
    border-color: #4da900;
    color: #4da900;
    background: #f8fffa;
}
.audio-player-btn.active {
    background: #4da900;
    border-color: #4da900;
    color: #fff;
}
.audio-player-error {
    display: none;
    margin-top: 10px;
    padding: 8px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #b91c1c;
    font-size: 12px;
}
.audio-player.has-error .audio-player-error { display: block; }

@media (max-width: 600px) {
    .audio-player { padding: 14px 16px; }
    .audio-player-icon { flex-basis: 38px; height: 38px; font-size: 16px; }
    .audio-player-play  { width: 44px; height: 44px; font-size: 16px; }
    .audio-player-title { font-size: 13px; }
    .audio-player-actions { gap: 6px; }
    .audio-player-btn { padding: 5px 10px; font-size: 11px; }
}

/* Responsive */
@media (max-width: 992px) {
    .article-title {
        font-size: 28px;
    }
    .article-excerpt {
        font-size: 17px;
    }
    .article-body {
        padding: 30px;
    }
    .article-body::before {
        left: 30px;
        right: 30px;
    }
    .article-content {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .article-page {
        padding: 16px 0 50px;
    }
    .article-title {
        font-size: 24px;
    }
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 16px 18px;
    }
    .article-stats {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
    }
    .article-body {
        padding: 24px 18px;
        border-radius: 12px;
    }
    .article-body::before {
        left: 18px;
        right: 18px;
    }
    .article-content h2 {
        font-size: 22px;
    }
    .article-content p:first-of-type::first-letter {
        font-size: 2.6em;
    }
    .article-featured-image {
        border-radius: 12px;
    }
    .article-breadcrumb {
        padding: 10px 14px;
    }
}

/* ===== AI CHAT WIDGET ===== */
.ai-chat-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #76b900, #5a8f00);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 4px 16px rgba(118, 185, 0, 0.4);
    transition: all 0.3s ease;
    z-index: 1050;
}

.ai-chat-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 24px rgba(118, 185, 0, 0.5);
}

.ai-chat-fab::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 66px;
    background: #1e293b;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}

.ai-chat-fab:hover::after {
    opacity: 1;
}

.ai-chat-fab.open {
    background: linear-gradient(135deg, #3d8600, #2d6400);
    box-shadow: 0 4px 16px rgba(61, 134, 0, 0.5);
    font-size: 20px;
}

.ai-chat-fab.open:hover {
    box-shadow: 0 6px 24px rgba(61, 134, 0, 0.6);
}

.ai-chat-panel {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    max-height: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    z-index: 1049;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s ease;
}

.ai-chat-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.ai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, #76b900, #5a8f00);
    color: #fff;
}

.ai-chat-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-chat-header-left i {
    font-size: 22px;
}

.ai-chat-header-left span {
    font-size: 15px;
    font-weight: 600;
}

.ai-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    padding: 0;
    line-height: 1;
}

.ai-chat-close:hover {
    opacity: 1;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 200px;
    max-height: 300px;
    background: #f8f9fa;
}

.ai-chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.55;
    word-wrap: break-word;
}

.ai-chat-msg.bot {
    align-self: flex-start;
    background: #fff;
    color: #333;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

.ai-chat-msg.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #76b900, #5a8f00);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.ai-chat-msg.error {
    align-self: flex-start;
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    border-bottom-left-radius: 4px;
}

.ai-chat-msg.bot strong {
    font-weight: 700;
    color: #1a1a1a;
}

.ai-chat-msg.bot p {
    margin: 0 0 8px;
}

.ai-chat-msg.bot p:last-child {
    margin-bottom: 0;
}

.ai-chat-msg.bot ul {
    margin: 6px 0;
    padding-left: 18px;
}

.ai-chat-msg.bot ul li {
    margin-bottom: 4px;
}

.ai-chat-msg.bot br + br {
    display: none;
}

.ai-chat-typing {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
}

.ai-chat-typing span {
    font-size: 13px;
    color: #888;
}

.ai-typing-dots {
    display: flex;
    gap: 4px;
}

.ai-typing-dots i {
    width: 6px;
    height: 6px;
    background: #76b900;
    border-radius: 50%;
    animation: aiTypingBounce 1.4s infinite;
}

.ai-typing-dots i:nth-child(2) { animation-delay: 0.2s; }
.ai-typing-dots i:nth-child(3) { animation-delay: 0.4s; }

@keyframes aiTypingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

.ai-chat-quick-actions {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid #f0f0f0;
    background: #fff;
    flex-wrap: wrap;
}

.ai-quick-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    border: 1.5px solid #76b900;
    background: #f8fdf4;
    color: #5a8f00;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.ai-quick-btn:hover {
    background: #76b900;
    color: #fff;
}

.ai-quick-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ai-chat-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #f0f0f0;
    background: #fff;
}

.ai-chat-input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 24px;
    font-size: 13.5px;
    outline: none;
    transition: border-color 0.2s;
    background: #f8f9fa;
}

.ai-chat-input:focus {
    border-color: #76b900;
    background: #fff;
}

.ai-chat-send {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #76b900, #5a8f00);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.ai-chat-send:hover {
    transform: scale(1.08);
    box-shadow: 0 3px 10px rgba(118, 185, 0, 0.4);
}

.ai-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

@media (max-width: 480px) {
    .ai-chat-panel {
        right: 0;
        left: 0;
        bottom: 0;
        width: 100%;
        max-height: 85vh;
        border-radius: 16px 16px 0 0;
    }
    .ai-chat-fab {
        bottom: 20px;
        right: 20px;
    }
    .ai-chat-messages {
        max-height: 50vh;
    }
}

/* ===== COMMENTS SECTION ===== */
.article-comments-section {
    background: #fff;
    padding: 35px 40px;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.06);
    margin-top: 28px;
    animation: fadeInUp 0.5s ease 0.4s both;
}
.comments-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}
.comments-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}
.comments-title i { color: #4da900; }
.comments-count {
    background: #4da900;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
}
/* Comment Form */
.comment-form-login {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 25px;
}
.comment-form-login i { font-size: 28px; color: #ccc; margin-bottom: 10px; }
.comment-form-login p { color: #666; margin: 10px 0 15px; }
.btn-comment-login {
    display: inline-block;
    padding: 10px 24px;
    background: #4da900;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
}
.btn-comment-login:hover { background: #3d8600; color: #fff; text-decoration: none; }
.comment-form {
    display: flex;
    gap: 14px;
    margin-bottom: 25px;
}
.comment-form-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4da900, #3d8600);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}
.comment-form-input { flex: 1; }
.comment-form-input textarea {
    width: 100%;
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 70px;
    transition: border-color 0.2s;
    outline: none;
    box-sizing: border-box;
}
.comment-form-input textarea:focus { border-color: #4da900; }
.comment-form-reply-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: #f0f9e8;
    border-radius: 6px;
    margin-top: 8px;
    font-size: 13px;
    color: #555;
}
.cancel-reply {
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}
.cancel-reply:hover { color: #e53e3e; }
.comment-form-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}
.btn-comment-submit {
    padding: 8px 20px;
    background: #4da900;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.btn-comment-submit:hover { background: #3d8600; transform: translateY(-1px); }
.btn-comment-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
/* Comment Item */
.comment-item {
    display: flex;
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid #f0f0f0;
}
.comment-item:last-child { border-bottom: none; }
.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e8e8e8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: #666;
    flex-shrink: 0;
}
.comment-avatar.author-reply {
    background: linear-gradient(135deg, #4da900, #3d8600);
    color: #fff;
}
.comment-body { flex: 1; min-width: 0; }
.comment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.comment-author-name { font-weight: 600; font-size: 14px; color: #1a1a1a; }
.comment-author-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    background: #4da900;
    color: #fff;
    text-transform: uppercase;
}
.comment-date { font-size: 12px; color: #999; }
.comment-edited { font-size: 11px; color: #bbb; font-style: italic; }
.comment-text { font-size: 14px; line-height: 1.6; color: #444; margin-bottom: 8px; word-wrap: break-word; }
.comment-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}
.comment-action-btn {
    background: none;
    border: none;
    font-size: 12px;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 0;
    transition: color 0.2s;
}
.comment-action-btn:hover { color: #4da900; }
.comment-action-btn.liked { color: #e53e3e; }
.comment-action-btn.liked i { font-weight: 900; }
/* Replies */
.comment-replies {
    margin-left: 54px;
    border-left: 2px solid #f0f0f0;
    padding-left: 16px;
}
.comment-replies .comment-item { padding: 12px 0; }
.comment-replies .comment-avatar { width: 32px; height: 32px; font-size: 13px; }
/* Load More */
.btn-load-more {
    display: block;
    width: 100%;
    padding: 12px;
    background: #f8f9fa;
    border: 2px solid #e8e8e8;
    border-radius: 8px;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: all 0.2s;
}
.btn-load-more:hover { border-color: #4da900; color: #4da900; background: #f8fdf4; }
@media (max-width: 768px) {
    .article-comments-section { padding: 20px 15px; }
    .comment-replies { margin-left: 30px; padding-left: 10px; }
}
/* Toast */
.comment-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    max-width: 90%;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.comment-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.comment-toast.error { background: #e53e3e; }
.comment-toast.warning { background: #dd6b20; }
.comment-toast.success { background: #38a169; }
/* Confirm modal */
.comment-confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.comment-confirm-overlay.visible { opacity: 1; }
.comment-confirm-box {
    background: #fff;
    border-radius: 12px;
    padding: 28px 24px 20px;
    max-width: 360px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    text-align: center;
}
.comment-confirm-msg {
    font-size: 15px;
    color: #333;
    margin: 0 0 20px;
    line-height: 1.5;
}
.comment-confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.comment-confirm-cancel,
.comment-confirm-ok {
    padding: 9px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}
.comment-confirm-cancel {
    background: #f3f4f6;
    color: #555;
}
.comment-confirm-cancel:hover { background: #e5e7eb; }
.comment-confirm-ok {
    background: #e53e3e;
    color: #fff;
}
.comment-confirm-ok:hover { background: #c53030; }

/* ===== PAYWALL STYLES ===== */
.article-content-wrapper {
    position: relative;
}

.article-content-wrapper.premium-locked .article-content {
    max-height: 400px;
    overflow: hidden;
    position: relative;
}

.article-content-wrapper.premium-locked .article-content::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.9) 50%, rgba(255,255,255,1) 100%);
    pointer-events: none;
}

.paywall-overlay {
    background: linear-gradient(135deg, #ffffff 0%, #f9fffe 100%);
    border: 2px solid #f59e0b;
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
    margin-top: -60px;
    position: relative;
    z-index: 10;
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.15);
}

.paywall-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.paywall-icon i {
    font-size: 36px;
    color: #ffffff;
}

/* Paywall badge — styles in website.css, only page-specific overrides here */
.paywall-badge {
    margin-bottom: 20px;
}

.paywall-title {
    font-size: 26px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 12px;
    line-height: 1.3;
}

.paywall-description {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    margin: 0 0 25px;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
}

.paywall-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.paywall-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #333;
    background: #f8fdf4;
    padding: 10px 16px;
    border-radius: 8px;
    border-left: 3px solid #4da900;
}

.paywall-feature i {
    color: #4da900;
    font-size: 14px;
}

.paywall-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 320px;
    margin: 0 auto;
}

.btn-paywall-subscribe {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 28px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-paywall-subscribe:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
    color: #ffffff;
    text-decoration: none;
}

.btn-paywall-subscribe i {
    font-size: 18px;
}

.btn-paywall-login {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: 2px solid #e0e0e0;
    color: #666;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-paywall-login:hover {
    border-color: #4da900;
    color: #4da900;
    text-decoration: none;
}

.paywall-note {
    font-size: 13px;
    color: #888;
    margin-top: 20px;
}

.paywall-note a {
    color: #4da900;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .paywall-overlay {
        padding: 30px 20px;
        margin-top: -40px;
    }

    .paywall-icon {
        width: 60px;
        height: 60px;
    }

    .paywall-icon i {
        font-size: 28px;
    }

    .paywall-title {
        font-size: 22px;
    }

    .paywall-description {
        font-size: 14px;
    }

    .paywall-features {
        flex-direction: column;
        align-items: center;
    }

    .paywall-feature {
        width: 100%;
        justify-content: center;
    }
}
