/* Lebegő gomb */
#gym-ai-toggle-btn {
    position: fixed !important;
    bottom: 24px !important;
    /* Közelebb az aljához */
    right: 24px !important;
    left: auto !important;
    width: 60px !important;
    height: 60px !important;
    background-color: #2563eb;
    /* blue-600 */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    border: none;
    outline: none;
}

.gym-ai-floating-btn:hover {
    background-color: #1d4ed8;
    /* blue-700 */
    transform: scale(1.05);
}

/* Toast / Buborék üzenet */
.gym-ai-toast-bubble {
    position: fixed;
    bottom: 95px;
    /* A gomb felett */
    right: 24px;
    background: #2563eb;
    color: white;
    padding: 10px 18px;
    border-radius: 14px;
    border-bottom-right-radius: 2px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9998;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
    white-space: nowrap;
}

.gym-ai-toast-bubble::after {
    content: '';
    position: absolute;
    bottom: -6px;
    right: 15px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #2563eb;
}

.gym-ai-toast-bubble.show {
    opacity: 1;
    transform: translateY(0);
}

/* Chat ablak (rejtett állapot) */
.gym-ai-chat-window {
    z-index: 9999;
    position: fixed !important;
    bottom: 24px !important;
    /* Még közelebb az aljához */
    right: 24px;
    /* Jobb oldalra */
    left: auto;
    width: 380px;
    max-width: 95%;
    height: 850px;
    /* Megemelt magasság */
    max-height: 90vh;
    background: white;
    border-radius: 24px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Animációk */
.gym-ai-chat-window.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

#chat-messages {
    flex-grow: 1;
    /* Kitölti a maradék helyet */
    height: auto !important;
    /* Felülírja a tailwind h-[400px]-et */
}

#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Markdown Formázás */
.gym-ai-message-content {
    line-height: 1.5;
}

.gym-ai-message-content p {
    margin-bottom: 0.25em;
    /* Csökkentett térköz */
}

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

.gym-ai-message-content strong {
    font-weight: 700;
}

.gym-ai-message-content ul,
.gym-ai-message-content ol {
    margin-left: 1.2em;
    margin-bottom: 0.5em;
    list-style-type: disc;
    color: #334155;
    /* Sötét szín a listáknak */
}

.gym-ai-message-content ol {
    list-style-type: decimal;
}

/* Táblázatok */
.gym-ai-message-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85em;
    margin: 0.8em 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.gym-ai-message-content th,
.gym-ai-message-content td {
    padding: 8px 12px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
    color: #334155;
}

.gym-ai-message-content th {
    background-color: #f8fafc;
    font-weight: 700;
    color: #0f172a;
    border-bottom: 2px solid #e2e8f0;
}

.gym-ai-message-content tr:last-child td {
    border-bottom: none;
}

/* Címsorok */
.gym-ai-message-content h1,
.gym-ai-message-content h2,
.gym-ai-message-content h3,
.gym-ai-message-content h4 {
    font-weight: 700;
    color: #dc2626;
    /* Címsorok is pirosak */
    margin-top: 1em;
    margin-bottom: 0.5em;
    font-size: 1.1em;
}

/* Kiemelések */
.gym-ai-message-content strong {
    font-weight: 700;
    color: #dc2626 !important;
}

/* User message specific overrides (Blue Bubble) */
.bg-blue-600 .gym-ai-message-content table {
    border-color: rgba(255, 255, 255, 0.2);
}

.bg-blue-600 .gym-ai-message-content th,
.bg-blue-600 .gym-ai-message-content td {
    color: white !important;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.bg-blue-600 .gym-ai-message-content th {
    background-color: rgba(0, 0, 0, 0.2);
    color: white !important;
}

.bg-blue-600 .gym-ai-message-content ul,
.bg-blue-600 .gym-ai-message-content ol,
.bg-blue-600 .gym-ai-message-content h1,
.bg-blue-600 .gym-ai-message-content h2,
.bg-blue-600 .gym-ai-message-content h3,
.bg-blue-600 .gym-ai-message-content h4,
.bg-blue-600 .gym-ai-message-content strong {
    color: white !important;
}