/* AI Chatbot Companion - Frontend Styles */

/* Utility Classes */
.acc-hidden {
    display: none !important;
}

/* Container */
.acc-chatbot-container {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    margin: 20px 0;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    max-width: 600px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 500px;
}

/* Header */
.acc-chatbot-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.acc-chatbot-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.acc-chatbot-clear {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    margin-left: 10px;
}

.acc-chatbot-clear:hover {
    background: rgba(255, 255, 255, 0.2);
}

.acc-chatbot-clear .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* Messages Area */
.acc-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    min-height: 300px;
    max-height: 400px;
}

.acc-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

.acc-chatbot-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

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

.acc-chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Message Bubbles */
.acc-message {
    margin-bottom: 16px;
    animation: fadeInUp 0.3s ease-out;
}

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

.acc-message-user {
    text-align: right;
}

.acc-message-ai {
    text-align: left;
}

.acc-message-content {
    display: inline-block;
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
    line-height: 1.4;
    background-color: darkorange;
    font-size: smaller;
    color: white;
}

.acc-message-user .acc-message-content {
    background: #667eea;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.acc-message-ai .acc-message-content {
    background: #ff8c00;
    color: #ffffff;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Typing Indicator */
.acc-typing-indicator {
    display: inline-block;
    padding: 8px 12px;
    background: #ff8c00;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
}

.acc-typing-indicator span {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ffffff;
    margin: 0 1px;
    animation: typing 1.4s infinite;
}

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

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

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

/* Input Area */
.acc-chatbot-input-wrap {
    display: flex;
    padding: 16px 20px;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
    gap: 12px;
    align-items: center;
    flex-shrink: 0;
}

.acc-chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #f8f9fa;
    resize: none;
}

.acc-chatbot-input:focus {
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.acc-chatbot-send {
    width: 36px;
    height: 36px;
    border: none;
    background: #667eea;
    color: #ffffff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
    flex-shrink: 0;
    position: relative;
    padding: 15px;
}

.acc-chatbot-send:hover {
    background: #5a5fd8;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.acc-chatbot-send:active {
    transform: scale(0.95);
}

.acc-chatbot-send svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.acc-chatbot-send:hover svg {
    transform: translateY(-1px);
}

/* Floating Widget */
.acc-floating-widget {
    position: fixed;
    bottom: 95px;
    right: 30px;
    z-index: 9999;
}

.acc-floating-toggle {
    width: 80px;
    height: 90px;
    border-radius: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 165, 0, 0.4),
        0 0 8px rgba(255, 165, 0, 0.3),
        0 0 16px rgba(255, 165, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s, width 0.3s ease, height 0.3s ease, border-radius 0.3s ease, padding 0.3s ease;
    padding: 8px 4px;
    margin-top: 6px;
}

.acc-floating-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.acc-floating-toggle .dashicons {
    font-size: 40px;
    width: 40px;
    height: 40px;
    margin-bottom: 2px;
    transition: font-size 0.3s ease, width 0.3s ease, height 0.3s ease, margin-bottom 0.3s ease;
}

.acc-floating-text {
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 72px;
    transition: opacity 0.2s ease;
}

/* Close button state - circular with just X */
.acc-floating-toggle.acc-chat-open {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    flex-direction: row;
    padding: 0;
    background: salmon;
}

.acc-floating-toggle.acc-chat-open .dashicons {
    margin-bottom: 0;
    font-size: 28px;
    width: 28px;
    height: 28px;
}

.acc-floating-chatbot {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 380px;
    max-width: 90vw;
    animation: slideInUp 0.3s ease-out;
}

.acc-floating-chatbot .acc-chatbot-container {
    margin: 0;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    height: 500px;
    min-height: 500px;
    display: flex;
    flex-direction: column;
}

.acc-floating-chatbot .acc-chatbot-messages {
    flex: 1;
    min-height: 280px;
    max-height: none;
}

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

/* Responsive */
@media (max-width: 768px) {
    .acc-chatbot-messages {
        min-height: 250px;
        max-height: 350px;
    }
    
    .acc-floating-chatbot {
        width: calc(100vw - 40px);
        right: -20px;
    }
    
    .acc-message-content {
        max-width: 90%;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .acc-chatbot-container {
        background: #1a1a1a;
        border-color: #333;
    }
    
    .acc-chatbot-messages {
        background: #2d2d2d;
    }
    
    .acc-message-ai .acc-message-content {
        background: #ff8c00;
        color: #ffffff;
    }
    
    .acc-chatbot-input-wrap {
        border-color: #9f9fb1;
        background-color: #2d2d2d;
    }
    
    .acc-chatbot-input {
        background: #333;
        color: #e0e0e0;
        border-color: #444;
    }
    
    .acc-chatbot-input:focus {
        border-color: #667eea;
        background: #404040;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    }
    
    .acc-typing-indicator {
        background: #ff8c00;
    }

    .acc-message-content a {
        padding: 1px;
        background: #e0e0e0;
        margin: 1px;
        border-radius: 4px;
    }

    .dashicons-external {
        width: 16px;
        height: 16px;
        font-size: 16px;
    }
} 