/* SFTP-TEST-2026-03-30 */
/* =========================
   KAMPUŚ — AI CHAT 
   ========================= */

/* === FAB BUTTON (nad bottom barem, prawy) === */
#ai-chat-fab {
    position: fixed;
    bottom: 92px;
    right: 14px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    
    border: none;
    box-shadow: 0 3px 14px rgba(74, 144, 226, 0.45);
    cursor: pointer;
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

#ai-chat-fab:active {
    transform: scale(0.93);
}

#ai-chat-fab .kampus-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    pointer-events: none;
}

/* Pulse */
#ai-chat-fab::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(74, 144, 226, 0.25);
    animation: kampus-pulse 2.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes kampus-pulse {
    0%, 100% { transform: scale(1); opacity: 0.25; }
    50% { transform: scale(1.25); opacity: 0; }
}

/* Dismiss (X) button — mały przycisk obok FAB */
#ai-chat-dismiss {
    position: fixed;
    bottom: 112px;
    right: 14px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.35);
    border: none;
    cursor: pointer;
    z-index: 2501;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

#ai-chat-dismiss:hover {
    background: rgba(0,0,0,0.55);
}

#ai-chat-dismiss svg {
    width: 12px;
    height: 12px;
}

/* === PANEL CZATU === */
#ai-chat-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 75vh;
    max-height: 580px;
    background: #fff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.15);
    z-index: 3000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

#ai-chat-panel.open {
    display: flex;
    transform: translateY(0);
}

/* Header */
.ai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
    color: white;
    flex-shrink: 0;
}

.ai-chat-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-chat-header-left .ai-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ai-chat-header-left .ai-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.ai-chat-header-left .ai-title {
    font-weight: 600;
    font-size: 15px;
}

.ai-chat-header-left .ai-subtitle {
    font-size: 11px;
    opacity: 0.8;
}

.ai-chat-close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.ai-chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* === WIADOMOŚCI === */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8f9fa;
}

.ai-msg {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: ai-msg-in 0.2s ease;
}

@keyframes ai-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.ai-msg.user {
    align-self: flex-end;
    background: #4A90E2;
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-msg.assistant {
    align-self: flex-start;
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* === TYPING INDICATOR === */
.ai-typing {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.ai-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #b0b0b0;
    animation: ai-typing-dot 1.2s ease-in-out infinite;
}

.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes ai-typing-dot {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* === KLIKALNE KARTY MIEJSCÓWEK === */
.ai-spot-cards {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 88%;
    align-self: flex-start;
    animation: ai-msg-in 0.25s ease;
}

.ai-spot-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: white;
    border: 1.5px solid #DCEBFA;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
}

.ai-spot-card:hover {
    border-color: #4A90E2;
    box-shadow: 0 2px 10px rgba(74, 144, 226, 0.15);
}

.ai-spot-card:active {
    transform: scale(0.98);
}

.ai-spot-card-left {
    flex-shrink: 0;
}

.ai-spot-card-icon {
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #f0f6ff;
}

.ai-spot-card-info {
    flex: 1;
    min-width: 0;
}

.ai-spot-card-name {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-spot-card-meta {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-spot-card-cat {
    color: #4A90E2;
    font-weight: 500;
}

.ai-spot-card-arrow {
    flex-shrink: 0;
    opacity: 0.5;
}

/* === SUGESTIE === */
.ai-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 14px 10px;
    background: #f8f9fa;
}

.ai-suggestion-chip {
    padding: 7px 12px;
    border: 1px solid #DCEBFA;
    border-radius: 20px;
    background: white;
    color: #4A90E2;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.ai-suggestion-chip:hover {
    background: #EEF4FC;
    border-color: #4A90E2;
}

/* === INPUT === */
.ai-chat-input-area {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    gap: 8px;
    border-top: 1px solid #eee;
    background: white;
    flex-shrink: 0;
}

.ai-chat-input-area input {
    flex: 1;
    border: 1.5px solid #DCEBFA;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.ai-chat-input-area input:focus {
    border-color: #4A90E2;
}

.ai-chat-send-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: #4A90E2;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
}

.ai-chat-send-btn:hover {
    background: #357ABD;
}

.ai-chat-send-btn:active {
    transform: scale(0.92);
}

.ai-chat-send-btn:disabled {
    background: #b0c4de;
    cursor: not-allowed;
}

/* === DESKTOP === */
@media (min-width: 768px) {
    #ai-chat-panel {
        left: auto;
        right: 14px;
        bottom: 72px;
        width: 400px;
        height: 520px;
        max-height: 520px;
        border-radius: 20px;
    }

    #ai-chat-fab {
        bottom: 14px;
        right: 14px;
    }

    #ai-chat-dismiss {
        bottom: 54px;
        right: 14px;
    }
}
