/* USF Moving Chatbot Styles - Orange, White, Black Theme */

:root {
    --usf-orange: #FF6B35;
    --usf-dark-orange: #E85A28;
    --usf-light-orange: #FF8C61;
    --usf-black: #1A1A1A;
    --usf-white: #FFFFFF;
    --usf-gray: #F5F5F5;
    --usf-light-gray: #E0E0E0;
}

/* Chat Button */
.usf-chat-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--usf-orange) 0%, var(--usf-dark-orange) 100%);
    color: var(--usf-white);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    transition: all 0.3s ease;
    font-size: 28px;
}

.usf-chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.6);
}

.usf-chat-button.active {
    background: var(--usf-black);
}

/* Chat Container */
.usf-chat-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 120px);
    background: var(--usf-white);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 9999;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.usf-chat-container.active {
    display: flex;
}

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

/* Chat Header */
.usf-chat-header {
    background: linear-gradient(135deg, var(--usf-orange) 0%, var(--usf-dark-orange) 100%);
    color: var(--usf-white);
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.usf-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--usf-white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.usf-chat-title h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.usf-chat-title p {
    margin: 2px 0 0 0;
    font-size: 12px;
    opacity: 0.9;
}

.usf-chat-close {
    background: transparent;
    border: none;
    color: var(--usf-white);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

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

/* Chat Messages */
.usf-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--usf-gray);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.usf-chat-messages::-webkit-scrollbar-track {
    background: var(--usf-gray);
}

.usf-chat-messages::-webkit-scrollbar-thumb {
    background: var(--usf-light-gray);
    border-radius: 3px;
}

.usf-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* Message Bubble */
.usf-message {
    display: flex;
    margin-bottom: 8px;
    animation: messageSlideIn 0.3s ease;
}

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

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

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

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

.usf-message.bot .usf-message-content {
    background: var(--usf-white);
    color: var(--usf-black);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Formatted bot messages with bold text */
.usf-message.bot .usf-message-content strong {
    color: var(--usf-orange);
    font-weight: 600;
}

.usf-message.bot .usf-message-content ul,
.usf-message.bot .usf-message-content ol {
    margin: 8px 0;
    padding-left: 20px;
}

.usf-message.bot .usf-message-content li {
    margin: 4px 0;
}

.usf-message.bot .usf-message-content p {
    margin: 8px 0;
}

.usf-message.bot .usf-message-content p:first-child {
    margin-top: 0;
}

.usf-message.bot .usf-message-content p:last-child {
    margin-bottom: 0;
}

.usf-message.user .usf-message-content {
    background: var(--usf-orange);
    color: var(--usf-white);
    border-bottom-right-radius: 4px;
}

.usf-message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

/* Typing Indicator */
.usf-typing-indicator {
    display: none;
    padding: 12px 16px;
    background: var(--usf-white);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    max-width: 75%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.usf-typing-indicator.active {
    display: block;
}

.usf-typing-dots {
    display: flex;
    gap: 4px;
}

.usf-typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--usf-orange);
    animation: typingBounce 1.4s infinite;
}

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

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

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

/* Chat Input */
.usf-chat-input-container {
    padding: 16px;
    background: var(--usf-white);
    border-top: 1px solid var(--usf-light-gray);
}

.usf-chat-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.usf-voice-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--usf-white);
    color: var(--usf-orange);
    border: 2px solid var(--usf-orange);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.usf-voice-button:hover:not(:disabled) {
    background: var(--usf-light-orange);
    color: var(--usf-white);
    border-color: var(--usf-light-orange);
}

.usf-voice-button.recording {
    background: var(--usf-orange);
    color: var(--usf-white);
    animation: pulse 1.5s infinite;
}

.usf-voice-button:disabled {
    background: var(--usf-light-gray);
    border-color: var(--usf-light-gray);
    color: #999;
    cursor: not-allowed;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 107, 53, 0.7);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(255, 107, 53, 0);
    }
}

.usf-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--usf-light-gray);
    border-radius: 24px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 100px;
    overflow-y: auto;
    transition: border-color 0.2s;
}

.usf-chat-input:focus {
    outline: none;
    border-color: var(--usf-orange);
}

.usf-chat-input::-webkit-scrollbar {
    width: 4px;
}

.usf-chat-input::-webkit-scrollbar-thumb {
    background: var(--usf-light-gray);
    border-radius: 2px;
}

.usf-send-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--usf-orange);
    color: var(--usf-white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.usf-send-button:hover:not(:disabled) {
    background: var(--usf-dark-orange);
    transform: scale(1.05);
}

.usf-send-button:disabled {
    background: var(--usf-light-gray);
    cursor: not-allowed;
}

/* Quick Actions */
.usf-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 20px 12px 20px;
    background: var(--usf-gray);
}

.usf-quick-action {
    padding: 8px 16px;
    background: var(--usf-white);
    border: 1px solid var(--usf-orange);
    color: var(--usf-orange);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.usf-quick-action:hover {
    background: var(--usf-orange);
    color: var(--usf-white);
}

/* Powered By */
.usf-powered-by {
    text-align: center;
    padding: 8px;
    font-size: 11px;
    color: #999;
    background: var(--usf-white);
}

/* Voice Recording Status */
.usf-recording-status {
    display: none;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--usf-orange) 0%, var(--usf-dark-orange) 100%);
    color: var(--usf-white);
    font-size: 13px;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.usf-recording-status.active {
    display: flex;
}

.usf-recording-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--usf-white);
    animation: blink 1s infinite;
}

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

/* Mobile Responsive */
@media (max-width: 768px) {
    .usf-chat-container {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .usf-chat-button {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }
}

/* Error Message */
.usf-error-message {
    background: #ffebee;
    color: #c62828;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 8px 20px;
    font-size: 13px;
    display: none;
}

.usf-error-message.active {
    display: block;
}

/* Welcome Screen */
.usf-welcome-screen {
    padding: 40px 20px;
    text-align: center;
    background: var(--usf-gray);
}

.usf-welcome-screen h4 {
    color: var(--usf-black);
    margin: 0 0 12px 0;
    font-size: 18px;
}

.usf-welcome-screen p {
    color: #666;
    margin: 0 0 20px 0;
    font-size: 14px;
    line-height: 1.6;
}

.usf-welcome-icon {
    font-size: 48px;
    margin-bottom: 16px;
}
