/* Gaya widget Chatbot Si-SELA + popup maklumat (diekstrak dari index lama) */
/* Dark theme (dipicu oleh class body.theme-dark dari JS) */
        .theme-dark {
            --text: #e5e7eb;
            --muted: #cbd5e1;
            --bg: #0b1224;
            --border: #1f2937;
            --bot: white;
            --list: white;
            --user: #172554;
            --user-border: #1e3a8a;
            --shadow: 0 20px 40px rgba(2, 6, 23, .45);
        }
/* Tombol PNG transparan (tanpa bulatan) */
        /* ===== CHATBOT FAB BUTTON (REDESIGNED) ===== */
        .chatbot-button {
            position: fixed;
            left: 24px;
            bottom: 130px;
            z-index: 99;
            background: #ffffff;
            border: 2px solid rgba(154, 33, 9, 0.15);
            padding: 8px;
            border-radius: 50%;
            cursor: pointer;
            width: 72px;
            height: 72px;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 10px 25px rgba(154, 33, 9, 0.12), inset 0 2px 2px rgba(255, 255, 255, 0.8);
            transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
            margin-bottom: env(safe-area-inset-bottom);
        }
.chatbot-button::after {
            content: '';
            position: absolute;
            width: 100%;
            height: 100%;
            border-radius: 50%;
            border: 2px solid #9A2109;
            opacity: 0.3;
            animation: pulse-ring 2.5s infinite;
            pointer-events: none;
        }
.chatbot-button:hover {
            transform: translateY(-4px) scale(1.05);
            border-color: rgba(154, 33, 9, 0.3);
            box-shadow: 0 15px 30px rgba(154, 33, 9, 0.25);
        }
.chatbot-button:active {
            transform: translateY(-1px) scale(0.98);
        }
.chatbot-button img {
            width: 100%;
            height: 100%;
            object-fit: contain;
        }
.theme-dark .chatbot-button {
            background: #1e293b;
            border-color: rgba(255, 153, 0, 0.25);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
        }
.theme-dark .chatbot-button::after {
            border-color: #ff9900;
        }
/* ===== CHAT CONTAINER (GLASSMORPHISM REDESIGNED) ===== */
        .chat-container {
            position: fixed;
            left: 24px;
            bottom: calc(24px + 72px);
            z-index: 100;
            width: min(92vw, 400px);
            height: min(78vh, 600px);
            background: rgba(255, 255, 255, 0.88) !important;
            backdrop-filter: blur(20px) saturate(180%);
            -webkit-backdrop-filter: blur(20px) saturate(180%);
            border: 1px solid rgba(255, 255, 255, 0.5) !important;
            border-radius: 24px !important;
            box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
            display: none;
            flex-direction: column;
            overflow: hidden;
            transform: translateY(20px) scale(0.95);
            opacity: 0;
            transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
        }
.theme-dark .chat-container {
            background: rgba(15, 23, 42, 0.88) !important;
            border: 1px solid rgba(255, 255, 255, 0.08) !important;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
        }
.chat-container.open {
            display: flex;
            transform: translateY(0) scale(1);
            opacity: 1;
        }
.chat-container a {
            color: #9A2109 !important;
            text-decoration: none !important;
            font-weight: 700 !important;
            border-bottom: 1.5px solid rgba(154, 33, 9, 0.3);
            transition: all 0.2s ease;
        }
.chat-container a:hover {
            color: #c92b0c !important;
            border-bottom-color: #c92b0c;
        }
.theme-dark .chat-container a {
            color: #ff9900 !important;
            border-bottom-color: rgba(255, 153, 0, 0.3);
        }
.theme-dark .chat-container a:hover {
            color: #ffb84d !important;
            border-bottom-color: #ffb84d;
        }
/* ===== CHAT HEADER (REDESIGNED) ===== */
        .chat-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            padding: 16px 20px;
            border-bottom: 1px solid rgba(0, 0, 0, 0.05);
            background: linear-gradient(135deg, #9A2109, #c92b0c) !important;
            color: #ffffff;
        }
.theme-dark .chat-header {
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            background: linear-gradient(135deg, #1e293b, #0f172a) !important;
        }
.chat-header .title {
            display: flex;
            align-items: center;
            gap: 12px;
        }
.chat-header .title div div {
            font-weight: 800 !important;
            font-size: 1.05rem !important;
            letter-spacing: 0.02em !important;
        }
.chat-header .status {
            font-size: 0.76rem !important;
            color: rgba(255, 255, 255, 0.8) !important;
            display: flex;
            align-items: center;
            gap: 5px;
            margin-top: 2px;
        }
.chat-header .status::before {
            content: '';
            display: inline-block;
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: #10b981;
            box-shadow: 0 0 6px #10b981;
        }
.chat-header .icon-btn {
            border: 1px solid rgba(255, 255, 255, 0.2);
            background: rgba(255, 255, 255, 0.1);
            color: #ffffff;
            width: 32px;
            height: 32px;
            border-radius: 8px;
            display: grid;
            place-items: center;
            cursor: pointer;
            transition: all 0.2s ease;
            font-size: 1rem;
        }
.chat-header .icon-btn:hover {
            background: rgba(255, 255, 255, 0.25);
            transform: scale(1.05);
        }
.chat-header .icon-btn:active {
            transform: scale(0.95);
        }
/* ===== CHAT BODY (REDESIGNED) ===== */
        .chat-body {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
            display: flex;
            flex-direction: column;
            gap: 14px;
            background: #f8fafc;
            scroll-behavior: smooth;
        }
.theme-dark .chat-body {
            background: #0f172a;
        }
/* ===== MESSAGE LAYOUT (perbaikan: flex avatar + bubble) ===== */
        .message {
            display: flex;
            align-items: flex-end;
            gap: 10px;
            max-width: 100%;
        }
        .message.bot { justify-content: flex-start; }
        .message.user { justify-content: flex-end; }
        .message .bubble { max-width: 74%; }
        .message .avatar { overflow: hidden; }
        .message .avatar ion-icon { font-size: 18px; color: #9A2109; }
        .message.user .avatar ion-icon { color: #64748b; }
        .message .avatar-bot img { width: 100%; height: 100%; object-fit: cover; }
        .message .avatar-bot { background: #fff; padding: 0; }
/* ===== CHAT OPTIONS (REDESIGNED) ===== */
        .chat-options {
            display: grid;
            gap: 10px;
            grid-template-columns: 1fr 1fr;
            padding: 16px 20px;
            border-top: 1px solid rgba(0, 0, 0, 0.05);
            background: rgba(255, 255, 255, 0.95);
        }
.theme-dark .chat-options {
            border-top: 1px solid rgba(255, 255, 255, 0.05);
            background: #1e293b;
        }
.chat-options button {
            border: 1.5px solid #9A2109 !important;
            background: rgba(154, 33, 9, 0.02) !important;
            color: #9A2109 !important;
            border-radius: 14px !important;
            padding: 12px 14px !important;
            cursor: pointer;
            text-align: left;
            font-weight: 700;
            font-size: 0.88rem;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
        }
.chat-options button:hover {
            background: rgba(154, 33, 9, 0.08) !important;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(154, 33, 9, 0.1);
        }
.theme-dark .chat-options button {
            border-color: #ff9900 !important;
            background: rgba(255, 153, 0, 0.02) !important;
            color: #ff9900 !important;
        }
.theme-dark .chat-options button:hover {
            background: rgba(255, 153, 0, 0.1) !important;
            box-shadow: 0 4px 8px rgba(255, 153, 0, 0.15);
        }
/* ===== CHAT INPUT (REDESIGNED) ===== */
        .chat-input {
            display: none;
            align-items: center;
            gap: 10px;
            padding: 14px 20px;
            border-top: 1px solid rgba(0, 0, 0, 0.05);
            background: rgba(255, 255, 255, 0.95);
        }
.theme-dark .chat-input {
            border-top: 1px solid rgba(255, 255, 255, 0.05);
            background: #1e293b;
        }
.chat-input input {
            flex: 1;
            padding: 12px 16px;
            border-radius: 14px;
            border: 1px solid rgba(0, 0, 0, 0.1);
            background: #f8fafc;
            color: var(--text);
            font-size: 0.95rem;
            transition: all 0.2s ease;
        }
.theme-dark .chat-input input {
            border-color: rgba(255, 255, 255, 0.1);
            background: #0f172a;
        }
.chat-input input:focus {
            outline: none;
            border-color: #9A2109;
            box-shadow: 0 0 0 3px rgba(154, 33, 9, 0.1);
        }
.theme-dark .chat-input input:focus {
            border-color: #ff9900;
            box-shadow: 0 0 0 3px rgba(255, 153, 0, 0.15);
        }
.chat-input .voice-button {
            border: 1px solid rgba(0, 0, 0, 0.1);
            background: #f8fafc;
            color: var(--text);
            width: 44px;
            height: 44px;
            border-radius: 14px;
            cursor: pointer;
            display: grid;
            place-items: center;
            transition: all 0.2s ease;
        }
.theme-dark .chat-input .voice-button {
            border-color: rgba(255, 255, 255, 0.1);
            background: #0f172a;
        }
.chat-input .voice-button:hover {
            background: rgba(0, 0, 0, 0.05);
            transform: scale(1.05);
        }
.theme-dark .chat-input .voice-button:hover {
            background: rgba(255, 255, 255, 0.05);
        }
.chat-input .send-button {
            background: #9A2109;
            color: #ffffff;
            border: none;
            width: 44px;
            height: 44px;
            border-radius: 14px;
            cursor: pointer;
            display: grid;
            place-items: center;
            transition: all 0.2s ease;
            box-shadow: 0 4px 10px rgba(154, 33, 9, 0.2);
        }
.chat-input .send-button:hover {
            background: #c92b0c;
            transform: translateY(-2px);
            box-shadow: 0 6px 14px rgba(154, 33, 9, 0.3);
        }
.theme-dark .chat-input .send-button {
            background: #ff9900;
            color: #0f172a;
            box-shadow: 0 4px 10px rgba(255, 153, 0, 0.2);
        }
.theme-dark .chat-input .send-button:hover {
            background: #ffb84d;
            box-shadow: 0 6px 14px rgba(255, 153, 0, 0.35);
        }
.message .avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            flex-shrink: 0;
            display: grid;
            place-items: center;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
        }
.message.bot .avatar {
            background: #ffffff;
            border: 2px solid #9A2109;
            box-shadow: 0 2px 6px rgba(154, 33, 9, 0.15);
        }
.theme-dark .message.bot .avatar {
            border-color: #ff9900;
            box-shadow: 0 2px 6px rgba(255, 153, 0, 0.25);
        }
.message.user .avatar {
            background: #e2e8f0;
            border: 1px solid rgba(0, 0, 0, 0.05);
        }
.theme-dark .message.user .avatar {
            background: #334155;
            border-color: rgba(255, 255, 255, 0.05);
        }
.message .bubble {
            padding: 12px 16px;
            border-radius: 18px;
            line-height: 1.5;
            font-size: 0.95rem;
            font-weight: 500;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
            word-wrap: break-word;
        }
.message.bot .bubble {
            background: #ffffff;
            color: #1e293b;
            border: 1px solid rgba(0, 0, 0, 0.05);
            border-top-left-radius: 4px;
        }
.theme-dark .message.bot .bubble {
            background: #1e293b;
            color: #f1f5f9;
            border-color: rgba(255, 255, 255, 0.04);
        }
.message.user .bubble {
            background: linear-gradient(135deg, #9A2109, #c92b0c);
            color: #ffffff;
            border-top-right-radius: 4px;
            box-shadow: 0 4px 12px rgba(154, 33, 9, 0.15);
        }
.theme-dark .message.user .bubble {
            background: linear-gradient(135deg, #ff9900, #ffb84d);
            color: #0f172a;
            box-shadow: 0 4px 12px rgba(255, 153, 0, 0.2);
        }
/* Typing indicator (dipakai JS) */
        .typing {
            display: inline-flex;
            gap: 6px;
            align-items: center;
        }
@media (max-width: 480px) {
            .chatbot-button img {
                width: 64px
            }

            .chat-container {
                right: 0;
                left: 0;
                margin: 0 auto;
                bottom: 0;
                width: 100vw;
                height: 80vh;
                max-height: 80vh;
                border-radius: 16px 16px 0 0;
            }

            .chat-container .bubble a {
                color: #9A2109 !important;
                text-decoration: underline !important;
                font-weight: 700 !important;
            }

            .chat-options {
                grid-template-columns: 1fr
            }
        }
@media (prefers-reduced-motion: reduce) {

            .chat-container,
            .chatbot-button {
                transition: none
            }
        }
@media (max-width: 768px) {
            .stats-box {
                max-width: 90%;
                padding: 20px;
            }

            .stats-box p {
                font-size: 14px;
            }

            .chat-container .bubble a {
                color: #9A2109 !important;
                text-decoration: underline !important;
                font-weight: 700 !important;
            }
        }
.theme-dark .stats-card {
            border-color: rgba(51, 65, 85, 0.6) !important;
            background: radial-gradient(circle at top left, rgba(30, 64, 175, 0.15) 0%, rgba(2, 6, 23, 0.8) 40%, rgba(2, 6, 23, 0.95) 100%) !important;
            box-shadow: 0 18px 46px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
        }
.theme-dark .stats-card:hover {
            box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
        }
.theme-dark .stats-title-icon {
            background: rgba(56, 189, 248, 0.1) !important;
            border-color: rgba(56, 189, 248, 0.25) !important;
            color: #38bdf8 !important;
        }
.theme-dark .stats-status-chip.ok {
            color: #4ade80 !important;
        }
.theme-dark .stats-item {
            background: rgba(15, 23, 42, 0.6) !important;
            border-color: rgba(255, 255, 255, 0.05) !important;
        }
.theme-dark .stats-item:hover {
            background: rgba(30, 41, 59, 0.8) !important;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3) !important;
        }
.theme-dark .stats-num.loading {
            background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.08) 50%, rgba(255, 255, 255, 0.04) 75%) !important;
            background-size: 200% 100% !important;
        }
.theme-dark .online-badge {
            background: rgba(30, 41, 59, 0.8) !important;
            border-color: rgba(255, 255, 255, 0.1) !important;
        }
.theme-dark .news-card {
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25) !important;
        }
.theme-dark .news-card:hover {
            box-shadow: 0 12px 30px rgba(255, 153, 0, 0.15) !important;
        }
.theme-dark .news-badge {
            color: #ff9900 !important;
            background: rgba(255, 153, 0, 0.09) !important;
            border-color: rgba(255, 153, 0, 0.25) !important;
        }
.theme-dark .news-meta ion-icon {
            color: #ff9900 !important;
        }
.theme-dark .news-spotlight-card .card-title a:hover {
            color: #ff9900 !important;
        }
.theme-dark .news-sub-card .card-title a:hover {
            color: #ff9900 !important;
        }
.theme-dark .news-cta-btn {
            background: linear-gradient(90deg, #ff9900, #d97706) !important;
            box-shadow: 0 4px 15px rgba(251, 191, 36, 0.15) !important;
        }
.theme-dark .news-cta-btn:hover {
            box-shadow: 0 6px 20px rgba(251, 191, 36, 0.25) !important;
        }
.theme-dark .feature-card {
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
        }
.theme-dark .feature-card:hover {
            box-shadow: 0 12px 30px rgba(255, 153, 0, 0.12) !important;
        }
.theme-dark .feature-card .card2-title:hover {
            color: #ff9900 !important;
        }
.theme-dark .video-play-btn {
            background: #ff9900 !important;
            box-shadow: 0 0 0 0 rgba(255, 153, 0, 0.4) !important;
        }
.theme-dark .video-thumbnail-container:hover .video-play-btn {
            background: #e68a00 !important;
            animation: pulsePlayBtnDark 1.5s infinite !important;
        }
.theme-dark .header {
            background-color: #0b1224 !important;
            background-image:
                linear-gradient(to right, rgba(11, 18, 36, 0) 0%, rgba(11, 18, 36, 1) 18%, rgba(11, 18, 36, 1) 82%, rgba(11, 18, 36, 0) 100%),
                url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPSc4MCcgaGVpZ2h0PSc4MCcgdmlld0JveD0nMCAwIDgwIDgwJz48ZyBzdHJva2U9J3JnYmEoMjU1LDI1NSwyNTUsMC4xNCknIHN0cm9rZS13aWR0aD0nMS4yJyBmaWxsPSdub25lJz48ZWxsaXBzZSBjeD0nNDAnIGN5PSc0MCcgcng9JzE4JyByeT0nMzYnIC8+PGVsbGlwc2UgY3g9JzQwJyBjeT0nNDAnIHJ4PSczNicgcnk9JzE4JyAvPjxjaXJjbGUgY3g9JzQwJyBjeT0nNDAnIHI9JzUnIC8+PGNpcmNsZSBjeD0nNDAnIGN5PSc0MCcgcj0nMicgZmlsbD0ncmdiYSgyNTUsMjU1LDI1NSwwLjA0KScgLz48ZWxsaXBzZSBjeD0nMCcgY3k9JzAnIHJ4PScxOCcgcnk9JzM2JyAvPjxlbGxpcHNlIGN4PScwJyBjeT0nMCcgcng9JzM2JyByeT0nMTgnIC8+PGNpcmNsZSBjeD0nMCcgY3k9JzAnIHI9JzUnIC8+PGVsbGlwc2UgY3g9JzgwJyBjeT0nMCcgcng9JzE4JyByeT0nMzYnIC8+PGVsbGlwc2UgY3g9JzgwJyBjeT0nMCcgcng9JzM2JyByeT0nMTgnIC8+PGNpcmNsZSBjeD0nODAnIGN5PScwJyByPSc1JyAvPjxlbGxpcHNlIGN4PScwJyBjeT0nODAnIHJ4PScxOCcgcnk9JzM2JyAvPjxlbGxpcHNlIGN4PScwJyBjeT0nODAnIHJ4PSczNicgcnk9JzE4JyAvPjxjaXJjbGUgY3g9JzAnIGN5PSc4MCcgcj0nNScgLz48ZWxsaXBzZSBjeD0nODAnIGN5PSc4MCcgcng9JzE4JyByeT0nMzYnIC8+PGVsbGlwc2UgY3g9JzgwJyBjeT0nODAnIHJ4PSczNicgcnk9JzE4JyAvPjxjaXJjbGUgY3g9JzgwJyBjeT0nODAnIHI9JzUnIC8+PHBhdGggZD0nTTQwIDEyIEw0OCAyMCBMNDAgMjggTDMyIDIwIFonIC8+PHBhdGggZD0nTTQwIDUyIEw0OCA2MCBMNDAgNjggTDMyIDYwIFonIC8+PHBhdGggZD0nTTEyIDQwIEwyMCA0OCBMMjggNDAgTDIwIDMyIFonIC8+PHBhdGggZD0nTTUyIDQwIEw2MCA0OCBMNjggNDAgTDYwIDMyIFonIC8+PC9nPjwvc3ZnPg==") !important;
            background-size: auto, 60px 60px !important;
            background-repeat: repeat !important;
        }
