* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.chatbot-button {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    border: none;
    outline: none;
    position: relative;
}

.chatbot-button:hover {
    transform: scale(1.1);
}

.chatbot-button .notification {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    background: #ff4444;
    border-radius: 50%;
    color: white;
    font-size: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.chatbot-container {
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    bottom: 70px;
    right: 0;
}

.chatbot-container.active {
    display: flex;
}

.bot-icon {
    clip-path: circle(50% at 50% 50%);
    width: 60px;
    height: 60px;
    object-fit: cover;
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    position: relative;
}

.session-info {
    display: none;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8f9fa;
}

.message {
    margin-bottom: 12px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.bot {
    text-align: left;
}

.message.user {
    text-align: right;
}

.message-content {
    display: inline-block;
    padding: 10px 14px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
    font-size: 14px;
    position: relative;
}

.message.bot .message-content {
    background: #e3f2fd;
    color: #1565c0;
    text-align: justify;
}

.message.user .message-content {
    background: #667eea;
    color: white;
}

.message-timestamp {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 2px;
}

.options-container {
    margin-top: 8px;
}

.option-button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    margin: 4px 0;
    background: white;
    border: 2px solid #667eea;
    border-radius: 20px;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    text-align: left;
}

.option-button:hover {
    background: #667eea;
    color: white;
}

.chat-input {
    display: flex;
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.input-field {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.input-field:focus {
    border-color: #667eea;
}

.send-button {
    margin-left: 8px;
    padding: 10px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.send-button:hover {
    background: #5a6fd8;
}

.send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.typing-indicator {
    display: none;
    padding: 8px;
    color: #666;
    font-style: italic;
    font-size: 13px;
}

.typing-dots {
    display: inline-block;
    animation: typing 1.4s infinite;
}

@keyframes typing {

    0%,
    60%,
    100% {
        opacity: 0;
    }

    30% {
        opacity: 1;
    }
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
}

.connection-status {
    padding: 5px 10px;
    text-align: center;
    font-size: 12px;
    background: #ddd;
    color: #666;
}

.connection-status.connected {
    background: #d4edda;
    color: #155724;
}

.connection-status.error {
    background: #f8d7da;
    color: #721c24;
}

.history-button {
    position: absolute;
    top: 10px;
    right: 35px;
    background: none;
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.8;
}

.history-button:hover {
    opacity: 1;
}

/* Media Queries para Responsividade */

/* Tablets em modo retrato e telas pequenas */
@media screen and (max-width: 768px) {
    .chatbot-widget {
        bottom: 15px;
        right: 15px;
    }

    .chatbot-container {
        width: calc(100vw - 30px);
        height: calc(100vh - 100px);
        max-width: 400px;
        max-height: 600px;
        bottom: 80px;
        right: 15px;
    }

    .chatbot-button {
        width: 55px;
        height: 55px;
        font-size: 22px;
    }

    .bot-icon {
        width: 55px;
        height: 55px;
    }

    .chat-header {
        padding: 12px;
        font-size: 15px;
    }

    .chat-messages {
        padding: 12px;
    }

    .message-content {
        max-width: 85%;
        font-size: 13px;
        padding: 9px 12px;
    }

    .chat-input {
        padding: 12px;
    }

    .input-field {
        font-size: 13px;
        padding: 9px 12px;
    }

    .send-button {
        padding: 9px 14px;
        font-size: 13px;
    }

    .option-button {
        font-size: 12px;
        padding: 7px 10px;
    }
}

/* Smartphones em modo retrato */
@media screen and (max-width: 480px) {
    .chatbot-widget {
        bottom: 10px;
        right: 10px;
    }

    .chatbot-container {
        width: calc(100vw - 20px);
        height: calc(100vh - 80px);
        bottom: 65px;
        right: 10px;
        border-radius: 12px;
    }

    .chatbot-button {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .bot-icon {
        width: 50px;
        height: 50px;
    }

    .chat-header {
        padding: 10px;
        font-size: 14px;
    }

    .close-button {
        top: 8px;
        right: 8px;
        font-size: 14px;
    }

    .history-button {
        top: 8px;
        right: 28px;
        font-size: 12px;
    }

    .chat-messages {
        padding: 10px;
    }

    .message {
        margin-bottom: 10px;
    }

    .message-content {
        max-width: 90%;
        font-size: 12px;
        padding: 8px 10px;
        border-radius: 15px;
    }

    .message-timestamp {
        font-size: 9px;
    }

    .chat-input {
        padding: 10px;
        gap: 6px;
    }

    .input-field {
        font-size: 12px;
        padding: 8px 10px;
        border-radius: 15px;
    }

    .send-button {
        padding: 8px 12px;
        font-size: 12px;
        border-radius: 15px;
    }

    .option-button {
        font-size: 11px;
        padding: 6px 8px;
        border-radius: 15px;
    }

    .typing-indicator {
        font-size: 11px;
        padding: 6px;
    }

    .connection-status {
        font-size: 11px;
        padding: 4px 8px;
    }

    .notification {
        width: 16px;
        height: 16px;
        font-size: 9px;
        top: -3px;
        right: -3px;
    }
}

/* Smartphones muito pequenos */
@media screen and (max-width: 320px) {
    .chatbot-container {
        width: calc(100vw - 16px);
        height: calc(100vh - 70px);
        right: 8px;
        bottom: 58px;
    }

    .chatbot-widget {
        bottom: 8px;
        right: 8px;
    }

    .message-content {
        font-size: 11px;
        padding: 7px 9px;
        max-width: 95%;
    }

    .input-field {
        font-size: 11px;
    }

    .send-button {
        font-size: 11px;
        padding: 7px 10px;
    }
}

/* Orientação paisagem em smartphones */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .chatbot-container {
        height: calc(100vh - 60px);
        max-height: none;
    }

    .chat-messages {
        padding: 8px;
    }

    .chat-header {
        padding: 8px;
        font-size: 13px;
    }

    .chat-input {
        padding: 8px;
    }
}

/* Links responsivos */
@media screen and (max-width: 480px) {
    .message-link {
        font-size: 0.8em !important;
        padding: 6px 10px !important;
    }

    .links-container {
        gap: 6px !important;
    }
}

/* Ajustes para telas muito altas (tablets em modo retrato) */
@media screen and (min-height: 1000px) and (max-width: 768px) {
    .chatbot-container {
        max-height: 70vh;
    }
}

/* Hover states desabilitados em dispositivos touch */
@media (hover: none) and (pointer: coarse) {
    .chatbot-button:hover {
        transform: none;
    }

    .option-button:hover {
        background: white;
        color: #667eea;
    }

    .send-button:hover {
        background: #667eea;
    }
}