/* ===== CHATBOT WIDGET STYLES ===== */

/* Chatbot Widget Container */
.chatbot-widget {
    position: fixed;
    bottom: 385px;
    right: 37px;
    z-index: 1000;
}

/* Chatbot Button */
.chatbot-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
background: linear-gradient(135deg, #00bfff, #1e90ff);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 124, 186, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.chatbot-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 124, 186, 0.6);
}

/* Robot emoji animation */
.chatbot-emoji {
    font-size: 32px;
    transition: transform 0.3s ease;
    animation: emoji-bounce 2s infinite;
}

@keyframes emoji-bounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-5px) rotate(5deg); }
}

/* Pulse animation */
.chatbot-button::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(255, 77, 77, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* Chat Window */
.chatbot-window {
    position: absolute;
    bottom: -250px;
    right: 0;
    width: 380px;
    height: 650px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
    border: 1px solid #f0f0f0;
}

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

.chatbot-window.open {
    display: flex;
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, #ff4d4d 0%, #cc0000 100%);
    color: white;
    padding: 18px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.chat-header h3 {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.close-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

/* Chat Content */
.chat-content {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #fafafa;
    overflow-y: auto;
}

.welcome-message {
    text-align: center;
    margin-bottom: 30px;
}

.welcome-message .avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #ff4d4d 0%, #cc0000 100%);
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(255, 77, 77, 0.3);
    font-size: 36px;
}

.welcome-text {
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 25px;
}

.help-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.help-option {
    background: white;
    border: 1px solid #ffcccc;
    border-radius: 12px;
    padding: 15px;
    text-align: left;
    cursor: pointer;
    font-size: 15px;
    color: #555;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.help-option:hover {
    border-color: #ff4d4d;
    color: #ff4d4d;
    background: #fafafa;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(255, 77, 77, 0.15);
}

/* Message Form */
.message-form {
    padding: 20px 25px;
    border-top: 1px solid #f0f0f0;
    background: white;
}

.form-group {
    margin-bottom: 18px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff4d4d;
    box-shadow: 0 0 0 2px rgba(255, 77, 77, 0.1);
}

.form-group textarea {
    min-height: 100px;
}

.form-group .error {
    color: #ff4d4d;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.send-btn {
    width: 100%;
    background: linear-gradient(135deg, #ff4d4d 0%, #cc0000 100%);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 77, 77, 0.3);
}

.send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Status Message */
.status-message {
    display: none;
    padding: 20px;
    text-align: center;
    background: #f0fff0;
    color: #2d5a2d;
    font-size: 15px;
    line-height: 1.4;
    border-radius: 10px;
    margin: 20px;
    border: 1px solid #c8e6c9;
}

.status-message.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chatbot-widget {
        bottom: 250px;
        right: 320px;
    }
    
    .chatbot-window {
        position: fixed;
        right: 50px;
        bottom: 155px;
        left: auto;
        width: 300px;
        max-height: 550px;
        overflow-y: auto;
    }
    
    .chat-content {
        padding: 5px;
        padding-top: 2px;      /* Ελάχιστο padding επάνω για το εικονίδιο */
        max-height: 480px;
        overflow-y: auto;
    }
    
    .welcome-message {
        margin-top: -5px;         /* Καθόλου margin επάνω */
        padding-top: 2px;      /* Ελάχιστο padding */
    }
    
    .chatbot-button {
        width: 53px;
        height: 53px;
    }
    
    .chatbot-emoji {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .chatbot-window {
        width: 320px;
        right: 30px;
    }
    
    .chat-content {
        padding: 20px;
        padding-top: 5px;      /* Και εδώ ελάχιστο padding επάνω */
    }
    
    .message-form {
        padding: 15px 20px;
    }
}

.welcome-message {
    background-image: none !important;
    background: #fafafa !important;
}




.chatbot-window {
    overflow-y: auto !important;  /* Επιστροφή στο scroll */
}

.chat-content {
    overflow-y: auto !important;
    position: relative;
    z-index: 10;
    max-height: 480px !important;  /* Περιορισμός ύψους */
}

.welcome-message {
    position: relative;
    z-index: 11;
    top: 120px;  /* Μόνο λίγο πάνω, όχι -10px */
}


@media (max-width: 768px) {
    .avatar {
        width: 40px !important;      /* Αντί για 40px ή όσο έχετε */
        height: 40px !important;
        font-size: 22px !important;  /* Μικρότερο εικονίδιο μέσα */
    }
}



@media (max-width: 768px) {
    .chat-header {
        height: 45px !important;
        padding: 8px 15px !important;
        min-height: 45px !important;
        display: flex !important;
        visibility: visible !important;
        position: relative !important;
        z-index: 100 !important;
    }
    
    .chat-header h3 {
        font-size: 14px !important;
        margin: 0 !important;
        line-height: 30px !important;
        display: block !important;
        visibility: visible !important;
    }
    
    .chatbot-window {
        overflow-y: auto !important;    /* ΕΠΑΝΑΦΟΡΑ SCROLL */
        max-height: 100vh !important;   /* ΠΕΡΙΟΡΙΣΜΟΣ ΥΨΟΥΣ */
        position: fixed !important;
        top: 0 !important;
    }
    
    .chat-content {
        padding-top: 5px !important;
        margin-top: 0px !important;
        position: relative !important;
        overflow-y: auto !important;    /* SCROLL ΣΤΟ ΠΕΡΙΕΧΟΜΕΝΟ */
        max-height: calc(100vh - 60px) !important;  /* ΥΨΟΣ MINUS HEADER */
    }
    
    .welcome-message {
        margin-top: 0px !important;
        transform: translateY(0px) !important;  /* ΜΗΔΕΝΙΣΜΟΣ TRANSFORM */
    }
}







/* FIX για το κενό - COMPLETE SOLUTION */
.chatbot-window.open {
    display: flex !important;
    transform: translateY(0) !important;
    animation: none !important;
}

.chat-content {
    transform: translateY(0) !important;
    margin-top: 0 !important;
    padding-top: 15px !important;
    animation: none !important;
}

.welcome-message {
    transform: translateY(0) !important;
    margin-top: 0 !important;
    animation: none !important;
}

/* Εγγυημένη επαναφορά για δεύτερη φορά */
.chatbot-window.has-opened.open .chat-content,
.chatbot-window.has-opened.open .welcome-message {
    transform: translateY(0) !important;
    margin-top: 0 !important;
    padding-top: 15px !important;
    top: auto !important;
    position: relative !important;
}

/* Mobile reset */
@media (max-width: 768px) {
    .chatbot-window.open {
        position: fixed !important;
        bottom: 155px !important;
        transform: translateY(0) !important;
    }
    
    .chatbot-window.has-opened.open .chat-content {
        padding-top: 5px !important;
        margin-top: 0 !important;
    }
    
    .chatbot-window.has-opened.open .welcome-message {
        margin-top: 0 !important;
        transform: translateY(0) !important;
    }
}