/**
 * AI Assistant Styles - Full Refactor
 * Enhanced with Yellow, Blue, Violet Button Shading
 * Supports: English, Tagalog, Bisaya (Cebuano)
 * Enhanced Legislative Research Assistant with ViewPDF Integration
 */

/* ==================== AI CHAT BUTTON - Ask Edgar ==================== */
.ai-chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 16px;
    border-radius: 25px;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(30, 58, 138, 0.4);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: pulse-button 2s ease-in-out infinite;
}

.ai-chat-button .ask-edgar-icon {
    font-size: 18px;
    line-height: 1;
}

.ai-chat-button .ask-edgar-text {
    color: white;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

@keyframes pulse-button {
    0%, 100% { box-shadow: 0 4px 16px rgba(30, 58, 138, 0.4); }
    50% { box-shadow: 0 4px 20px rgba(59, 130, 246, 0.6); }
}

.ai-chat-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(30, 58, 138, 0.5);
    animation: none;
}

.ai-chat-button.active {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
    animation: none;
}

.ai-chat-button.active .ask-edgar-icon,
.ai-chat-button.active .ask-edgar-text {
    display: none;
}

.ai-chat-button svg {
    width: 18px;
    height: 18px;
    fill: white;
    transition: all 0.3s ease;
}

.ai-chat-button .close-icon { display: none; }
.ai-chat-button.active .close-icon { display: block; }

/* ==================== EDGAR'S NEWS TICKER BAR ==================== */
.edgar-news-ticker {
    position: fixed;
    bottom: 24px;
    right: 140px;
    width: 180px;
    height: 28px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(220, 38, 38, 0.4);
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.edgar-news-ticker:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.5);
}

.edgar-news-ticker-label {
    background: rgba(0, 0, 0, 0.3);
    color: #fbbf24;
    font-size: 8px;
    font-weight: 700;
    padding: 2px 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.edgar-news-ticker-content {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
}

.edgar-news-ticker-text {
    position: absolute;
    white-space: nowrap;
    color: white;
    font-size: 10px;
    font-weight: 500;
    line-height: 28px;
    animation: ticker-scroll 12s linear infinite;
    padding-left: 100%;
}

@keyframes ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.edgar-news-ticker.flash {
    animation: ticker-flash 0.5s ease-in-out;
}

@keyframes ticker-flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); }
}

/* Tooltip on hover */
.edgar-news-ticker::after {
    content: 'Click for News | Alt+F5 to Refresh';
    position: absolute;
    bottom: 100%;
    right: 0;
    background: #1e293b;
    color: white;
    font-size: 9px;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    margin-bottom: 5px;
}

.edgar-news-ticker:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .edgar-news-ticker {
        width: 120px;
        right: 100px;
        bottom: 22px;
    }
    .edgar-news-ticker-label {
        font-size: 7px;
        padding: 2px 4px;
    }
    .edgar-news-ticker-text {
        font-size: 9px;
    }
}

/* ==================== CNN-STYLE NEWS TICKER BAR ==================== */
.cnn-news-ticker-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 28px;
    background: linear-gradient(180deg, #660000 0%, #4d0000 100%);
    display: flex;
    align-items: center;
    z-index: 10000;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.2);
    font-family: 'Segoe UI', Arial, sans-serif;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

.cnn-news-ticker-bar.hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

.cnn-ticker-label {
    background: linear-gradient(180deg, #1a1a1a 0%, #000000 100%);
    color: #ffd700;
    font-size: 11px;
    font-weight: 800;
    padding: 0 12px;
    height: 100%;
    display: flex;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border-right: 2px solid #ffd700;
    flex-shrink: 0;
}

.cnn-ticker-scroll-wrapper {
    flex: 1 1 auto;
    overflow: hidden;
    height: 100%;
    position: relative;
    min-width: 0;
}

.cnn-ticker-content {
    display: inline-flex;
    white-space: nowrap;
    will-change: transform, opacity;
    width: 100%;
}

/* Notification mode - shows one message at a time */
.cnn-ticker-content.cycling-mode {
    animation: none !important;
    justify-content: flex-start;
    padding-left: 10px;
    display: flex;
    align-items: center;
    height: 100%;
}

.cnn-ticker-content.cycling-mode .cnn-ticker-item {
    opacity: 1;
    display: inline-flex;
    align-items: center;
    animation: notification-text-appear 0.5s ease-out;
}

@keyframes notification-text-appear {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Scrolling mode (for alerts or when preferred) */
.cnn-ticker-content.scroll-mode {
    animation: cnn-ticker-scroll var(--ticker-duration, 30s) linear infinite;
    animation-play-state: running;
}

.cnn-ticker-content.scroll-mode:hover {
    animation-play-state: paused;
}

.cnn-ticker-item {
    display: inline-flex;
    align-items: center;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    padding: 0 15px 0 10px;
    line-height: 24px;
    gap: 8px;
    flex-shrink: 0;
}

.cnn-ticker-item::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #ffd700;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Seamless loop - content is duplicated, scroll by 50% */
@keyframes cnn-ticker-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes cnn-item-flash {
    0%, 100% { color: #ffffff; }
    50% { color: #ffd700; text-shadow: 0 0 10px #ffd700; }
}

/* ========== CLICKABLE NEWS LINKS ========== */

/* Make ticker content clickable */
.cnn-ticker-scroll-wrapper {
    pointer-events: auto !important;
    z-index: 10;
}

.cnn-ticker-content {
    pointer-events: auto !important;
}

.cnn-ticker-item {
    pointer-events: auto !important;
}

/* Clickable link styling for news items */
.cnn-ticker-link {
    color: inherit;
    text-decoration: none;
    cursor: pointer !important;
    transition: all 0.2s ease;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    pointer-events: auto !important;
    position: relative;
    z-index: 100;
}

.cnn-ticker-link:hover {
    color: #ffd700;
}

.cnn-ticker-link:active {
    transform: scale(0.98);
}

/* Link text styling */
.ticker-link-text {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Link icon (🔗) styling - BEFORE the title */
.ticker-link-icon {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    background: rgba(255, 215, 0, 0.3);
    padding: 2px 5px;
    border-radius: 4px;
    margin-right: 6px;
    animation: pulse-icon 1.5s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse-icon {
    0%, 100% {
        opacity: 0.8;
        transform: scale(1);
        background: rgba(255, 215, 0, 0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
        background: rgba(255, 215, 0, 0.5);
    }
}

.cnn-ticker-link:hover .ticker-link-icon {
    opacity: 1;
    animation: none;
    background: #ffd700;
}

/* "Read More →" button styling */
.ticker-read-more {
    background: rgba(255, 215, 0, 0.25);
    color: #ffd700;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    margin-left: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
    border: 1px solid rgba(255, 215, 0, 0.4);
    flex-shrink: 0;
}

.cnn-ticker-link:hover .ticker-read-more {
    background: #ffd700;
    color: #1a1a2e;
    transform: translateX(3px);
    border-color: #ffd700;
}

/* Linked item styling */
.cnn-ticker-item.linked {
    position: relative;
}

/* Remove the old ::after arrow since we have Read More now */
.cnn-ticker-item.linked::after {
    display: none;
}

/* Navigation arrows */
.cnn-ticker-nav {
    background: rgba(255, 215, 0, 0.25) !important;
    color: #ffd700 !important;
    border: 2px solid rgba(255, 215, 0, 0.5) !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    font-size: 18px !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
    border-radius: 8px !important;
    margin: 0 8px !important;
    pointer-events: auto !important;
    position: relative !important;
    z-index: 1000 !important;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3) !important;
}

.cnn-ticker-nav:hover {
    background: rgba(255, 215, 0, 0.5) !important;
    color: #ffffff !important;
    border-color: #ffd700 !important;
    transform: scale(1.15) !important;
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.5) !important;
}

.cnn-ticker-nav:active {
    transform: scale(0.9) !important;
    background: rgba(255, 215, 0, 0.7) !important;
}

/* News counter indicator */
.cnn-ticker-counter {
    background: rgba(0, 0, 0, 0.5);
    color: #ffd700;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    margin: 0 5px;
    min-width: 35px;
    text-align: center;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    flex-shrink: 0;
}

/* Close/minimize button */
.cnn-ticker-close {
    background: rgba(0, 0, 0, 0.3);
    color: #ffffff;
    border: none;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.cnn-ticker-close:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* News Picker Button */
.cnn-ticker-news-picker {
    background: rgba(0, 0, 0, 0.3);
    color: #ffd700;
    border: none;
    width: 26px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.cnn-ticker-news-picker:hover {
    background: rgba(255, 215, 0, 0.3);
    transform: scale(1.1);
}

/* Ticker Hidden State (auto-hide after 15 min) */
.cnn-news-ticker-bar.ticker-hidden {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

/* ==================== EMERGENCY MODE ==================== */

.cnn-news-ticker-bar.emergency-mode {
    background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%);
    box-shadow: 0 -4px 20px rgba(220, 38, 38, 0.6);
    animation: emergency-pulse 1s ease-in-out infinite;
}

.cnn-news-ticker-bar.emergency-mode .cnn-ticker-label {
    background: linear-gradient(180deg, #fef08a 0%, #fbbf24 100%);
    color: #7c2d12;
    font-weight: 900;
    animation: emergency-label-flash 0.5s ease-in-out infinite;
}

@keyframes emergency-pulse {
    0%, 100% { box-shadow: 0 -4px 20px rgba(220, 38, 38, 0.6); }
    50% { box-shadow: 0 -4px 30px rgba(220, 38, 38, 0.9), 0 0 20px rgba(254, 240, 138, 0.4); }
}

@keyframes emergency-label-flash {
    0%, 100% { background: linear-gradient(180deg, #fef08a 0%, #fbbf24 100%); }
    50% { background: linear-gradient(180deg, #ffffff 0%, #fef08a 100%); }
}

/* ==================== NEWS PICKER MODAL ==================== */

.news-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100001;
    backdrop-filter: blur(4px);
}

.news-picker-modal.active {
    display: flex;
}

.news-picker-content {
    background: #1e293b;
    border-radius: 16px;
    width: 90%;
    max-width: 550px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.news-picker-header {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.news-picker-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.news-picker-header-actions {
    display: flex;
    gap: 8px;
}

.news-picker-refresh,
.news-picker-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.news-picker-refresh:hover,
.news-picker-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.news-picker-body {
    flex: 1;
    overflow: hidden;
    padding: 16px;
}

.news-picker-list {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.news-picker-list::-webkit-scrollbar {
    width: 6px;
}

.news-picker-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.news-picker-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.news-picker-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.news-picker-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.news-picker-item.selected {
    background: rgba(8, 145, 178, 0.2);
    border-color: #0891b2;
}

.news-picker-item input[type="checkbox"] {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #0891b2;
}

.news-picker-item-content {
    flex: 1;
    min-width: 0;
}

.news-picker-item-title {
    color: #f1f5f9;
    font-size: 14px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-picker-item-meta {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.news-picker-category {
    background: rgba(8, 145, 178, 0.3);
    color: #67e8f9;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.news-picker-date {
    color: #94a3b8;
    font-size: 11px;
}

.news-picker-loading,
.news-picker-empty,
.news-picker-error {
    text-align: center;
    padding: 40px;
    color: #94a3b8;
    font-size: 14px;
}

.news-picker-error {
    color: #f87171;
}

.news-picker-footer {
    background: rgba(0, 0, 0, 0.2);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.news-picker-count {
    color: #94a3b8;
    font-size: 13px;
}

.news-picker-actions {
    display: flex;
    gap: 10px;
}

/* Mobile responsive for news picker */
@media (max-width: 600px) {
    .news-picker-content {
        width: 95%;
        max-height: 90vh;
    }

    .news-picker-list {
        max-height: 300px;
    }

    .news-picker-item {
        padding: 10px;
    }

    .news-picker-item-title {
        font-size: 13px;
    }
}

/* ==================== ALERT-SPECIFIC TICKER STYLES ==================== */

/* Alert Mode - Changes ticker appearance when showing alerts */
.cnn-news-ticker-bar.alert-mode {
    background: linear-gradient(180deg, #b91c1c 0%, #7f1d1d 100%);
    box-shadow: 0 -2px 15px rgba(185, 28, 28, 0.5);
}

.cnn-news-ticker-bar.alert-mode .cnn-ticker-label {
    background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
    color: #000000;
    border-right-color: #000000;
    animation: alert-label-flash 1s ease-in-out infinite;
}

@keyframes alert-label-flash {
    0%, 100% { opacity: 1; background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%); }
    50% { opacity: 0.9; background: linear-gradient(180deg, #fcd34d 0%, #fbbf24 100%); }
}

/* Alert Level Colors */
.cnn-ticker-item.alert-extreme {
    color: #fecaca;
    font-weight: 700;
    animation: alert-extreme-flash 0.5s ease-in-out infinite;
}

.cnn-ticker-item.alert-extreme::before {
    background: #fef08a;
    animation: dot-pulse 0.5s ease-in-out infinite;
}

@keyframes alert-extreme-flash {
    0%, 100% { color: #ffffff; text-shadow: 0 0 8px rgba(254, 202, 202, 0.8); }
    50% { color: #fef08a; text-shadow: 0 0 15px rgba(254, 240, 138, 1); }
}

@keyframes dot-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.7; }
}

.cnn-ticker-item.alert-warning {
    color: #fef08a;
    font-weight: 600;
    animation: alert-warning-flash 0.8s ease-in-out infinite;
}

.cnn-ticker-item.alert-warning::before {
    background: #fef08a;
}

@keyframes alert-warning-flash {
    0%, 100% { color: #fef08a; }
    50% { color: #ffffff; }
}

.cnn-ticker-item.alert-watch {
    color: #fed7aa;
    font-weight: 500;
}

.cnn-ticker-item.alert-watch::before {
    background: #fb923c;
}

.cnn-ticker-item.alert-advisory {
    color: #fef9c3;
}

.cnn-ticker-item.alert-advisory::before {
    background: #facc15;
}

.cnn-ticker-item.alert-info {
    color: #bfdbfe;
}

.cnn-ticker-item.alert-info::before {
    background: #3b82f6;
}

/* Typhoon-specific styling */
.cnn-ticker-item.alert-typhoon {
    color: #fecaca;
    font-weight: 700;
}

.cnn-ticker-item.alert-typhoon::before {
    background: #ef4444;
    animation: dot-pulse 0.6s ease-in-out infinite;
}

/* Earthquake-specific styling */
.cnn-ticker-item.alert-earthquake {
    color: #fde68a;
}

.cnn-ticker-item.alert-earthquake::before {
    background: #eab308;
}

/* Flood-specific styling */
.cnn-ticker-item.alert-flood {
    color: #93c5fd;
}

.cnn-ticker-item.alert-flood::before {
    background: #3b82f6;
}

/* ==================== URGENT CDRRM ALERT STYLES ==================== */

/* Urgent alert - red pulsing background */
.cnn-ticker-item.urgent-alert {
    color: #ffffff !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Urgent flash effect on ticker bar */
.cnn-news-ticker-bar.urgent-flash {
    animation: urgent-bar-flash 0.3s ease-in-out 5;
}

@keyframes urgent-bar-flash {
    0%, 100% {
        background: linear-gradient(90deg, #4a0000 0%, #3d0d0d 20%, #2a1a1a 50%, #3d0d0d 80%, #4a0000 100%);
        box-shadow: 0 0 20px rgba(220, 38, 38, 0.8);
    }
    50% {
        background: linear-gradient(90deg, #7f1d1d 0%, #991b1b 20%, #450a0a 50%, #991b1b 80%, #7f1d1d 100%);
        box-shadow: 0 0 40px rgba(255, 0, 0, 1);
    }
}

/* Alert flash effect on label */
.cnn-ticker-label.alert-flash {
    animation: label-alert-flash 0.5s ease-in-out 6;
}

@keyframes label-alert-flash {
    0%, 100% {
        background: linear-gradient(180deg, #7f1d1d 0%, #450a0a 100%);
        color: #ffffff;
    }
    50% {
        background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%);
        color: #fef08a;
    }
}

/* Multi-hazard alert styling */
.cnn-ticker-item.alert-multi_hazard {
    color: #fecaca;
    font-weight: 800;
    animation: multi-hazard-flash 0.4s ease-in-out infinite;
}

.cnn-ticker-item.alert-multi_hazard::before {
    background: linear-gradient(45deg, #ef4444, #eab308, #3b82f6);
    animation: multi-hazard-dot 0.4s linear infinite;
    width: 8px;
    height: 8px;
}

@keyframes multi-hazard-flash {
    0%, 100% { color: #fecaca; text-shadow: 0 0 10px rgba(239, 68, 68, 0.8); }
    33% { color: #fef08a; text-shadow: 0 0 10px rgba(234, 179, 8, 0.8); }
    66% { color: #93c5fd; text-shadow: 0 0 10px rgba(59, 130, 246, 0.8); }
}

@keyframes multi-hazard-dot {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* CDRRM-specific styling */
.cnn-ticker-item.alert-cdrrm {
    color: #a5f3fc;
    font-weight: 600;
}

.cnn-ticker-item.alert-cdrrm::before {
    background: #06b6d4;
}

/* Prediction-based alert */
.cnn-ticker-item.alert-prediction {
    color: #d8b4fe;
    font-weight: 500;
}

.cnn-ticker-item.alert-prediction::before {
    background: #a855f7;
}

/* ==================== TICKER EDITOR MODAL ==================== */
.ticker-editor-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100001;
    backdrop-filter: blur(4px);
}

.ticker-editor-modal.active {
    display: flex;
}

.ticker-editor-content {
    background: #1e293b;
    border-radius: 16px;
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

.ticker-editor-header {
    background: linear-gradient(135deg, #cc0000 0%, #990000 100%);
    color: white;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ticker-editor-header h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ticker-editor-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ticker-editor-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Preview section */
.ticker-editor-preview {
    background: #0f172a;
    padding: 16px 24px;
    border-bottom: 1px solid #334155;
}

.ticker-editor-preview label {
    color: #94a3b8;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 10px;
}

.ticker-preview-bar {
    height: 44px;
    background: linear-gradient(180deg, #cc0000 0%, #990000 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.ticker-preview-label {
    background: #000;
    color: #ffd700;
    font-size: 10px;
    font-weight: 700;
    padding: 0 12px;
    height: 100%;
    display: flex;
    align-items: center;
    border-right: 2px solid #ffd700;
}

.ticker-preview-text {
    color: white;
    font-size: 13px;
    padding: 0 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Messages section */
.ticker-editor-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.ticker-messages-section {
    margin-bottom: 24px;
}

.ticker-messages-section h3 {
    color: #f1f5f9;
    font-size: 14px;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ticker-messages-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ticker-message-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #334155;
    border-radius: 8px;
    padding: 4px;
}

/* Linked message styling in editor */
.ticker-message-item.has-link {
    background: linear-gradient(135deg, #334155, #1e3a5f);
    border-left: 3px solid #3b82f6;
}

/* Link indicator icons in editor */
.ticker-message-link-icon,
.ticker-message-no-link {
    font-size: 14px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.ticker-message-link-icon {
    color: #3b82f6;
    cursor: help;
}

.ticker-message-no-link {
    color: #64748b;
    opacity: 0.6;
    cursor: help;
}

.ticker-message-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #f1f5f9;
    font-size: 14px;
    padding: 10px 12px;
    outline: none;
}

.ticker-message-input::placeholder {
    color: #64748b;
}

.ticker-message-input:focus {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.ticker-message-id-input {
    width: 55px !important;
    min-width: 55px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 8px;
    border-radius: 6px;
    text-align: center;
    margin-right: 8px;
}

.ticker-message-id-input::placeholder {
    color: rgba(96, 165, 250, 0.5);
    font-weight: 400;
}

.ticker-message-id-input:focus {
    outline: none;
    border-color: #60a5fa;
    background: rgba(59, 130, 246, 0.25);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Hide number input arrows */
.ticker-message-id-input::-webkit-outer-spin-button,
.ticker-message-id-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.ticker-message-id-input[type=number] {
    -moz-appearance: textfield;
}

.ticker-message-delete {
    background: rgba(239, 68, 68, 0.2);
    border: none;
    color: #ef4444;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ticker-message-delete:hover {
    background: #ef4444;
    color: white;
}

.ticker-message-number {
    background: rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    min-width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    margin-right: 8px;
}

.ticker-message-move {
    background: rgba(99, 102, 241, 0.2);
    border: none;
    color: #a5b4fc;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    margin-left: 4px;
}

.ticker-message-move:hover:not(:disabled) {
    background: #6366f1;
    color: white;
}

.ticker-message-move:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.ticker-add-message {
    background: rgba(34, 197, 94, 0.2);
    border: 2px dashed #22c55e;
    color: #22c55e;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    margin-top: 8px;
    transition: all 0.2s;
}

.ticker-add-message:hover {
    background: rgba(34, 197, 94, 0.3);
}

/* Settings section */
.ticker-settings-section h3 {
    color: #f1f5f9;
    font-size: 14px;
    margin: 0 0 16px 0;
}

.ticker-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.ticker-setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ticker-setting-item label {
    color: #94a3b8;
    font-size: 12px;
}

.ticker-setting-item input[type="range"] {
    width: 100%;
    accent-color: #cc0000;
}

.ticker-setting-item input[type="number"] {
    background: #334155;
    border: 1px solid #475569;
    border-radius: 6px;
    color: #f1f5f9;
    padding: 8px 12px;
    font-size: 14px;
    width: 100%;
}

.ticker-setting-item select {
    background: #334155;
    border: 1px solid #475569;
    border-radius: 6px;
    color: #f1f5f9;
    padding: 8px 12px;
    font-size: 14px;
}

.ticker-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ticker-toggle {
    position: relative;
    width: 48px;
    height: 26px;
    background: #475569;
    border-radius: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.ticker-toggle.active {
    background: #22c55e;
}

.ticker-toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.ticker-toggle.active::after {
    transform: translateX(22px);
}

/* Footer actions */
.ticker-editor-footer {
    background: #0f172a;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #334155;
}

.ticker-editor-hint {
    color: #64748b;
    font-size: 12px;
}

.ticker-editor-actions {
    display: flex;
    gap: 12px;
}

.ticker-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.ticker-btn-secondary {
    background: #334155;
    border: 1px solid #475569;
    color: #f1f5f9;
}

.ticker-btn-secondary:hover {
    background: #475569;
}

.ticker-btn-primary {
    background: linear-gradient(135deg, #cc0000 0%, #990000 100%);
    border: none;
    color: white;
}

.ticker-btn-primary:hover {
    background: linear-gradient(135deg, #dd0000 0%, #aa0000 100%);
    transform: translateY(-1px);
}

/* Responsive for mobile */
@media (max-width: 768px) {
    .cnn-news-ticker-bar {
        height: 22px;
    }

    .cnn-ticker-label {
        font-size: 9px;
        padding: 0 8px;
    }

    .cnn-ticker-item {
        font-size: 12px;
        padding: 0 20px 0 0;
        line-height: 22px;
    }

    .cnn-ticker-close {
        width: 22px;
        height: 22px;
        font-size: 12px;
    }

    .ticker-editor-content {
        width: 95%;
        max-height: 90vh;
    }

    .ticker-settings-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== AI CHAT WIDGET ==================== */
.ai-chat-widget {
    position: fixed;
    bottom: 65px;
    right: 20px;
    width: 420px;
    max-width: calc(100vw - 48px);
    height: 600px;
    max-height: calc(100vh - 140px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-chat-widget.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* ==================== CHAT HEADER (Compact) ==================== */
.ai-chat-header {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-height: 48px;
}

.ai-chat-avatar {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    backdrop-filter: blur(10px);
}

.ai-chat-header-info {
    flex: 1;
    min-width: 0;
}

.ai-chat-header-title {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    line-height: 1.2;
}

.ai-chat-header-subtitle {
    font-size: 10px;
    opacity: 0.85;
    display: none;
}

.ai-chat-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ai-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.ai-chat-close svg {
    width: 18px;
    height: 18px;
}

/* ==================== MESSAGES AREA ==================== */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    scroll-behavior: smooth;
}

.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(30, 58, 138, 0.3);
    border-radius: 3px;
}

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(30, 58, 138, 0.5);
}

/* ==================== WELCOME SCREEN (Compact) ==================== */
.ai-chat-welcome {
    text-align: center;
    padding: 12px 10px;
}

.ai-welcome-icon {
    font-size: 36px;
    margin-bottom: 8px;
    animation: bounce-icon 2s ease-in-out infinite;
}

@keyframes bounce-icon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.ai-welcome-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e3a8a;
    margin: 0 0 5px 0;
}

.ai-welcome-text {
    color: #64748b;
    font-size: 12px;
    margin: 0 0 10px 0;
}

.ai-welcome-hint {
    font-size: 10px;
    color: #94a3b8;
    margin: 5px 0;
}

/* ==================== AUTO-LANGUAGE DETECTION NOTICE ==================== */
.ai-auto-lang-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid #86efac;
    border-radius: 20px;
    font-size: 11px;
    color: #166534;
    animation: lang-notice-fade 0.5s ease-out;
}

@keyframes lang-notice-fade {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-auto-lang-notice .auto-lang-icon {
    font-size: 14px;
    animation: globe-spin 4s linear infinite;
}

@keyframes globe-spin {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    75% { transform: rotate(-5deg); }
}

.ai-auto-lang-notice .auto-lang-text {
    font-weight: 500;
    letter-spacing: 0.3px;
}

/* Language detected state */
.ai-auto-lang-notice.detected-en {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-color: #93c5fd;
    color: #1e40af;
}

.ai-auto-lang-notice.detected-tl {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: #fcd34d;
    color: #92400e;
}

.ai-auto-lang-notice.detected-ceb {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    border-color: #c4b5fd;
    color: #6b21a8;
}

/* Legacy support - hide old language selector if present */
.ai-language-selector {
    display: none !important;
}

/* ==================== QUICK ACTIONS (Compact) ==================== */
.ai-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 0 8px;
}

.ai-quick-action {
    padding: 8px 10px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    font-size: 11px;
    color: #334155;
    text-align: center;
    transition: all 0.2s ease;
    font-weight: 500;
    line-height: 1.3;
}

.ai-quick-action:hover {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
}

/* ==================== CHAT MESSAGES ==================== */
.ai-chat-message {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
    animation: message-slide-in 0.3s ease-out;
}

@keyframes message-slide-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-chat-message.user {
    flex-direction: row-reverse;
}

.ai-message-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    background: #f1f5f9;
}

.ai-chat-message.assistant .ai-message-avatar {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
}

.ai-chat-message.user .ai-message-avatar {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.ai-message-content {
    max-width: 80%;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.6;
    word-wrap: break-word;
}

.ai-chat-message.assistant .ai-message-content {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 18px 18px 18px 4px;
    color: #334155;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.ai-chat-message.user .ai-message-content {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    border-radius: 18px 18px 4px 18px;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.25);
}

.ai-message-content strong {
    font-weight: 700;
    color: inherit;
}

.ai-message-error .ai-message-content {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-color: #fca5a5;
    color: #991b1b;
}

/* ==================== DOCUMENT LINKS ==================== */
.doc-link {
    color: #2563eb;
    cursor: pointer;
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s ease;
    background: rgba(37, 99, 235, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.doc-link:hover {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.2);
}

/* Blue link styling */
.ai-link-blue {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.ai-link-blue:hover {
    color: #1d4ed8;
    background: rgba(59, 130, 246, 0.2);
}

/* ==================== ACTION BUTTONS CONTAINER ==================== */
.ai-action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

/* ==================== ENHANCED DOCUMENT CARD (FORCED FULLTEXT + PDF) ==================== */
.ai-document-card {
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    margin: 10px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.ai-document-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

.ai-doc-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.ai-doc-icon {
    font-size: 20px;
}

.ai-doc-type {
    font-weight: 700;
    font-size: 14px;
    color: #1e3a8a;
}

.ai-doc-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* FULLTEXT VIEW BUTTON - Enhanced Yellow/Gold */
.ai-fulltext-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 50%, #f59e0b 100%);
    color: #1c1917;
    padding: 10px 16px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid rgba(217, 119, 6, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 12px rgba(245, 158, 11, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
    flex: 1;
    justify-content: center;
    min-width: 120px;
}

.ai-fulltext-btn:hover {
    background: linear-gradient(135deg, #fde68a 0%, #fcd34d 50%, #fbbf24 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    border-color: rgba(217, 119, 6, 0.5);
}

.ai-fulltext-btn:active {
    transform: translateY(0) scale(1);
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* PDF VIEW BUTTON - Enhanced Violet/Purple */
.ai-pdf-btn-enhanced {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #c4b5fd 0%, #a78bfa 50%, #8b5cf6 100%);
    color: white;
    padding: 10px 16px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid rgba(124, 58, 237, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 3px 12px rgba(139, 92, 246, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    flex: 1;
    justify-content: center;
    min-width: 120px;
}

.ai-pdf-btn-enhanced:hover {
    background: linear-gradient(135deg, #ddd6fe 0%, #c4b5fd 50%, #a78bfa 100%);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: rgba(124, 58, 237, 0.5);
}

.ai-pdf-btn-enhanced:active {
    transform: translateY(0) scale(1);
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ai-fulltext-btn .btn-icon,
.ai-pdf-btn-enhanced .btn-icon {
    font-size: 16px;
}

.ai-fulltext-btn .btn-text,
.ai-pdf-btn-enhanced .btn-text {
    letter-spacing: 0.3px;
}

/* Responsive - Stack buttons on mobile */
@media (max-width: 360px) {
    .ai-doc-card-actions {
        flex-direction: column;
    }

    .ai-fulltext-btn,
    .ai-pdf-btn-enhanced {
        width: 100%;
        min-width: unset;
    }
}

/* ==================== FULL DOCUMENT CARD (for detailed results) ==================== */
.ai-document-card-full {
    display: flex;
    flex-direction: column;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e2e8f0;
    border-left: 4px solid #3b82f6;
    border-radius: 12px;
    padding: 14px;
    margin: 12px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.ai-document-card-full:hover {
    border-color: #3b82f6;
    border-left-color: #1d4ed8;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.25);
    transform: translateY(-3px);
}

.ai-document-card-full .ai-doc-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.ai-document-card-full .ai-doc-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ai-document-card-full .ai-doc-type {
    font-weight: 800;
    font-size: 15px;
    color: #1e3a8a;
}

.ai-document-card-full .ai-doc-year {
    font-size: 13px;
    color: #64748b;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 10px;
}

.ai-doc-title {
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
    margin-bottom: 12px;
    padding: 8px 10px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #fbbf24;
}

.ai-doc-card-actions-full {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 5px;
}

/* Large PDF button for modal */
.ai-pdf-btn-large {
    padding: 10px 20px !important;
    font-size: 14px !important;
}

/* ==================== BUTTON SHADING - YELLOW, BLUE, VIOLET ==================== */

/* Yellow Button (View Content) */
.ai-btn-yellow,
.ai-view-btn.ai-btn-yellow {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
    color: #1c1917;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}

.ai-btn-yellow:hover,
.ai-view-btn.ai-btn-yellow:hover {
    background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 50%, #f59e0b 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.ai-btn-yellow:active,
.ai-view-btn.ai-btn-yellow:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(245, 158, 11, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Blue Button (Close, Links) */
.ai-btn-blue,
.ai-modal-btn.ai-btn-blue {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
    color: white;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ai-btn-blue:hover,
.ai-modal-btn.ai-btn-blue:hover {
    background: linear-gradient(135deg, #93c5fd 0%, #60a5fa 50%, #3b82f6 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.ai-btn-blue:active,
.ai-modal-btn.ai-btn-blue:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Violet Button (View PDF) */
.ai-btn-violet,
.ai-pdf-btn.ai-btn-violet,
.ai-modal-btn.ai-btn-violet {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 50%, #7c3aed 100%);
    color: white;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ai-btn-violet:hover,
.ai-pdf-btn.ai-btn-violet:hover,
.ai-modal-btn.ai-btn-violet:hover {
    background: linear-gradient(135deg, #c4b5fd 0%, #a78bfa 50%, #8b5cf6 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.ai-btn-violet:active,
.ai-pdf-btn.ai-btn-violet:active,
.ai-modal-btn.ai-btn-violet:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(139, 92, 246, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* No PDF Available Indicator */
.ai-no-pdf {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #94a3b8;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 500;
    font-style: italic;
}

/* ==================== LEGACY BUTTON STYLES (Backward Compatibility) ==================== */
.ai-view-btn {
    display: inline-block;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #1c1917;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #d97706;
    margin-top: 6px;
    transition: all 0.2s ease;
}

.ai-view-btn:hover {
    background: linear-gradient(135deg, #fcd34d 0%, #fbbf24 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.ai-pdf-btn {
    display: inline-block;
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid #7c3aed;
    margin-top: 6px;
    margin-left: 6px;
    transition: all 0.2s ease;
}

.ai-pdf-btn:hover {
    background: linear-gradient(135deg, #c4b5fd 0%, #a78bfa 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* ==================== CATEGORY TAGS ==================== */
.category-tag {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #166534;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin: 2px;
}

.category-tag.p1 { background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%); color: #92400e; }
.category-tag.p2 { background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%); color: #1e40af; }
.category-tag.p3 { background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%); color: #6b21a8; }
.category-tag.p4 { background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%); color: #166534; }
.category-tag.p5 { background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%); color: #9d174d; }

/* ==================== KEYWORD HIGHLIGHT ==================== */
/* Yellow highlight for matching keywords in search results */
.ai-keyword-highlight {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(245, 158, 11, 0.2);
}

/* Enhanced highlight for exact phrase matches */
.ai-phrase-highlight,
.ai-keyword-highlight.exact-phrase {
    background: linear-gradient(135deg, #fef08a 0%, #facc15 100%);
    color: #713f12;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    box-shadow: 0 2px 4px rgba(234, 179, 8, 0.3);
    border: 1px solid rgba(234, 179, 8, 0.4);
}

/* Animation for highlighted text */
.ai-keyword-highlight,
.ai-phrase-highlight {
    transition: all 0.2s ease;
}

.ai-keyword-highlight:hover,
.ai-phrase-highlight:hover {
    background: linear-gradient(135deg, #facc15 0%, #eab308 100%);
    transform: scale(1.02);
}

/* ==================== DOCUMENT MODAL SEARCH BOX ==================== */
/* Floating search box for searching within document content */

.ai-doc-meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
}

.ai-doc-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.ai-doc-search-input-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 200px;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    overflow: hidden;
}

.ai-doc-search-input-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#ai-doc-search-input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    outline: none;
    font-size: 13px;
    background: transparent;
}

#ai-doc-search-input::placeholder {
    color: #94a3b8;
}

.ai-doc-search-btn {
    padding: 8px 12px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.ai-doc-search-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.ai-doc-search-clear {
    padding: 8px 10px;
    background: #f1f5f9;
    border: none;
    border-left: 1px solid #e2e8f0;
    cursor: pointer;
    font-size: 12px;
    color: #64748b;
    transition: all 0.2s ease;
}

.ai-doc-search-clear:hover {
    background: #fee2e2;
    color: #dc2626;
}

.ai-doc-search-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-doc-nav-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    font-size: 10px;
    color: #64748b;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-doc-nav-btn:hover {
    background: #f1f5f9;
    border-color: #3b82f6;
    color: #3b82f6;
}

.ai-doc-match-count {
    font-size: 12px;
    color: #64748b;
    min-width: 60px;
    text-align: center;
    white-space: nowrap;
}

/* Document content highlighting - Yellow for all matches */
.ai-doc-highlight {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 500;
}

/* Current/Active match - Brighter yellow with border */
.ai-doc-highlight.ai-doc-highlight-current {
    background: linear-gradient(135deg, #fef08a 0%, #facc15 100%);
    color: #713f12;
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(234, 179, 8, 0.4);
    border: 2px solid #eab308;
    animation: pulse-highlight 1s ease-in-out;
}

@keyframes pulse-highlight {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ==================== TYPING INDICATOR ==================== */
.ai-typing-indicator {
    display: flex;
    gap: 5px;
    padding: 4px 0;
}

.ai-typing-indicator span {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing-bounce 1.4s ease-in-out infinite;
}

.ai-typing-indicator span:nth-child(1) { animation-delay: 0s; }
.ai-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
    30% { transform: translateY(-8px); opacity: 1; }
}

/* ==================== INPUT AREA (Compact) ==================== */
.ai-chat-input-area {
    padding: 8px 12px 10px;
    background: white;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.ai-chat-disclaimer {
    font-size: 10px;
    color: #94a3b8;
    text-align: center;
    margin-bottom: 6px;
    padding: 0 8px;
}

.ai-chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.ai-chat-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    resize: none;
    font-size: 14px;
    line-height: 1.5;
    max-height: 100px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.ai-chat-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
}

.ai-chat-input::placeholder {
    color: #94a3b8;
}

.ai-chat-send {
    width: 40px;
    height: 40px;
    border: none;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ai-chat-send:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.35);
}

.ai-chat-send:disabled {
    background: #e2e8f0;
    cursor: not-allowed;
}

.ai-chat-send svg {
    width: 20px;
    height: 20px;
    fill: white;
}

.ai-chat-send:disabled svg {
    fill: #94a3b8;
}

/* ==================== RESPONSE EXPLANATION ==================== */
.ai-response-explanation {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.5;
    color: #065f46;
}

.ai-response-explanation strong {
    color: #059669;
}

.ai-result-count {
    font-size: 10px;
    color: #64748b;
    text-align: right;
    margin-bottom: 8px;
}

.ai-more-results {
    font-size: 10px;
    color: #94a3b8;
    text-align: center;
    margin-top: 6px;
    font-style: italic;
}

/* ==================== SEARCH RESULT IN CHAT ==================== */
.ai-search-result {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    margin: 8px 0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-search-result:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(30, 58, 138, 0.15);
    transform: translateY(-2px);
}

.ai-search-result-title {
    font-weight: 600;
    color: #1e3a8a;
    font-size: 13px;
    margin-bottom: 6px;
}

.ai-search-result-excerpt {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}

/* ==================== STATISTICS DISPLAY ==================== */
.ai-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 10px 0;
}

.ai-stat-item {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 10px;
    border-radius: 10px;
    text-align: center;
}

.ai-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #1e3a8a;
}

.ai-stat-label {
    font-size: 11px;
    color: #64748b;
}

/* ==================== DOCUMENT MODAL ==================== */
.ai-doc-modal {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 20;
    display: none;
    flex-direction: column;
    animation: modal-slide-up 0.3s ease-out;
}

.ai-doc-modal.active {
    display: flex;
}

@keyframes modal-slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-doc-modal-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.ai-doc-modal-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    flex: 1;
    padding-right: 10px;
    line-height: 1.3;
}

.ai-doc-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ai-doc-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.ai-doc-modal-meta {
    padding: 12px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: #475569;
    flex-shrink: 0;
}

.ai-doc-modal-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.ai-doc-modal-meta strong {
    color: #1e3a8a;
}

.ai-doc-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    line-height: 1.7;
    font-size: 14px;
    color: #334155;
    background: white;
}

.ai-doc-modal-content::-webkit-scrollbar {
    width: 8px;
}

.ai-doc-modal-content::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.ai-doc-modal-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.ai-doc-modal-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.ai-doc-modal-content h4 {
    color: #1e3a8a;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.4;
}

.ai-doc-modal-content strong {
    color: #1e3a8a;
    font-weight: 700;
}

/* Modal Actions Area */
.ai-doc-modal-actions {
    padding: 12px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

/* ==================== SNIPPET STYLING ==================== */
.ai-message-content em,
.ai-message-content i {
    color: #64748b;
    font-style: italic;
}

/* ==================== AI BADGE ON BUTTON ==================== */
.ai-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ==================== HEADER ACTIONS ==================== */
.ai-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.ai-header-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 6px;
    padding: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.ai-header-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.ai-header-btn svg {
    width: 16px;
    height: 16px;
    fill: white;
}

/* ==================== AI MODE INDICATOR ==================== */
.ai-mode-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    font-size: 10px;
    opacity: 0.85;
}

.ai-mode-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #94a3b8;
    transition: all 0.3s ease;
}

.ai-mode-dot.online {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: dot-pulse 1.5s ease-in-out infinite;
}

.ai-mode-dot.hybrid {
    background: #f59e0b;
    box-shadow: 0 0 8px #f59e0b;
    animation: dot-pulse 1.5s ease-in-out infinite;
}

@keyframes dot-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ai-mode-text {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==================== WELCOME HINT ==================== */
.ai-welcome-hint {
    font-size: 12px;
    color: #94a3b8;
    margin: 8px 0 0 0;
    padding: 6px 12px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
    border-radius: 12px;
    border: 1px solid #bbf7d0;
}

/* ==================== SMART SUGGESTIONS ==================== */
.ai-smart-suggestions {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

/* ==================== SUGGESTIONS BAR ==================== */
.ai-suggestions-bar {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 1px solid #e2e8f0;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    flex-shrink: 0;
}

.suggestions-label {
    font-size: 11px;
    color: #64748b;
    white-space: nowrap;
    font-weight: 600;
}

.suggestions-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    flex: 1;
}

.suggestion-chip {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 6px 14px;
    font-size: 12px;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.suggestion-chip:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ==================== TOAST NOTIFICATION ==================== */
.ai-toast {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(30, 58, 138, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
    white-space: nowrap;
}

.ai-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ==================== ENHANCED HEADER INFO ==================== */
.ai-chat-header-info {
    flex: 1;
    min-width: 0;
}

.ai-chat-header-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-chat-header-subtitle {
    font-size: 12px;
    opacity: 0.9;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==================== COPY SUCCESS ANIMATION ==================== */
@keyframes copy-success {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.ai-header-btn.copied {
    animation: copy-success 0.3s ease;
}

.ai-header-btn.copied svg {
    fill: #10b981;
}

/* ==================== MOBILE RESPONSIVE ==================== */
@media (max-width: 480px) {
    .ai-chat-button {
        bottom: 15px;
        right: 15px;
        padding: 8px 12px;
    }

    .ai-chat-button .ask-edgar-icon {
        font-size: 16px;
    }

    .ai-chat-button .ask-edgar-text {
        font-size: 12px;
    }

    .ai-chat-button svg {
        width: 16px;
        height: 16px;
    }

    .ai-chat-widget {
        bottom: 80px;
        right: 8px;
        left: 8px;
        width: auto;
        max-width: none;
        height: calc(100vh - 100px);
        max-height: calc(100vh - 100px);
        border-radius: 16px;
    }

    .ai-chat-header {
        padding: 14px 16px;
    }

    .ai-chat-header-title {
        font-size: 16px;
    }

    .ai-chat-avatar {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }

    .ai-quick-actions {
        grid-template-columns: 1fr;
    }

    .ai-auto-lang-notice {
        padding: 6px 12px;
        font-size: 10px;
    }

    .ai-auto-lang-notice .auto-lang-icon {
        font-size: 12px;
    }

    .ai-chat-messages {
        padding: 14px;
    }

    .ai-message-content {
        max-width: 85%;
        padding: 12px 14px;
        font-size: 13px;
    }

    .ai-chat-input-area {
        padding: 12px 14px 14px;
    }

    .ai-chat-input {
        padding: 12px 14px;
        font-size: 14px;
    }

    .ai-action-buttons {
        flex-direction: column;
        gap: 6px;
    }

    .ai-btn-yellow,
    .ai-btn-blue,
    .ai-btn-violet {
        width: 100%;
        justify-content: center;
    }
}

/* ==================== DARK MODE SUPPORT ==================== */
@media (prefers-color-scheme: dark) {
    .ai-chat-widget {
        background: #1e293b;
    }

    .ai-chat-messages {
        background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    }

    .ai-chat-welcome {
        color: #e2e8f0;
    }

    .ai-welcome-title {
        color: #60a5fa;
    }

    .ai-welcome-text {
        color: #94a3b8;
    }

    /* Auto-language notice dark mode */
    .ai-auto-lang-notice {
        background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
        border-color: #3b82f6;
        color: #93c5fd;
    }

    .ai-auto-lang-notice.detected-en {
        background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
        border-color: #60a5fa;
        color: #93c5fd;
    }

    .ai-auto-lang-notice.detected-tl {
        background: linear-gradient(135deg, #422006 0%, #1e293b 100%);
        border-color: #fbbf24;
        color: #fcd34d;
    }

    .ai-auto-lang-notice.detected-ceb {
        background: linear-gradient(135deg, #3b0764 0%, #1e293b 100%);
        border-color: #a78bfa;
        color: #c4b5fd;
    }

    .ai-quick-action {
        background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
        border-color: #475569;
        color: #e2e8f0;
    }

    .ai-chat-message.assistant .ai-message-content {
        background: #334155;
        border-color: #475569;
        color: #e2e8f0;
    }

    .ai-chat-input-area {
        background: #1e293b;
        border-top-color: #334155;
    }

    .ai-chat-input {
        background: #0f172a;
        border-color: #475569;
        color: #e2e8f0;
    }

    .ai-chat-input:focus {
        border-color: #60a5fa;
    }

    .ai-chat-disclaimer {
        color: #64748b;
    }

    .ai-doc-modal {
        background: #1e293b;
    }

    .ai-doc-modal-meta {
        background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
        border-bottom-color: #475569;
        color: #94a3b8;
    }

    .ai-doc-modal-meta strong {
        color: #60a5fa;
    }

    .ai-doc-modal-content {
        background: #0f172a;
        color: #e2e8f0;
    }

    .ai-doc-modal-content h4,
    .ai-doc-modal-content strong {
        color: #60a5fa;
    }

    .ai-doc-modal-actions {
        background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
        border-top-color: #475569;
    }

    /* Dark mode button adjustments */
    .ai-btn-yellow,
    .ai-view-btn.ai-btn-yellow {
        background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
        color: #1c1917;
    }

    .ai-no-pdf {
        background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
        color: #64748b;
    }
}

/* ==================== AI HYBRID ASSISTANT v3.0 STYLES ==================== */

/* Header Badges Container */
.ai-header-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

/* Context Badge */
.ai-context-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.15);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.ai-context-badge:hover {
    background: rgba(255, 255, 255, 0.25);
}

.ai-context-badge .context-icon {
    font-size: 12px;
}

.ai-context-badge .context-text {
    font-weight: 500;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Online Status Indicator */
.ai-online-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.ai-online-indicator .online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.ai-online-indicator.online .online-dot {
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
    animation: online-pulse 2s ease-in-out infinite;
}

.ai-online-indicator.offline .online-dot {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

@keyframes online-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.9); }
}

/* Module Selector */
.ai-module-selector {
    margin: 12px 0;
    padding: 8px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.ai-module-selector .module-label {
    display: block;
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-module-selector .module-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ai-module-btn {
    padding: 5px 10px;
    font-size: 11px;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    background: white;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ai-module-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.ai-module-btn.active {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    border-color: #1e3a8a;
    color: white;
    font-weight: 500;
}

/* Module-specific colors */
.ai-module-btn[data-module="ordinances"].active {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
}

.ai-module-btn[data-module="resolutions"].active {
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 100%);
}

.ai-module-btn[data-module="hrmo"].active {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
}

.ai-module-btn[data-module="news"].active {
    background: linear-gradient(135deg, #d97706 0%, #f59e0b 100%);
}

.ai-module-btn[data-module="minutes"].active {
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
}

/* Cross-Reference Results Panel */
.ai-crossref-panel {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    padding: 12px;
    max-height: 150px;
    overflow-y: auto;
}

.ai-crossref-panel .crossref-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ai-crossref-panel .crossref-title {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.ai-crossref-panel .crossref-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.ai-crossref-panel .crossref-close:hover {
    color: #64748b;
}

.ai-crossref-panel .crossref-content {
    font-size: 12px;
    color: #64748b;
}

.ai-crossref-panel .crossref-item {
    padding: 6px 8px;
    background: white;
    border-radius: 6px;
    margin-bottom: 4px;
    border: 1px solid #e2e8f0;
}

.ai-crossref-panel .crossref-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

/* Employee Result Card */
.ai-employee-card {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 8px 0;
}

.ai-employee-card .employee-name {
    font-weight: 600;
    color: #166534;
    font-size: 13px;
}

.ai-employee-card .employee-position {
    font-size: 11px;
    color: #15803d;
    margin-top: 2px;
}

.ai-employee-card .employee-dept {
    font-size: 10px;
    color: #22c55e;
    margin-top: 4px;
}

/* News Result Card */
.ai-news-card {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 8px 0;
}

.ai-news-card .news-title {
    font-weight: 600;
    color: #92400e;
    font-size: 13px;
}

.ai-news-card .news-date {
    font-size: 10px;
    color: #b45309;
    margin-top: 4px;
}

/* Minutes Result Card */
.ai-minutes-card {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 8px 0;
}

.ai-minutes-card .minutes-session {
    font-weight: 600;
    color: #991b1b;
    font-size: 13px;
}

.ai-minutes-card .minutes-date {
    font-size: 10px;
    color: #dc2626;
    margin-top: 4px;
}

/* Offline Message */
.ai-offline-message {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    margin: 8px 0;
}

.ai-offline-message .offline-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.ai-offline-message .offline-text {
    font-size: 13px;
    color: #991b1b;
    font-weight: 500;
}

/* Mobile Responsive for v3.0 */
@media (max-width: 480px) {
    .ai-header-badges {
        flex-wrap: wrap;
        gap: 4px;
    }

    .ai-context-badge {
        font-size: 10px;
        padding: 2px 6px;
    }

    .ai-module-selector .module-buttons {
        gap: 4px;
    }

    .ai-module-btn {
        padding: 4px 8px;
        font-size: 10px;
    }

    .ai-crossref-panel {
        max-height: 100px;
    }
}

/* Dark Mode Support for v3.0 */
@media (prefers-color-scheme: dark) {
    .ai-context-badge {
        background: rgba(255, 255, 255, 0.1);
    }

    .ai-module-selector {
        border-color: #374151;
    }

    .ai-module-btn {
        background: #1f2937;
        border-color: #374151;
        color: #d1d5db;
    }

    .ai-module-btn:hover {
        background: #374151;
    }

    .ai-crossref-panel {
        background: #1f2937;
        border-color: #374151;
    }

    .ai-crossref-panel .crossref-item {
        background: #111827;
        border-color: #374151;
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .ai-chat-button,
    .ai-chat-widget,
    #ai-assistant-container {
        display: none !important;
    }
}
