@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
/* Vložení FontAwesome pro ikony (pokud není na webu) */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css');

#kodee-chat-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* --- MICHAL KLAPUCH BRAND COLORS --- */
    --primary-color: #FC033B; /* Červená z webu */
    --secondary-color: #0D076F; /* Tmavě modrá z webu */
    
    /* Gradient: Červená -> Tmavší červená pro hloubku */
    --primary-gradient: linear-gradient(135deg, #FC033B 0%, #D6002E 100%); 
    
    /* Gradient pro uživatele: Tmavě modrá */
    --user-gradient: linear-gradient(135deg, #0D076F 0%, #080447 100%);

    --primary-shadow: rgba(252, 3, 59, 0.3);
    
    --bg-color: rgba(255, 255, 255, 0.98);
    --user-text: #ffffff; 
    --bot-bg: #f3f4f6;
    --bot-text: #1f2937;
    --radius-lg: 20px;
    --radius-md: 12px;
    box-sizing: border-box;
    position: fixed; bottom: 0; right: 0; z-index: 99999;
    pointer-events: none;
}

#kodee-chat-wrapper * { box-sizing: border-box; pointer-events: auto; }

/* Tlačítko (Červené) */
.kodee-toggle-btn {
    position: fixed; bottom: 25px; right: 25px;
    background: var(--primary-gradient) !important; 
    color: white !important; border: none !important; 
    border-radius: 50px !important; padding: 14px 24px !important;
    font-size: 15px !important; font-weight: 600 !important; cursor: pointer;
    box-shadow: 0 4px 20px var(--primary-shadow) !important;
    display: flex; align-items: center; gap: 10px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); 
    z-index: 99999;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.kodee-toggle-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 25px var(--primary-shadow) !important; }
.kodee-toggle-btn i { font-size: 18px; }

/* Okno */
.kodee-widget {
    position: fixed; bottom: 90px; right: 25px;
    width: 380px; height: 600px; max-height: 80vh;
    background: var(--bg-color) !important;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 1); border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px -10px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.03);
    display: none; flex-direction: column; overflow: hidden;
    opacity: 0; transform: translateY(20px) scale(0.98);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.kodee-widget.open { opacity: 1; transform: translateY(0) scale(1); }

@media (max-width: 480px) {
    .kodee-widget { width: 92%; right: 4%; bottom: 85px; height: 75vh; }
}

/* Hlavička */
.kodee-header {
    padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; 
    background: rgba(255,255,255,0.95); border-bottom: 1px solid #f1f5f9; flex-shrink: 0;
}
.kodee-title-group { display: flex; align-items: center; gap: 10px; }
.kodee-status-dot { width: 8px; height: 8px; background: #10b981; border-radius: 50%; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15); }
.kodee-title { font-weight: 700; font-size: 16px; color: var(--secondary-color); /* Modrý nadpis */ }
.kodee-actions { display: flex; gap: 8px; }
.kodee-action-btn { color: #94a3b8; cursor: pointer; padding: 8px; border-radius: 50%; transition: all 0.2s; font-size: 14px; }
.kodee-action-btn:hover { color: var(--primary-color); background: #fff0f3; }

/* Body */
.kodee-body { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; scroll-behavior: smooth; position: relative; background: #fff; }
.kodee-body::-webkit-scrollbar { width: 4px; }
.kodee-body::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 10px; }

/* Uvítání */
.kodee-welcome { text-align: center; margin-top: 20px; animation: fadeIn 0.5s ease; }
.kodee-logo {
    width: 60px; height: 60px; 
    background: linear-gradient(135deg, #fff0f3 0%, #ffeef1 100%); /* Světle červené pozadí */
    color: var(--primary-color); border-radius: 20px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 26px; margin-bottom: 16px; box-shadow: 0 8px 20px rgba(252, 3, 59, 0.15);
}
.kodee-greeting h3 { margin: 0 0 6px 0; font-size: 18px; color: var(--secondary-color); font-weight: 700; }
.kodee-greeting p { color: #64748b; margin: 0 0 20px 0; font-size: 14px; line-height: 1.5; }

/* Rychlé akce */
.quick-action {
    display: flex; align-items: center; text-align: left; background: white; border: 1px solid #e2e8f0;
    padding: 12px 14px; border-radius: 12px; margin-bottom: 8px; cursor: pointer; transition: all 0.2s;
    color: var(--secondary-color); font-size: 13px; font-weight: 600;
}
.quick-action:hover { background: #fff0f3; border-color: #ffcbd4; transform: translateX(2px); color: var(--primary-color); }
.quick-action i { margin-right: 12px; font-size: 14px; color: #94a3b8; transition: color 0.2s; width: 16px; text-align: center; }
.quick-action:hover i { color: var(--primary-color); }

/* Zprávy */
.message { max-width: 85%; margin-bottom: 20px; line-height: 1.6; position: relative; animation: slideUp 0.3s ease forwards; word-wrap: break-word; font-size: 14px; }

/* Uživatel = Modrá bublina */
.message.user {
    align-self: flex-end; 
    background: var(--user-gradient); 
    color: var(--user-text);
    padding: 12px 16px; border-radius: 18px 18px 4px 18px; 
    box-shadow: 0 4px 15px rgba(13, 7, 111, 0.25);
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.message.bot { align-self: flex-start; width: 100%; max-width: 100%; }

/* Bot prvky */
.bot-info { display: flex; align-items: center; margin-bottom: 6px; gap: 8px; margin-left: 2px; }
/* --- OPRAVA AVATARA (Michal) --- */
.bot-avatar {
    /* Ujistíme se, že má správnou velikost */
    width: 30px; 
    height: 30px; 
    
    /* Červené pozadí (podle vaší značky) */
    background: var(--primary-gradient) !important;
    
    /* DŮLEŽITÉ: Bílá barva ikony, aby byla na červené vidět */
    color: #ffffff !important; 
    
    /* Kulatý tvar a stín */
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(252, 3, 59, 0.4);
    
    /* Centrování ikony */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Pojistka přímo pro ikonu uvnitř */
.bot-avatar i {
    color: #ffffff !important;
    font-size: 14px; /* Velikost ikony helmy */
}
.bot-name { font-weight: 600; font-size: 12px; color: #64748b; }
.bot-bubble { 
    background: var(--bot-bg); color: var(--bot-text); padding: 14px 18px; 
    border-radius: 4px 18px 18px 18px; display: inline-block; width: fit-content; max-width: 92%;
}
.bot-message-content p { margin: 0 0 8px 0; } .bot-message-content p:last-child { margin: 0; }
.bot-message-content a { color: var(--primary-color); text-decoration: none; font-weight: 600; }
.bot-message-content ul { padding-left: 18px; margin: 6px 0; }

/* Loading */
.message.loading .bot-bubble {
    display: flex; align-items: center; gap: 10px; padding: 12px 16px;
    background: #f8fafc; border: 1px solid #e2e8f0;
    transition: border-color 0.3s;
    animation: pulseBorder 2s infinite;
}

@keyframes pulseBorder {
    0% { border-color: #e2e8f0; }
    50% { border-color: #94a3b8; }
    100% { border-color: #e2e8f0; }
}

.loading-dots { display: flex; align-items: center; gap: 4px; }
.loading-dot { 
    width: 5px; height: 5px; background: #94a3b8; border-radius: 50%; 
    animation: typingPulse 1.4s infinite ease-in-out both; 
}
.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }
.loading-text { 
    font-size: 13px; color: #64748b; font-style: italic; 
    min-width: 60px; transition: opacity 0.3s ease; white-space: nowrap;
}
@keyframes typingPulse { 0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; } 40% { transform: scale(1); opacity: 1; } }

/* Produktové karty / Služby */
.product-stack { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; width: 100%; }
.product-card {
    display: flex; flex-direction: row; background: #ffffff; border: 1px solid #e2e8f0;
    border-radius: 14px; overflow: hidden; box-shadow: 0 2px 6px rgba(0,0,0,0.02);
    transition: all 0.2s ease; text-decoration: none; width: 100%; align-items: center; position: relative;
}
.product-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.06); border-color: var(--primary-color); }
.pc-image-wrapper {
    width: 85px; height: 85px; flex-shrink: 0; background: #f8fafc;
    display: flex; align-items: center; justify-content: center; padding: 6px; border-right: 1px solid #f1f5f9;
}
.pc-image-wrapper img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.pc-content { padding: 10px 14px; display: flex; flex-direction: column; justify-content: center; flex-grow: 1; min-width: 0; }
.pc-badge {
    position: absolute; top: 6px; left: 6px; background: var(--primary-gradient);
    color: white; font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 6px; z-index: 2;
}
.pc-title { font-size: 13px; font-weight: 600; color: #1e293b; margin-bottom: 4px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-price { font-size: 14px; font-weight: 700; color: var(--primary-color); margin-bottom: 4px; }
.pc-cta { font-size: 11px; font-weight: 600; color: #64748b; display: flex; align-items: center; gap: 4px; margin-top: auto; }
.product-card:hover .pc-cta i { transform: translateX(3px); color: var(--primary-color); }

/* Hodnocení */
.message-rating { display: flex; gap: 12px; margin-top: 6px; margin-left: 2px; opacity: 0; transition: opacity 0.2s; }
.message.bot:hover .message-rating { opacity: 1; }
.message-rating i { cursor: pointer; font-size: 14px; color: #cbd5e1; transition: all 0.2s; }
.message-rating i:hover { color: var(--primary-color); transform: scale(1.1); }
.message-rating i.active { color: var(--primary-color); }

/* Patička */
.kodee-footer { padding: 14px 20px 20px 20px; background: rgba(255,255,255,0.9); border-top: 1px solid #f1f5f9; flex-shrink: 0; }
.input-wrapper {
    position: relative; border: 1px solid #e2e8f0 !important; border-radius: 24px !important; background: white !important;
    display: flex !important; align-items: center !important; padding: 6px 6px 6px 18px !important; min-height: 48px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02) !important; transition: border-color 0.2s, box-shadow 0.2s;
}
.input-wrapper:focus-within { border-color: var(--primary-color) !important; box-shadow: 0 4px 12px var(--primary-shadow) !important; }
.input-wrapper textarea {
    border: none !important; box-shadow: none !important; background: transparent !important;
    margin: 0 !important; padding: 0 !important; resize: none !important; width: 100% !important;
    outline: none !important; font-family: 'Inter', sans-serif !important; font-size: 14px !important;
    line-height: 20px !important; color: #334155 !important; max-height: 100px !important;
}
.send-btn {
    background: var(--primary-gradient) !important; border: none !important; width: 36px !important; height: 36px !important;
    border-radius: 50% !important; color: white !important; cursor: pointer !important; display: flex !important; align-items: center !important;
    justify-content: center !important; transition: all 0.3s !important; margin-left: 8px !important; flex-shrink: 0 !important;
    opacity: 0.5; pointer-events: none; transform: scale(0.9); box-shadow: 0 2px 6px var(--primary-shadow);
}
.send-btn.active { opacity: 1; pointer-events: all; transform: scale(1); }

/* Powered by */
.kodee-powered {
    display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px;
    font-size: 10px; color: #cbd5e1; font-weight: 500; user-select: none;
}
.hidden { display: none !important; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }