:root {
    --tim-blue: #004080;
    --tim-light-blue: #0066CC;
    --tim-gray: #F5F5F5;
}

.tim-chatbot-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    animation: timFadeIn 0.3s ease;
}

.tim-chatbot-overlay.active {
    display: flex;
}

@keyframes timFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.tim-chat-container {
    max-width: 600px;
    width: 90%;
    height: 85vh;
    max-height: 650px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: timSlideUp 0.3s ease;
}

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

.tim-chat-header {
    background: var(--tim-blue);
    color: white;
    padding: 15px;
    text-align: center;
    position: relative;
}

.tim-chat-header h4 {
    margin: 8px 0 0 0;
    font-weight: 600;
    font-size: 16px;
}

.tim-chat-minimize {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: all 0.3s;
}

.tim-chat-minimize:hover {
    background: rgba(255,255,255,0.3);
}

.tim-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: var(--tim-gray);
}

.tim-message {
    margin-bottom: 15px;
    animation: timMessageFade 0.3s ease-in;
}

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

.tim-message.bot {
    display: flex;
    align-items: flex-start;
}

.tim-message.user {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
}

.tim-message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-right: 10px;
    flex-shrink: 0;
}

.tim-message.bot .tim-message-avatar {
    background: var(--tim-blue);
    color: white;
}

.tim-message.user .tim-message-avatar {
    background: #28a745;
    color: white;
    margin-left: 10px;
    margin-right: 0;
}

.tim-message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 15px;
    line-height: 1.5;
}

.tim-message.bot .tim-message-content {
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.tim-message.user .tim-message-content {
    background: var(--tim-light-blue);
    color: white;
}

.tim-button-group {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.tim-chat-button {
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    font-size: 14px;
    white-space: nowrap;
}

.tim-chat-button.primary {
    background: var(--tim-blue);
    color: white;
}

.tim-chat-button.primary:hover {
    background: var(--tim-light-blue);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,64,128,0.3);
}

.tim-chat-button.secondary {
    background: #6c757d;
    color: white;
}

.tim-chat-button.secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108,117,125,0.3);
}

.tim-form-container {
    background: white;
    padding: 20px;
    border-radius: 15px;
    margin-top: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.tim-form-container .form-control {
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    padding: 12px;
    margin-bottom: 15px;
    width: 100%;
    font-size: 14px;
}

.tim-form-container .form-control:focus {
    border-color: var(--tim-blue);
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(0,64,128,0.25);
}

.tim-form-check {
    text-align: left;
    margin-bottom: 15px;
}

.tim-form-check input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    vertical-align: middle;
    margin-right: 10px;
}

.tim-form-check label {
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    display: inline;
}

.tim-form-check a {
    color: var(--tim-blue);
    text-decoration: underline;
}

.tim-typing-indicator {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    width: fit-content;
}

.tim-typing-indicator span {
    height: 8px;
    width: 8px;
    background: var(--tim-blue);
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    animation: timTyping 1.4s infinite;
}

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

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

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

.tim-success-message {
    text-align: center;
    padding: 30px;
}

.tim-success-message i {
    font-size: 60px;
    color: #28a745;
    margin-bottom: 20px;
}

.tim-success-message h3 {
    color: var(--tim-blue);
    margin-bottom: 10px;
}

.tim-offer-image-container {
    margin: 15px 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    max-height: 250px;
}

.tim-offer-image-container img {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: contain;
    display: block;
}

.tim-floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--tim-blue);
    color: white;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    font-size: 30px;
    cursor: pointer;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
    z-index: 999998;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tim-floating-btn:hover {
    background: var(--tim-light-blue);
    transform: scale(1.1);
}

.tim-pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--tim-blue);
    opacity: 0.5;
    animation: timPulse 2s infinite;
}

@keyframes timPulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.3);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

@media (max-width: 768px) {
    .tim-chat-container {
        width: 95%;
        height: 90vh;
        max-height: 600px;
    }
    
    .tim-floating-btn {
        width: 60px;
        height: 60px;
        font-size: 25px;
        bottom: 20px;
        right: 20px;
    }
    
    .tim-offer-image-container {
        max-height: 180px;
    }
    
    .tim-offer-image-container img {
        max-height: 180px;
    }
    
    .tim-message-content {
        max-width: 80%;
    }
    
    .tim-chat-button {
        padding: 10px 12px;
        font-size: 13px;
    }
}