/**
 * RCCG JHS Chat Widget Styles
 */

/* Container */
#rccg-chat-widget-root {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Floating Button */
.rccg-chat-button {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(40, 44, 53, 0.4), 0 10px 40px rgba(40, 44, 53, 0.3);
    transition: all 0.3s ease;
}

.rccg-chat-button:hover {
    transform: scale(1.1);
}

.rccg-chat-button svg {
    width: 28px;
    height: 28px;
    stroke-width: 2;
}

/* Chat Container */
#rccg-chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    transition: all 0.3s ease;
}

#rccg-chat-container.rccg-chat-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px);
}

/* Chat Widget */
.rccg-chat-widget {
    width: 380px;
    height: 450px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 0 40px rgba(212, 175, 55, 0.15), 0 20px 60px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.rccg-chat-header {
    padding: 20px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 24px 24px 0 0;
}

.rccg-chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rccg-chat-icon-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rccg-chat-icon {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

.rccg-chat-title-wrapper {
    flex: 1;
}

.rccg-chat-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.3px;
}

.rccg-chat-subtitle {
    font-size: 12px;
    margin: 0;
    opacity: 0.9;
}

.rccg-chat-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.rccg-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.rccg-chat-close svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

/* Messages Area */
.rccg-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    min-height: 0;
}

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

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

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

.rccg-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Message */
.rccg-message {
    margin-bottom: 16px;
    display: flex;
    animation: slideIn 0.3s ease;
}

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

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

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

.rccg-message-bubble {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 16px;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.rccg-message-user .rccg-message-bubble {
    border-bottom-right-radius: 4px;
}

.rccg-message-bot .rccg-message-bubble {
    border-bottom-left-radius: 4px;
}

.rccg-message-bubble:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.rccg-message-text {
    font-size: 15px;
    line-height: 1.5;
    margin: 0 0 6px 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.rccg-message-time {
    font-size: 11px;
    opacity: 0.7;
}

/* Typing Indicator */
.rccg-typing-indicator {
    display: flex;
    gap: 6px;
    padding: 12px 16px;
    background: #2c4d8a;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    max-width: fit-content;
}

.rccg-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    animation: typing 1.4s infinite;
}

.rccg-typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.rccg-typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Input Form */
.rccg-chat-input-form {
    padding: 16px;
    border-top: 1px solid #e5e5e5;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.rccg-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e5e5e5;
    border-radius: 24px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s ease;
}

.rccg-chat-input:focus {
    border-color: #282C35;
    box-shadow: 0 0 0 3px rgba(40, 44, 53, 0.1);
}

.rccg-chat-send {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(40, 44, 53, 0.3);
    transition: all 0.3s ease;
}

.rccg-chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(40, 44, 53, 0.4);
}

.rccg-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rccg-chat-send svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .rccg-chat-widget {
        width: calc(100vw - 40px);
        height: calc(100vh - 40px);
        max-height: 600px;
    }
    
    #rccg-chat-widget-root {
        bottom: 10px;
        right: 10px;
    }
    
    .rccg-chat-button {
        width: 56px;
        height: 56px;
    }
}
