/* Reset és alapértelmezett stílusok */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f7fa;
    height: 100vh;
    overflow: hidden;
}

/* Főoldal címsor */
.main-container {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.main-title {
    font-size: 48px;
    color: #2c3e50;
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: normal;
}

/* Chat trigger button */
.chat-trigger {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.3);
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-trigger:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 24px rgba(0, 123, 255, 0.4);
}

.chat-trigger.active {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
}

.chat-trigger svg {
    width: 28px;
    height: 28px;
    color: white;
    transition: all 0.3s ease;
}

.chat-trigger .chat-icon {
    display: block;
}

.chat-trigger .close-icon {
    display: none;
}

.chat-trigger.active .chat-icon {
    display: none;
}

.chat-trigger.active .close-icon {
    display: block;
}

/* Chat popup */
.chat-popup {
    position: fixed;
    right: 16px;
    bottom: 84px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #d1d5da;
    z-index: 999;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.chat-popup.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* Chat container */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Chat header */
.chat-header {
    padding: 15px;
    background: linear-gradient(90deg, #007bff 0%, #00c4ff 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.chat-header h2 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

/* Message container */
.message-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    display: block; /* Flex helyett block, hogy a görgetés jobban működjön */
    scroll-behavior: smooth;
}

.message-container > .chat-message {
    margin-bottom: 16px;
}

.message-container > .chat-message:last-child {
    margin-bottom: 0;
}

.message-container::-webkit-scrollbar {
    width: 6px;
}

.message-container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.message-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.message-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Chat messages */
.chat-message {
    display: flex;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease-out, 
                transform 0.5s ease-out;
}

.chat-message.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.message-bubble {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    white-space: pre-wrap; /* Sortörések megőrzése */
    /* Smooth content update amikor chunk érkezik */
    transition: all 0.1s ease-out;
}

.user-message {
    justify-content: flex-end;
}

.user-message .message-bubble {
    background-color: #e2e8f0;
    color: #2c3e50;
}

.agent-message {
    justify-content: flex-start;
}

.agent-message .message-bubble {
    background-color: #007bff;
    color: white;
}

/* Typing indicator */
.typing-indicator {
    display: none;
    justify-content: flex-start;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.5s ease-out,
                transform 0.5s ease-out;
    margin-bottom: 16px;
}

.typing-indicator.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.typing-indicator .message-bubble {
    background-color: #007bff;
    padding: 15px 20px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.typing-indicator .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.7);
    animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-indicator .dot:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Chat input */
.chat-input-container {
    padding: 12px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #d1d5da;
    border-radius: 15px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: #007bff;
}

.chat-input:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.6;
}

.send-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #007bff;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-button:hover:not(.disabled) {
    background: #0056b3;
    transform: scale(1.05);
}

.send-button.disabled {
    background: #e2e8f0;
    cursor: not-allowed;
    opacity: 0.6;
}

.send-button svg {
    width: 18px;
    height: 18px;
}

/* Status and error messages */
.chat-status,
.chat-error {
    text-align: center;
    padding: 20px;
    font-size: 14px;
}

.chat-status {
    color: #007bff;
}

.chat-error {
    color: #dc3545;
}

/* Responsive design */
@media (max-width: 768px) {
    .main-title {
        font-size: 32px;
        padding: 0 20px;
    }

    .chat-popup {
        right: 8px;
        left: 8px;
        width: auto;
        bottom: 76px;
    }

    .chat-trigger {
        right: 8px;
        bottom: 8px;
    }
}

