/* Pythagoras Chatbot Styles */
#pythagoras-chatbot {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Chat Button */
#pythagoras-chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0B4F6C 0%, #0073E5 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(11, 79, 108, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

#pythagoras-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(11, 79, 108, 0.6);
}

#pythagoras-chat-button svg {
    width: 28px;
    height: 28px;
    fill: white;
}

#pythagoras-chat-button .close-icon {
    display: none;
}

#pythagoras-chat-button.active .chat-icon {
    display: none;
}

#pythagoras-chat-button.active .close-icon {
    display: block;
}

/* Notification Badge */
.pythagoras-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #FF4444;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Chat Window */
#pythagoras-chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.8);
    opacity: 0;
    transition: all 0.3s ease;
}

#pythagoras-chat-window.active {
    display: flex;
    transform: scale(1);
    opacity: 1;
}

/* Chat Header */
.pythagoras-chat-header {
    background: linear-gradient(135deg, #0B4F6C 0%, #0073E5 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.pythagoras-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    z-index: 10;
}

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

.pythagoras-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    color: #0B4F6C;
}

.pythagoras-header-text h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.pythagoras-header-text p {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
}

.pythagoras-status-dot {
    width: 8px;
    height: 8px;
    background: #4CAF50;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
    animation: blink 2s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Chat Messages */
.pythagoras-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #F8F9FA !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pythagoras-chat-messages * {
    color: inherit;
}

.pythagoras-message {
    display: flex;
    gap: 8px;
    animation: slideIn 0.3s ease;
}

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

@keyframes gentleBounce {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.02); }
    50% { transform: scale(0.98); }
    75% { transform: scale(1.01); }
}

.pythagoras-message.bot {
    align-items: flex-start;
}

.pythagoras-message.user {
    justify-content: flex-end;
}

.pythagoras-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0B4F6C;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
}

.pythagoras-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
}

#pythagoras-chatbot .pythagoras-message.bot .pythagoras-message-content,
#pythagoras-chatbot .pythagoras-message.bot .pythagoras-message-content * {
    background: white !important;
    color: #2c3e50 !important;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#pythagoras-chatbot .pythagoras-message.user .pythagoras-message-content,
#pythagoras-chatbot .pythagoras-message.user .pythagoras-message-content * {
    background: #0073E5 !important;
    color: white !important;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.pythagoras-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.pythagoras-typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #0B4F6C;
    animation: typing 1.4s infinite;
}

.pythagoras-typing span:nth-child(2) { animation-delay: 0.2s; }
.pythagoras-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

/* Quick Reply Buttons */
.pythagoras-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

#pythagoras-chatbot .pythagoras-quick-reply-btn {
    background: white !important;
    border: 2px solid #0073E5 !important;
    color: #0073E5 !important;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

#pythagoras-chatbot .pythagoras-quick-reply-btn:hover {
    background: #0073E5 !important;
    color: white !important;
}

/* Photo Upload */
.pythagoras-photo-upload {
    margin-top: 12px;
}

.pythagoras-photo-upload label {
    display: inline-block;
    background: #0073E5;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.pythagoras-photo-upload label:hover {
    background: #005bb5;
}

.pythagoras-photo-upload input {
    display: none;
}

.pythagoras-photo-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.pythagoras-photo-preview img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #E0E0E0;
}

/* Chat Input */
.pythagoras-chat-input {
    padding: 16px;
    background: white;
    border-top: 1px solid #E0E0E0;
    display: flex;
    gap: 8px;
    align-items: center;
}

#pythagoras-chatbot .pythagoras-chat-input input,
#pythagoras-chatbot .pythagoras-chat-input input::placeholder {
    flex: 1;
    border: 1px solid #E0E0E0 !important;
    border-radius: 24px;
    padding: 12px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    color: #2c3e50 !important;
    background: white !important;
}

.pythagoras-chat-input input:focus {
    border-color: #0073E5;
}

.pythagoras-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #0073E5;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.pythagoras-send-btn:hover {
    background: #005bb5;
}

.pythagoras-send-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    #pythagoras-chat-window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
    
    #pythagoras-chat-button {
        bottom: 15px;
        right: 15px;
        width: 56px;
        height: 56px;
    }

    .pythagoras-close-btn {
        width: 36px;
        height: 36px;
        font-size: 24px;
        background: rgba(255, 255, 255, 0.25);
        top: 18px;
        right: 18px;
    }

    .pythagoras-close-btn:active {
        background: rgba(255, 255, 255, 0.4);
        transform: scale(0.95);
    }
}

/* Scrollbar Styling */
.pythagoras-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.pythagoras-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

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

.pythagoras-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #AAA;
}

/* Success Message */
.pythagoras-success-message {
    background: #4CAF50;
    color: white;
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

.pythagoras-success-message svg {
    width: 24px;
    height: 24px;
    fill: white;
    margin-bottom: 8px;
}
