/* Chat Widget Styles */
:root {
    --chat-primary: #42a5f5;
    --chat-secondary: #2c3e50;
    --chat-bg: rgba(255, 255, 255, 0.9);
    --chat-text: #333;
    --chat-light-text: #7f8c8d;
    --chat-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

#netmedias-chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10001;
    font-family: 'Poppins', sans-serif;
}

/* Chat Bubble Button */
.chat-bubble {
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, var(--chat-primary) 0%, #2196f3 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(66, 165, 245, 0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.1);
    animation: bubblePulse 2s infinite;
}

@keyframes bubblePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(66, 165, 245, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(66, 165, 245, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(66, 165, 245, 0);
    }
}

.chat-bubble:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 30px rgba(66, 165, 245, 0.5);
    animation: none;
}

.chat-window {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 400px;
    height: 600px;
    background: var(--chat-bg);
    border-radius: 25px;
    box-shadow: var(--chat-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(30px) scale(0.9);
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.chat-window.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, var(--chat-secondary) 0%, #4a6491 100%);
    color: white;
    padding: 25px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chat-header-info {
    display: flex;
    align-items: center;
}

.chat-header-info i {
    font-size: 28px;
    margin-right: 15px;
    color: var(--chat-primary);
    filter: drop-shadow(0 0 5px rgba(66, 165, 245, 0.3));
}

.chat-header-text h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.chat-header-text p {
    margin: 0;
    font-size: 0.75rem;
    opacity: 0.8;
}

.chat-close {
    cursor: pointer;
    font-size: 20px;
    transition: transform 0.3s;
    height: 30px;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 25px 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: rgba(255, 255, 255, 0.2);
}

.message {
    max-width: 85%;
    padding: 12px 18px;
    border-radius: 18px;
    font-size: 0.92rem;
    line-height: 1.5;
    position: relative;
    animation: fadeInMsg 0.4s cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes fadeInMsg {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message.bot {
    align-self: flex-start;
    background: white;
    color: var(--chat-text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.message.user {
    align-self: flex-end;
    background: var(--chat-primary);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 5px 15px rgba(66, 165, 245, 0.2);
}

.message.bot::before {
    content: 'NetMedias AI';
    position: absolute;
    top: -20px;
    left: 2px;
    font-size: 0.68rem;
    color: var(--chat-light-text);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Chat Input */
.chat-input-area {
    padding: 20px;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.chat-input-area textarea {
    flex: 1;
    border: 1px solid #eef0f2;
    border-radius: 15px;
    padding: 12px 15px;
    font-size: 0.9rem;
    resize: none;
    height: 45px;
    max-height: 120px;
    transition: all 0.3s;
    outline: none;
    background: #f8fafc;
}

.chat-input-area textarea:focus {
    border-color: var(--chat-primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(66, 165, 245, 0.1);
}

.chat-send-btn {
    width: 45px;
    height: 45px;
    background: var(--chat-primary);
    color: white;
    border: none;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: #2196f3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(66, 165, 245, 0.3);
}

/* Typing Indicator */
.typing {
    font-size: 0.8rem;
    color: var(--chat-light-text);
    margin-bottom: 5px;
    display: none;
    padding-left: 5px;
}

.typing span {
    animation: blink 1.4s infinite both;
    height: 5px;
    width: 5px;
    background-color: var(--chat-light-text);
    display: inline-block;
    border-radius: 50%;
    margin-right: 3px;
}

.typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0% {
        opacity: .2;
    }

    20% {
        opacity: 1;
    }

    100% {
        opacity: .2;
    }
}

/* Message Options/Buttons */
.message-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    animation: fadeIn 0.5s ease-out both;
}

.chat-option-btn {
    background: white;
    color: var(--chat-primary);
    border: 1px solid var(--chat-primary);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.chat-option-btn:hover {
    background: var(--chat-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(66, 165, 245, 0.2);
    transform: translateY(-2px);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom Scrollbar for messages */
.chat-messages::-webkit-scrollbar {
    width: 5px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

/* Form in Chat */
.chat-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.chat-form input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s;
}

.chat-form input:focus {
    border-color: var(--chat-primary);
}

.chat-form button {
    background: var(--chat-primary);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.chat-form button:hover {
    background: #2196f3;
    box-shadow: 0 5px 15px rgba(66, 165, 245, 0.3);
}

/* Responsive */
@media (max-width: 480px) {
    .chat-window {
        width: calc(100vw - 40px);
        height: min(550px, calc(100vh - 130px));
        right: -10px;
        bottom: 75px;
    }

    #netmedias-chat-widget {
        right: 20px;
        bottom: 20px;
    }

    .chat-bubble {
        width: 55px;
        height: 55px;
    }
}