/* DanceSport Australia Chatbot Styles */

#dsa-chatbot-container {
    font-family: Arial, sans-serif;
    z-index: 9999;
}

/* Chat Button */
#dsa-chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4527a0 0%, #311b92 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(69, 39, 160, 0.4);
    transition: all 0.3s ease;
    color: white;
}

#dsa-chat-button:hover {
    background: linear-gradient(135deg, #311b92 0%, #1a0e47 100%);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(69, 39, 160, 0.6);
}

#dsa-chat-button svg {
    width: 28px;
    height: 28px;
}

#dsa-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ffd600;
    color: #311b92;
    font-weight: bold;
    font-size: 12px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Chat Window */
#dsa-chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 550px;
    max-height: calc(100vh - 120px);
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

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

/* Chat Header */
#dsa-chat-header {
    background: linear-gradient(135deg, #4527a0 0%, #311b92 100%);
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#dsa-chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: white !important;
}

#dsa-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

#dsa-chat-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Messages Area */
#dsa-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

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

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

#dsa-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #311b92;
}

/* Message Bubbles */
.dsa-message {
    display: flex;
    margin-bottom: 8px;
}

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

.dsa-message-bot {
    justify-content: flex-start;
}

.dsa-message-content {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    line-height: 1.4;
    font-size: 14px;
}

.dsa-message-user .dsa-message-content {
    background: linear-gradient(135deg, #5e35b1 0%, #4527a0 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.dsa-message-bot .dsa-message-content {
    background-color: white;
    color: #333;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.dsa-message-bot .dsa-message-content a {
    color: #4527a0;
    text-decoration: underline;
}

.dsa-message-bot .dsa-message-content a:hover {
    color: #311b92;
}

/* Quick Questions */
#dsa-chat-quick-questions {
    padding: 8px 16px;
    background-color: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dsa-quick-btn {
    background-color: #f0f0f0;
    border: 1px solid #4527a0;
    color: #4527a0;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.dsa-quick-btn:hover {
    background: linear-gradient(135deg, #5e35b1 0%, #4527a0 100%);
    color: white;
    border-color: #4527a0;
}

/* Input Area */
#dsa-chat-input-container {
    display: flex;
    padding: 12px 16px;
    background-color: white;
    border-top: 1px solid #e0e0e0;
    gap: 8px;
}

#dsa-chat-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#dsa-chat-input:focus {
    border-color: #4527a0;
}

#dsa-chat-send {
    background: linear-gradient(135deg, #5e35b1 0%, #4527a0 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

#dsa-chat-send:hover {
    background: linear-gradient(135deg, #4527a0 0%, #311b92 100%);
}

#dsa-chat-send:active {
    transform: scale(0.98);
}

/* Mobile Responsive - Improved for better viewport handling */
@media (max-width: 768px) {
    #dsa-chat-window {
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important; /* For mobile browsers */
        max-height: 100vh !important;
        max-height: 100dvh !important;
        border-radius: 0;
        position: fixed;
    }

    #dsa-chat-button {
        bottom: 20px;
        right: 20px;
        width: 70px;
        height: 70px;
        z-index: 10000;
    }

    #dsa-chat-button svg {
        width: 34px;
        height: 34px;
    }

    #dsa-chat-header {
        padding: 14px 16px;
    }

    #dsa-chat-header h3 {
        font-size: 16px;
    }

    #dsa-chat-messages {
        padding: 12px;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }

    .dsa-message-content {
        max-width: 85%;
        font-size: 14px;
        padding: 8px 12px;
    }

    #dsa-chat-quick-questions {
        padding: 8px 12px;
    }

    #dsa-chat-quick-questions p {
        font-size: 11px;
        margin: 4px 0 8px 0;
    }

    .dsa-quick-btn {
        font-size: 11px;
        padding: 6px 10px;
    }

    #dsa-chat-input-container {
        padding: 10px 12px;
        padding-bottom: max(10px, env(safe-area-inset-bottom)); /* Handle iPhone notch */
    }

    #dsa-chat-input {
        font-size: 16px; /* Prevents auto-zoom on iOS */
        padding: 10px 12px;
    }

    #dsa-chat-send {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* Smooth animations */
* {
    box-sizing: border-box;
}
