:root {
    --foreground: rgb(3, 110, 48);
    --background: rgb(255, 255, 255);
    --link-hover: rgb(19, 81, 187);
}

* { padding: 0; margin: 0; }
html, body, #fullheight {
    min-height: 100% !important;
    height: 100%;
    
    font-family: "Afacad Flux", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-variation-settings: "slnt" 0;

    background-color: var(--background);
}

.loader {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    width: 150px;
    height: 150px;
    margin: -77px 0 0 -77px;
    border: 4px solid var(--background);
    border-radius: 50%;
    border-top: 4px solid var(--foreground);
    -webkit-animation: spin 1s linear infinite;
    animation: spin 1s linear infinite;

    box-shadow: 0px 0px 25px 0px var(--foreground);
    -webkit-box-shadow: 0px 0px 25px 0px var(--foreground);
    -moz-box-shadow: 0px 0px 25px 0px var(--foreground);
}

.loader::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    -webkit-box-shadow: inset 0px 0px 25px 1px var(--foreground);
    -moz-box-shadow: inset 0px 0px 25px 1px var(--foreground);
    box-shadow: inset 0px 0px 25px var(--foreground);
    border-radius: 50%;

    -webkit-animation: spinc 1s linear infinite;
    animation: spinc 1s linear infinite;
}
  
@-webkit-keyframes spin {
    0% { -webkit-transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); }
}
  
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@-webkit-keyframes spinc {
    0% { -webkit-transform: rotate(360deg); }
    100% { -webkit-transform: rotate(0deg); }
}
  
@keyframes spinc {
    0% { transform: rotate(360deg); }
    100% { transform: rotate(0deg); }
}

a, a:visited, a:hover {
  text-decoration: none;
}

.icono {
    max-width: 200px;
    width: 100%;
    height: auto;
    color: white;
    font-size: 15pt;
}

@media (min-width: 768px) {
    .sidebar.toggled {
        overflow: hidden;
        width: 0!important;
    }
    .icono {
        height: auto;
    }
    
}

.locationPin {
    height: 30px; 
    width: auto;
}

#map {
    width: 100%;
    height: 600px;
    display: block;
}

.help-block {
    font-size: 10pt;
}

.developer, .developer:hover {
    color: #999 !important;
    font-size: 8pt !important;
}

/* ************************************************************** */

.rrhh img {
    width: 100% !important;
    height: auto;
}
  
.cards {
    display: inline-flex;
    text-align: center;
    background: rgba(0,0,0,0);
    width: 100%;
    height: 600px;
}
  
.flip-card {
    background-color: transparent;
    perspective: 1000px;
    display: contents;
}
  
@media screen and (max-width: 500px) {
    .cards {
      display: block;
      width: 100%;
      height: 1500px;
    }
    
    .flip-card {
      width: 100%;
      height: 450px;
      background-color: transparent;
      perspective: 1000px;
      display: block;
    }
}
  
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
}
  
.show-back {
    transform: rotateY(180deg);
}
  
.show-front {
    transform: rotateY(0deg);
}
  
.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}
  
.flip-card-front {
    color: black;
}
  
.flip-card-back {
    transform: rotateY(180deg);
}
  
.carousel-item {
  width: 100%;
}
 
.ws_images {
    margin: 5%;
}
  
/* ************************************************************** */

#fticket {
    font-family: 'Courier New', Courier, monospace;
}

#fticket .table, #fticket .table th, #fticket .table td {
    border: 0px solid var(--light);
}

.topbar #sidebarToggleTop:hover {
    background-color: var(--dark) !important;
    border: 0px solid var(--dark) !important;
}

.nav-link:hover {
    color: var(--light) !important;
    font-weight: bold;
}

.activo .nav-link:hover {
    background-color: var(--light) !important;
    color: var(--dark) !important;
    font-weight: bold;
}

.activo {
    background-color: var(--light) !important;
    color: var(--dark) !important;
}

.scrollable {
    overflow-y: auto;
    max-height: 500px;
}

.hide {
    display: none;
}

/* ************************************************************** */

/* Estilos para la pantalla de conversaciones */

/* Contenedor de contactos */
.contacts-container {
    max-height: 500px;
    overflow-y: auto;
}

.contact-item {
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.contact-item:hover {
    background-color: #f8f9fc;
}

.contact-item.active {
    border-left-color: #4e73df;
    background-color: #eaecf4;
}

/* Mensajes de chat */
.chat-messages-container {
    display: flex;
    flex-direction: column;
    padding: 15px;
}

.message {
    margin-bottom: 10px;
    max-width: 70%;
}

.message.received {
    align-self: flex-start;
}

.message.sent {
    align-self: flex-end;
}

.message .card {
    border-radius: 15px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    margin-bottom: 0;
}

.message.received .card {
    border-top-left-radius: 5px;
}

.message.sent .card {
    border-top-right-radius: 5px;
}

/* Formulario de mensaje */
#message-form {
    margin-top: 15px;
}

#message-input {
    resize: none;
    border-radius: 20px;
    padding-right: 50px;
}

/*#message-form .btn {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}*/

.botonera {
    width: 100%;
    height: 50px;
    position: relative;
}

.botonera .btn {
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    transform: translateY(0) !important;
    right: inherit !important;
    top: inherit !important;
}

/* Needs human */
@keyframes newMessagePulse {
    0% { background-color: rgba(25, 135, 84, 0.1); }
    50% { background-color: rgba(25, 135, 84, 0.3); }
    100% { background-color: rgba(25, 135, 84, 0.1); }
}

.new-message-alert {
    animation: newMessagePulse 1s ease-in-out 2;
}

.needs-human-attention {
    border-left: 4px solid #dc3545 !important;
}

.needs-attention {
    position: relative;
}

.needs-attention::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #dc3545;
    animation: pulsate 1.5s ease-out infinite;
}

@keyframes pulsate {
    0% { transform: scale(0.8); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.7; }
}

/* Sticker specific styling */
.sticker-container {
    display: flex;
    justify-content: center;
    margin: 5px 0;
}

.sticker-image {
    max-width: 150px;
    max-height: 150px;
    object-fit: contain;
}

/* Animation for stickers when they first appear */
@keyframes stickerPop {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.message.received .sticker-image,
.message.sent .sticker-image {
    animation: stickerPop 0.3s ease-out;
}

/* Make sticker cards more compact */
.message .card-body:has(.sticker-container) {
    padding: 0.5rem !important;
}

/* Estilo para elementos de código en línea */
.card-body code {
    background-color: #f5f5f5;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* Estilo para bloques de código */
.card-body pre {
    background-color: #f5f5f5;
    padding: 10px;
    border-radius: 5px;
    margin: 10px 0;
    max-width: 100%;
    overflow-x: auto;
}

.card-body pre code {
    background-color: transparent;
    padding: 0;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    white-space: pre-wrap;
}

/* Estilo para texto tachado */
.card-body del {
    text-decoration: line-through;
}

/* *************************************************************** */

.contact-list {
        height: calc(100vh - 250px);
        overflow-y: auto;
    }
    .contact-item {
        cursor: pointer;
        border-left: 3px solid transparent;
        transition: all 0.2s;
        position: relative;
    }
    .contact-item.active {
        border-left: 3px solid #4e73df;
        background-color: rgba(78, 115, 223, 0.1);
    }
    .contact-item:hover {
        background-color: rgba(0,0,0,0.05);
    }
    .unread-badge {
        position: absolute;
        top: 10px;
        right: 10px;
        background: #e74a3b;
        color: white;
        border-radius: 50%;
        width: 20px;
        height: 20px;
        text-align: center;
        font-size: 12px;
        line-height: 20px;
    }
    .status-badge {
        border-radius: 30px;
        padding: 2px 8px;
        font-size: 11px;
        font-weight: bold;
    }
    .badge-autonomous {
        background-color: #36b9cc;
        color: white;
    }
    .badge-needs-attention {
        background-color: #f6c23e;
        color: black;
    }
    .badge-assigned {
        background-color: #1cc88a;
        color: white;
    }
    .chat-container {
        height: calc(100vh - 250px);
        display: flex;
        flex-direction: column;
    }
    .message-container {
        flex: 1;
        overflow-y: auto;
        padding: 15px;
        background-color: #f8f9fc;
    }
    .message {
        margin-bottom: 10px;
        max-width: 75%;
        word-break: break-word;
    }
    .message.received {
        background-color: #e2e2e2;
        color: #333;
        border-radius: 15px 15px 15px 0;
        padding: 10px 15px;
        float: left;
        clear: both;
        box-shadow: 0 1px 2px rgba(0,0,0,0.1);
        border-left: 3px solid #4e73df;
    }
    .message.sent {
        background-color: #4e73df;
        color: white;
        border-radius: 15px 15px 0 15px;
        padding: 10px 15px;
        float: right;
        clear: both;
        box-shadow: 0 1px 2px rgba(0,0,0,0.1);
        border-right: 3px solid #1cc88a;
    }
    .message-input {
        border-top: 1px solid #e3e6f0;
        padding: 15px;
        background-color: #fff;
    }
    .message-info {
        font-size: 11px;
        margin-top: 5px;
        opacity: 0.7;
    }
    .system-message {
        text-align: center;
        margin: 10px 0;
        font-size: 12px;
        color: #858796;
        clear: both;
    }
    .media-message img {
        max-width: 100%;
        max-height: 300px;
        border-radius: 5px;
    }
    .media-message audio, 
    .media-message video {
        max-width: 100%;
        border-radius: 5px;
    }
    .media-message a {
        display: block;
        padding: 10px;
        background-color: rgba(0,0,0,0.05);
        border-radius: 5px;
        text-decoration: none;
        color: inherit;
    }
    .media-message a i {
        margin-right: 10px;
    }
    .emoji-picker-container {
        position: relative;
    }
    .emoji-picker {
        position: absolute;
        bottom: 100%;
        right: 0;
        z-index: 100;
    }
    
    /* Añadir después de los estilos existentes */
    .message.system {
        text-align: center;
        background-color: #f8f9fa;
        color: #666;
        border: 1px dashed #ccc;
        padding: 5px 10px;
        border-radius: 10px;
        margin: 10px auto;
        max-width: 80%;
        float: none;
        clear: both;
        font-style: italic;
    }

    .message-sender {
        font-weight: bold;
        margin-bottom: 3px;
        color: #4e73df;
    }

    .message-text {
        white-space: pre-wrap;
        word-break: break-word;
    }

    .message.sent code {
        background-color: rgba(0,0,0,0.1);
        padding: 2px 4px;
        border-radius: 3px;
        font-family: monospace;
        font-size: 90%;
    }

    .message.received code {
        background-color: rgba(255,255,255,0.3);
        padding: 2px 4px;
        border-radius: 3px;
        font-family: monospace;
        font-size: 90%;
    }

    /* Estilo para mensajes de WhatsApp */
    .message {
        max-width: 80%;
        margin-bottom: 10px;
        border-radius: 10px;
        padding: 8px 12px;
        position: relative;
        clear: both;
        word-wrap: break-word;
    }
    
    .message.received {
        float: left;
        background-color: #f0f0f0;
        color: #333;
        border-top-left-radius: 0;
    }
    
    .message.sent {
        float: right;
        background-color: #dcf8c6;
        color: #303030;
        border-top-right-radius: 0;
    }
    
    .message.system {
        float: none;
        background-color: #f8f9fa;
        color: #666;
        border: 1px dashed #ccc;
        text-align: center;
        max-width: 80%;
        margin: 10px auto;
        padding: 5px 10px;
    }
    
    /* Remitente de mensaje */
    .message-sender {
        font-weight: bold;
        margin-bottom: 3px;
    }
    
    /* Información de tiempo */
    .message-info {
        font-size: 0.75em;
        color: #888;
        text-align: right;
        margin-top: 3px;
    }
    
    /* Formatos de WhatsApp */
    .message strong {
        font-weight: bold;
    }
    
    .message em {
        font-style: italic;
    }
    
    .message del {
        text-decoration: line-through;
    }
    
    .message code {
        font-family: monospace;
        background-color: rgba(0,0,0,0.05);
        padding: 1px 3px;
        border-radius: 3px;
    }
    
    /* Estilos adicionales para mensajes de agente */
    .message.sent.agent {
        background-color: #e3f2fd; /* Azul claro para mensajes enviados por agentes */
        border-left: 3px solid #4e73df;
    }
    
    /* Fix para evitar que mensajes se encimen */
    .clear-float {
        clear: both;
        height: 1px;
    }

    /* Nueva clase para resaltar contactos con nuevos mensajes */
    .new-message-highlight {
        background-color: rgba(255, 193, 7, 0.2) !important;
        border-left: 3px solid #ff9800 !important;
        position: relative;
    }

    /* Indicador visual adicional para nuevos mensajes */
    .new-message-highlight::after {
        content: '';
        position: absolute;
        right: 10px;
        top: 50%;
        transform: translateY(-50%);
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background-color: #e74a3b;
        animation: pulse 1s infinite;
    }

    /* Hacer más visible la animación de pulso */
    @keyframes pulse {
        0% {
            transform: translateY(-50%) scale(0.8);
            opacity: 0.7;
        }
        50% {
            transform: translateY(-50%) scale(1.2);
            opacity: 1;
        }
        100% {
            transform: translateY(-50%) scale(0.8);
            opacity: 0.7;
        }
    }

    @keyframes fadeBackground {
        from { background-color: rgba(78, 115, 223, 0.2); }
        to { background-color: rgba(78, 115, 223, 0.08); }
    }

    /* Mejorar el estilo del contador de mensajes no leídos */
    .unread-badge {
        position: absolute;
        top: 10px;
        right: 10px;
        background: #e74a3b;
        color: white;
        border-radius: 50%;
        width: 24px;
        height: 24px;
        text-align: center;
        font-size: 12px;
        line-height: 24px;
        font-weight: bold;
        box-shadow: 0 0 5px rgba(0,0,0,0.2);
    }

    /* Notificaciones flotantes de conversaciones (toast) */
    .notification-toast {
        min-width: 320px;
        max-width: 380px;
        padding: 16px 40px 16px 18px !important;
        font-size: 15px;
        font-weight: 500;
        border-left-width: 5px !important;
        box-shadow: 0 6px 20px rgba(0,0,0,0.25) !important;
        animation: notificationSlideIn 0.35s ease-out;
    }

    .notification-toast-clickable {
        cursor: pointer;
    }

    .notification-toast-clickable:hover {
        filter: brightness(0.97);
        box-shadow: 0 8px 24px rgba(0,0,0,0.3) !important;
    }

    .notification-toast-hint {
        font-size: 12px;
        font-weight: 400;
        opacity: 0.75;
        margin-top: 4px;
    }

    .notification-toast-close {
        position: absolute;
        top: 8px;
        right: 12px;
    }

    @keyframes notificationSlideIn {
        from { transform: translateX(30px); opacity: 0; }
        to { transform: translateX(0); opacity: 1; }
    }

    .notification-toast.alert-warning,
    .notification-toast.alert-danger {
        animation: notificationSlideIn 0.35s ease-out, notificationAttention 1.4s ease-in-out 3;
    }

    @keyframes notificationAttention {
        0%, 100% { box-shadow: 0 6px 20px rgba(0,0,0,0.25); }
        50% { box-shadow: 0 6px 28px rgba(231, 74, 59, 0.55); }
    }