/* assets/css/ai-chat.css */

/* Plovoucí tlačítko chatu */
.ai-chat-bubble-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    box-shadow: 0 4px 20px rgba(2, 132, 199, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.ai-chat-bubble-btn:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 24px rgba(2, 132, 199, 0.6);
}

.ai-chat-bubble-btn svg {
    width: 28px;
    height: 28px;
    color: #ffffff;
    transition: transform 0.3s ease;
}

.ai-chat-bubble-btn:hover svg {
    transform: scale(1.05);
}

/* Pulzující upozornění / tečka */
.ai-chat-bubble-btn::after {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background-color: #22c55e;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    animation: ai-pulse 2s infinite;
}

@keyframes ai-pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

/* Hlavní chatovací okno */
.ai-chat-window {
    position: fixed;
    bottom: 95px;
    right: 25px;
    width: 380px;
    height: 520px;
    max-height: calc(100vh - 120px);
    border-radius: 20px;
    background: rgba(15, 23, 42, 0.85); /* Tmavě modrý glassmorphism */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 9998;
    overflow: hidden;
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Hlavička chatu */
.ai-chat-header {
    padding: 16px 20px;
    background: linear-gradient(90deg, rgba(3, 105, 161, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.ai-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #0284c7;
    border: 2px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    overflow: hidden;
}

.ai-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ai-chat-header-info h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #f8fafc;
    line-height: 1.2;
}

.ai-chat-header-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: #38bdf8;
    margin-top: 2px;
}

.ai-chat-header-status::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #22c55e;
    border-radius: 50%;
}

.ai-chat-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 4px;
    line-height: 1;
}

.ai-chat-close-btn:hover {
    color: #f8fafc;
}

/* Tělo chatu s historií zpráv */
.ai-chat-body {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

/* Bubliny zpráv */
.ai-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.9rem;
    line-height: 1.45;
    word-wrap: break-word;
    color: #f1f5f9;
    animation: message-fade-in 0.3s ease forwards;
}

@keyframes message-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Zpráva od uživatele */
.ai-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Zpráva od AI asistenta */
.ai-message.assistant {
    align-self: flex-start;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom-left-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Odkazy v AI zprávách */
.ai-message.assistant a {
    color: #38bdf8;
    text-decoration: underline;
    font-weight: 500;
    transition: color 0.2s ease;
}

.ai-message.assistant a:hover {
    color: #7dd3fc;
}

.ai-message.assistant p {
    margin: 0 0 10px 0;
}

.ai-message.assistant p:last-child {
    margin-bottom: 0;
}

.ai-message.assistant ul, .ai-message.assistant ol {
    margin: 8px 0;
    padding-left: 20px;
}

.ai-message.assistant li {
    margin-bottom: 4px;
}

/* Indikátor psaní AI */
.ai-typing-indicator {
    align-self: flex-start;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    padding: 12px 20px;
    display: none;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ai-typing-dot {
    width: 6px;
    height: 6px;
    background-color: #cbd5e1;
    border-radius: 50%;
    animation: typing-dot-bounce 1.4s infinite ease-in-out both;
}

.ai-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.ai-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-dot-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

/* Rychlé dotazy (Suggested Chips) */
.ai-chat-quick-queries {
    padding: 0 20px 10px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-query-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ai-query-chip:hover {
    background: rgba(2, 132, 199, 0.15);
    border-color: #0284c7;
    color: #38bdf8;
}

/* Vstupní oblast s formulářem */
.ai-chat-input-container {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(15, 23, 42, 0.95);
}

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

.ai-chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 14px;
    color: #f8fafc;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}

.ai-chat-input:focus {
    border-color: #0284c7;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

.ai-chat-input::placeholder {
    color: #64748b;
}

.ai-chat-send-btn {
    background: #0284c7;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-chat-send-btn:hover {
    background: #0369a1;
    transform: translateY(-1px);
}

.ai-chat-send-btn:active {
    transform: translateY(0);
}

.ai-chat-send-btn svg {
    width: 18px;
    height: 18px;
}

/* Pěkný scrollbar pro chat body */
.ai-chat-body::-webkit-scrollbar {
    width: 6px;
}

.ai-chat-body::-webkit-scrollbar-track {
    background: transparent;
}

.ai-chat-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.ai-chat-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Mobilní responzivita */
@media (max-width: 480px) {
    .ai-chat-window {
        bottom: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        border: none !important;
    }
    
    .ai-chat-bubble-btn {
        bottom: 15px;
        right: 15px;
    }
}
