/* Base Styles */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
    height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Header Styles */
.header {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    background-color: #fff;
    padding: 10px 20px;
    width: 100%;
    height: 80px;
    box-sizing: border-box;
    z-index: 100;
}

.header img {
    margin-right: 10px;
    height: 60px;
}

.header .search-container {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.search-container input[type="text"] {
    border: 0;
    width: 200px;
    margin-right: 10px;
    background-color: transparent;
    border-bottom: 3px solid #7C2629;
    font-size: 16px;
    padding: 5px 0;
    outline: none;
}

.search-container .search-icon {
    width: 24px;
    height: 24px;
    background: url('https://cdn-icons-png.flaticon.com/512/622/622669.png') no-repeat center center;
    background-size: contain;
    cursor: pointer;
}

.header .login-container {
    display: flex;
    align-items: center;
    margin-left: 20px;
    margin-right: 20px;
}

.login-container img {
    width: 40px;
    height: 40px;
    cursor: pointer;
}

/* Chat Button Styles */
.open-chat {
    position: fixed;
    bottom: 20px;
    right: 20px;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    z-index: 99;
}

.img-principal {
    width: 80px;
    height: 80px;
    
    transition: transform 0.3s ease;
}

.img-principal:hover {
    transform: scale(1.1);
}

/* Table Button Styles */
.tabla-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 99;
}

.img-tabla {
    width: 60px;
    height: 60px;
    transition: transform 0.3s ease;
}

.img-tabla:hover {
    transform: scale(1.1);
}

/* Chat Container Styles */
.chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 1000;
    transition: all 0.3s ease;
    overflow: hidden;
    flex-direction: column;
}

.chat-container.open {
    display: flex;
}

.chat-container.maximized {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
}

/* Chat Header Styles */
.chat-header {
    background-color: #7b0303;
    color: #fff;
    padding: 20px;
    font-weight: bold;
    position: relative;
    display: flex;
    align-items: center;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    flex-direction: column;
}

.chat-header img {
    margin-right: 15px;
    margin-bottom: 20px;
}

.carlos {
    font-size: 15px;
    font-weight: normal;
    font-family: monospace;
}

.chat-header .header-icons {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 15px;
}

.chat-header .header-icons button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.chat-header .header-icons img {
    width: 20px;
    height: 20px;
    margin: 0;
}

/* Chat Box Styles */
.chat-box-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.chat-box {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #fff;
}

.message {
    margin-bottom: 15px;
    position: relative;
    clear: both;
}

.message.user {
    text-align: right;
}

.message.bot {
    text-align: left;
}

.message .text {
    display: inline-block;
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
    position: relative;
    margin-bottom: 5px;
}

.message.user .text {
    background-color: #fff;
    border: 2px solid #7C2629;
    color: #333;
    border-bottom-right-radius: 0;
    float: right;
}

.message.bot .text {
    background-color: #ecebeb;
    color: #333;
    border-bottom-left-radius: 0;
    float: left;
}

.message .timestamp {
    font-size: 10px;
    color: #888;
    clear: both;
    display: block;
    margin-top: 5px;
}

.message.user .timestamp {
    text-align: right;
}

.message.bot .timestamp {
    text-align: left;
}

/* Input Container Styles */
.input-container {
    display: flex;
    align-items: center;
    padding: 15px 15px;
    background-color: #fff;
}

.input-container textarea {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 15px;
    resize: none;
    height: 20px;
    background-color: #ecebeb;
    border-radius: 20px;
    font-size: 14px;
}

.input-container button {
    border: none;
    background-color: transparent;
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
}

.input-container button img {
    width: 24px;
    height: 24px;
}

.input-container .send-button img {
    transition: transform 0.3s ease;
}

.input-container .send-button:hover img {
    transform: scale(1.1);
}

.input-container .audio-button {
    position: relative;
}

.input-container .audio-button.active:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 0, 0, 0.2);
    border-radius: 50%;
}

/* Thinking Animation */
.thinking {
    display: flex;
    align-items: center;
    padding: 10px 15px;
}

.thinking .dot {
    width: 8px;
    height: 8px;
    background-color: #7C2629;
    border-radius: 50%;
    margin: 0 2px;
    animation: blink 1.4s infinite;
}

.thinking .dot:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking .dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes blink {
    0% {
        opacity: 0.2;
        transform: scale(0.8);
    }

    20% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0.2;
        transform: scale(0.8);
    }
}

/* Table Container Styles */
#tabla-container {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 900;
    overflow-y: auto;
    padding: 20px;
}

#tabla-container.open {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f3f4f6;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #e5e7eb;
}

.close-btn::before,
.close-btn::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 2px;
    background: #4b5563;
}

.close-btn::before {
    transform: rotate(45deg);
}

.close-btn::after {
    transform: rotate(-45deg);
}

#tabla-container table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#tabla-container th {
    background: #f3f4f6;
    color: #374151;
    font-weight: 600;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 2px solid #e5e7eb;
}

#tabla-container td {
    padding: 10px 15px;
    border-bottom: 1px solid #e5e7eb;
    color: #4b5563;
}

#tabla-container tr:hover {
    background-color: #f9fafb;
}


.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.btn {
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: #7C2629;
    color: white;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: #333;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.edit-btn,
.delete-btn {
    padding: 6px 10px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 13px;
}

.edit-btn {
    background: #7C2629;
    color: white;
}

.delete-btn {
    background: #dc3545;
    color: white;
}

/* Response Rating Buttons */
.rating-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 5px;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-warning {
    background-color: #ffc107;
    color: black;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.header-icons {
    position: absolute;
    right: 10px;
    top: 10px;
}

.visible {
    display: block;
  }
  
  .hidden {
    display: none;
  }

  .chat-bubble {
    position: absolute;
    top: -54px;
    left: -87px;
    background-color: white;
    color: #7C2629;
    padding: 8px 12px;
    border-radius: 10px;
    border: 2px solid #7C2629;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    font-size: 14px;
    white-space: nowrap;
    z-index: 1;
}

.chat-bubble:after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 114px;
    border-width: 10px 8px 0;
    border-style: solid;
    border-color: #7C2629 transparent transparent transparent;
}
  

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        flex-wrap: wrap;
        height: auto;
        padding: 10px;
    }

    .header img {
        height: 40px;
        margin-bottom: 5px;
    }

    .search-container input[type="text"] {
        width: 150px;
        font-size: 14px;
    }

    .login-container {
        margin-left: 10px;
        margin-right: 10px;
    }

    .chat-container {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    #tabla-container th,
    #tabla-container td {
        padding: 8px;
        font-size: 13px;
    }

    #tabla-container {
        padding: 10px;
    }

    .modal-content {
        width: 95%;
        padding: 15px;
    }

    .message .text {
        max-width: 90%;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 5px;
    }

    .header img:first-child {
        height: 30px;
    }

    .header img:nth-child(2) {
        display: none;
    }

    .search-container input[type="text"] {
        width: 120px;
        font-size: 12px;
    }

    .login-container img {
        width: 30px;
        height: 30px;
    }

    .open-chat,
    .tabla-btn {
        bottom: 10px;
    }

    .chat-header {
        padding: 10px;
    }

    .carlos {
        font-size: 14px;
    }

    .input-container textarea {
        padding: 8px 12px;
        font-size: 12px;
    }

    .input-container button img {
        width: 20px;
        height: 20px;
    }

    #tabla-container th,
    #tabla-container td {
        padding: 6px;
        font-size: 12px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 5px;
    }

    .edit-btn,
    .delete-btn {
        padding: 4px 8px;
        font-size: 12px;
    }
}

/* Modificar el estilo de los mensajes */
.message .text {
    display: inline-block;
    padding: 10px 15px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
    position: relative;
    margin-bottom: 5px;
}

.message.user .text {
    background-color: #fff;
    border: 2px solid #7C2629;
    color: #333;
    border-bottom-right-radius: 4px; /* Reducir el redondeo para preparar el pico */
    float: right;
}

.message.user .text:after {
    content: "";
    position: absolute;
    bottom: -10px;
    right: -1px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-top-color: #7C2629;
    border-right: 0;
    border-bottom: 0;
    margin-right: 0;
}

.message.user .text:before {
    content: "";
    position: absolute;
    bottom: -7px;
    right: 0px;
    width: 0;
    height: 0;
    border: 8px solid transparent;
    border-top-color: #fff;
    border-right: 0;
    border-bottom: 0;
    z-index: 1;
}

.message.bot .text {
    background-color: #ecebeb;
    color: #333;
    border-bottom-left-radius: 4px; /* Reducir el redondeo para preparar el pico */
    float: left;
}

.message.bot .text:after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-top-color: #ecebeb;
    border-left: 0;
    border-bottom: 0;
    margin-left: 0;
}
