/* 
 * Frontend styles for Mano-Phone Chat Widget 
 * Inspired by Tidio aesthetics
 */

#mano-chat-wrapper {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
}

/* Launcher Button */
#mano-chat-launcher {
    width: 60px;
    height: 60px;
    background-color: #0566FF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(5, 102, 255, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#mano-chat-launcher:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(5, 102, 255, 0.5);
}

#mano-chat-launcher svg {
    width: 32px;
    height: 32px;
}

/* Chat Window */
#mano-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 360px;
    height: 600px;
    max-height: 80vh;
    background-color: #F5F7F9;
    border-radius: 16px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.16);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Open State */
#mano-chat-wrapper.mano-chat-open #mano-chat-window {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

#mano-chat-wrapper.mano-chat-open #mano-chat-launcher {
    transform: scale(0);
}

/* Header */
.mc-header {
    background-color: #0566FF;
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}

.mc-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mc-avatar {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    position: relative;
    /* You can add a background-image here for the logo */
}

.mc-online-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background-color: #3DE97A;
    border-radius: 50%;
    border: 2px solid #0566FF;
}

.mc-title {
    font-weight: 600;
    font-size: 16px;
}

.mc-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
}

.mc-close-btn:hover {
    opacity: 1;
}

/* Messages Canvas */
.mc-canvas {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mc-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.mc-msg-visitor {
    align-self: flex-end;
    background-color: #E2E8F0;
    border-bottom-right-radius: 2px;
    color: #1E293B;
}

.mc-msg-ai, .mc-msg-admin {
    align-self: flex-start;
    background-color: #FFFFFF;
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

/* Input Area */
.mc-input-area {
    background-color: white;
    padding: 16px;
    border-top: 1px solid #E2E8F0;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mc-input-area textarea {
    width: 100%;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    padding: 12px;
    padding-right: 48px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    box-sizing: border-box;
}

.mc-input-area textarea:focus {
    border-color: #0566FF;
}

#mc-send-btn {
    position: absolute;
    right: 24px;
    top: 24px;
    background: none;
    border: none;
    color: #0566FF;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mc-send-btn svg {
    width: 20px;
    height: 20px;
}

#mc-human-takeover {
    font-size: 12px;
    color: #64748B;
    text-align: center;
    text-decoration: none;
}

#mc-human-takeover:hover {
    text-decoration: underline;
    color: #0566FF;
}

/* Typing Indicator */
#mc-typing-indicator {
    align-self: flex-start;
    background-color: #FFFFFF;
    padding: 12px 16px;
    border-radius: 12px;
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    gap: 4px;
    align-items: center;
}

.mc-typing-dot {
    width: 8px;
    height: 8px;
    background-color: #94A3B8;
    border-radius: 50%;
    animation: mc-typing 1.4s infinite ease-in-out;
}

.mc-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.mc-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes mc-typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    #mano-chat-window {
        position: fixed;
        width: 100%;
        height: 100%;
        max-height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .mc-header {
        border-radius: 0;
    }
}
