@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

/* --- STYLE OGÓLNE --- */
.sparta-welcome-badge, .mediafy-welcome-badge { position: fixed; bottom: 80px; right: 105px; padding: 12px 18px; background: #fff; color: #1F2937; border-radius: 20px 20px 4px 20px; box-shadow: 0 2px 8px rgba(0,0,0,.2); font-size: 13px; font-weight: 600; display: none; align-items: center; gap: 8px; white-space: nowrap; z-index: 999999; cursor: pointer; animation: bounce-in .5s ease-out }
.sparta-welcome-badge { display: none }
.mediafy-welcome-badge { bottom: 160px }
.chatbot-toggler { position: fixed; bottom: 30px; right: 35px; background: #F97316; border: none; display: none; align-items: center; justify-content: center; height: 60px; width: 60px; border-radius: 50%; box-shadow: 0 4px 12px rgba(0,0,0,.3); cursor: pointer; z-index: 999999; color: #fff; opacity: 0; transform: scale(0.5); transition: all 0.5s ease-out }
.chatbot-toggler.show { opacity: 1; transform: scale(1) }
#mediafy-root-container .chatbot-toggler { bottom: 110px; background: #2563EB }
.chatbot-toggler span { transition: all 0.3s ease-out }
.chatbot-toggler span:last-child { display: none }
.show-widget #sparta-root-container .chatbot-toggler span:first-child { display: none }
.show-widget #sparta-root-container .chatbot-toggler span:last-child { display: block; animation: rotate-in 0.3s ease-out }
.show-mediafy-widget #mediafy-root-container .chatbot-toggler span:first-child { display: none }
#sparta-root-container .chatbot-toggler span:first-child, #mediafy-root-container .chatbot-toggler span:first-child { animation: rotate-in 0.3s ease-out }
.show-mediafy-widget #mediafy-root-container .chatbot-toggler span:last-child { display: block; animation: rotate-in 0.3s ease-out }
@keyframes rotate-in { from { transform: rotate(-90deg); opacity: 0 } to { transform: rotate(0); opacity: 1 } }
.chatbot-widget { position: fixed; right: 35px; bottom: 180px; width: 380px; height: 600px; max-height: calc(100vh - 200px); background: #131314; border-radius: 24px; box-shadow: 0 12px 24px rgba(0,0,0,.5); opacity: 0; pointer-events: none; transform: scale(.9); transform-origin: bottom right; transition: .2s; display: flex; flex-direction: column; overflow: hidden; z-index: 999998; border: 1px solid #333 }
.show-widget #sparta-root-container .chatbot-widget, .show-mediafy-widget #mediafy-root-container .chatbot-widget { opacity: 1; transform: scale(1); pointer-events: auto }
.widget-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; background: #131314 }
.header-title { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: center }
.header-title h1 { font-size: 16px; font-weight: 700; color: #fff; margin: 0 }
.demo-badge { background: #F97316; color: #fff; font-size: 10px; font-weight: 700; padding: 4px 8px; border-radius: 8px }
#mediafy-root-container .demo-badge { background: #2563EB }
.profile-icon { width: 36px; height: 36px; background: #F97316; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700 }
#mediafy-root-container .profile-icon { background: #2563EB }
.menu-icon, .close-panel-icon, .close-cart { cursor: pointer; color: #fff }
.settings-panel, .cart-panel { position: absolute; top: 70px; left: 0; width: 100%; height: calc(100% - 70px); background: #131314; z-index: 15; padding: 20px; display: none; flex-direction: column; overflow-y: auto }
.settings-panel.active, .cart-panel.active { display: flex }
.widget-content { flex: 1; padding: 0 24px; overflow-y: auto; overflow-x: hidden; background: #131314; display: flex; flex-direction: column }
.initial-content { display: flex; flex-direction: column; gap: 20px; margin-top: 20px }
.welcome-text h2 { color: #fff; font-size: 24px; margin: 0 0 8px 0 }
.welcome-text p { color: #9da3ae; margin: 0; font-size: 16px; font-weight: 600 }
.action-chips { display: flex; flex-direction: column; gap: 10px }
.chip { background: #27272a; border: 1px solid #333; padding: 16px 12px; border-radius: 12px; color: #e5e7eb; cursor: pointer; text-align: left; font-size: 14px; transition: .2s }
.chip:hover { background: #333 }
.chatbox { list-style: none; display: none; flex-direction: column; gap: 20px; width: 100%; padding-bottom: 10px; margin-top: auto; padding: 0; margin: 0 }
.chatbox.active { display: flex }
.chat-message { display: flex; align-items: flex-end; width: 100%; margin-bottom: 10px; gap: 8px }
.chat-message.outgoing { justify-content: flex-end }
.bot-icon { width: 32px; height: 32px; background: #F97316; color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0 }
#mediafy-root-container .bot-icon { background: #2563EB }
.bottom-input-area { padding: 0 24px 8px; background: #131314 }
.input-container-dark { background: #1e1e1e; border-radius: 24px; padding: 8px 16px; border: 1px solid #333 }
.chat-input-field { background: transparent; border: none; color: #fff; width: 100%; outline: 0; resize: none; min-height: 20px; max-height: 120px; padding: 0; font-size: 15px; font-family: inherit }
.input-controls-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; gap: 10px }
.icon-btn-dark { background: transparent; border: none; color: #9da3ae; cursor: default; padding: 8px; border-radius: 8px; position: relative; pointer-events: none }
.cart-badge { position: absolute; top: -4px; right: -4px; background: #F97316; color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 50%; min-width: 18px; height: 18px; display: flex; align-items: center; justify-content: center }
.pill-btn-outline { background: transparent; border: 1px solid #333; color: #fff; padding: 8px 16px; border-radius: 50px; cursor: pointer; font-size: 14px; display: flex; align-items: center; gap: 6px }
.send-btn { background: #F97316; border: none; color: #fff; padding: 10px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px }
#mediafy-root-container .send-btn { background: #2563EB }
.mediafy-footer { text-align: center; padding: 6px 0 4px 0; font-size: 11px; color: #666 }
.cart-item { display: flex; align-items: center; gap: 15px; background: #1e1e1e; padding: 12px; border-radius: 16px; margin-bottom: 10px }
.item-image { width: 50px; height: 50px; background: #2c2c2e; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff }
.cart-footer { margin-top: auto; padding-top: 20px; border-top: 1px solid #333 }
.custom-modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,.8); z-index: 9999999; align-items: center; justify-content: center }
@keyframes bounce-in { 0% { transform: scale(.5); opacity: 0 } 70% { transform: scale(1.05); opacity: 1 } 100% { transform: scale(1) } }
@media(max-width:450px) { .chatbot-widget { width: 100%; height: 100%; right: 0; bottom: 0; border-radius: 0 } .show-widget #sparta-root-container .chatbot-widget, .show-mediafy-widget #mediafy-root-container .chatbot-widget { height: 100dvh } .sparta-welcome-badge, .mediafy-welcome-badge { display: none } }

/* --- SEKCJA STABILNA (Tekst OK, Kropki w kwadracie) --- */

.message-text {
    display: block !important;       /* Naprawia nakładanie się tekstu */
    width: fit-content;              /* Szerokość dopasowana do treści */
    max-width: 280px;
    
    padding: 14px 18px;
    font-size: 15px;
    line-height: 1.5;

    word-wrap: break-word;
    overflow-wrap: break-word; 
    word-break: normal;
    white-space: pre-wrap;

    background: #2c2c2e;
    color: #fff;
    border-radius: 4px 20px 20px 20px;
}

.chat-message.outgoing .message-text { background: #F97316; color: #fff; border-radius: 20px 20px 4px 20px }
#mediafy-root-container .chat-message.outgoing .message-text { background: #2563EB }

/* --- UKRYWANIE DYMKA POWITALNEGO --- */
body.show-widget .sparta-welcome-badge,
body.show-widget .mediafy-welcome-badge,
body.show-mediafy-widget .sparta-welcome-badge,
body.show-mediafy-widget .mediafy-welcome-badge {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
/* --- FIX: Wygląd paska przewijania (Scrollbar) --- */
.chatbot-widget *::-webkit-scrollbar {
    width: 6px;
}

.chatbot-widget *::-webkit-scrollbar-track {
    background: #131314;
}

/* Scrollbar dla SPARTA (Pomarańczowy) */
#sparta-root-container .chatbot-widget *::-webkit-scrollbar-thumb {
    background: #F97316;
    border-radius: 10px;
}

/* Scrollbar dla MEDIAFY (Niebieski) */
#mediafy-root-container .chatbot-widget *::-webkit-scrollbar-thumb {
    background: #2563EB;
    border-radius: 10px;
}
