/* ============================================
   VARIABLES CSS GLOBALES
   ============================================ */
   :root {
    --button-color: #0073aa;
    --button-color-rgba-40: rgba(0, 115, 170, 0.4);
    --button-color-rgba-80: rgba(0, 115, 170, 0.8);
    --primary-color: #2f5bec;
    --primary-hover: #1a4bd8;
    --secondary-color: #f8f9fa;
    --text-color: #333;
    --text-light: #666;
    --border-color: #e1e5e9;
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 20px rgba(0, 0, 0, 0.15);
    --shadow-heavy: 0 8px 30px rgba(0, 0, 0, 0.2);
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --z-modal: 999999;
    --z-sidebar: 999999;
    --z-overlay: 999998;
    --z-toggle: 999999;
    --bg-color: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #333333;
    --text-secondary: #666666;
}

/* Bloquear scroll cuando el modal está activo */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* ============================================
   BOTÓN FLOTANTE MEJORADO
   ============================================ */
.openai-chatbot-button {
    position: fixed;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--button-color) 0%, var(--button-color-rgba-80) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-medium);
    z-index: var(--z-modal);
    overflow: hidden;
    transition: all var(--transition-smooth);
    border: 3px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    animation: float 3s ease-in-out infinite, pulse-glow 2s infinite;
}

.openai-chatbot-button:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: var(--shadow-heavy);
    animation-play-state: paused;
}

.openai-chatbot-button:active {
    transform: scale(0.95);
}

.openai-chatbot-button img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.openai-chatbot-button .dashicons {
    font-size: 28px;
    animation: bounce-gentle 2s ease-in-out infinite;
}

/* Posiciones del botón mejoradas */
.openai-chatbot-button.bottom-right {
    bottom: 24px;
    right: 24px;
}

.openai-chatbot-button.bottom-left {
    bottom: 24px;
    left: 24px;
}

.openai-chatbot-button.top-right {
    top: 24px;
    right: 24px;
}

.openai-chatbot-button.top-left {
    top: 24px;
    left: 24px;
}

/* Animaciones mejoradas */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-6px); }
}

@keyframes bounce-gentle {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px var(--button-color-rgba-40), var(--shadow-medium);
    }
    50% {
        box-shadow: 0 0 30px var(--button-color-rgba-80), var(--shadow-heavy);
    }
}

/* ============================================
   MODAL MEJORADO
   ============================================ */
.openai-chatbot-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: var(--z-modal);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-smooth);
}

.openai-chatbot-modal.active {
    opacity: 1;
    visibility: visible;
}

.openai-chatbot-modal-content {
    display: flex;
    background: white;
    border-radius: var(--border-radius);
    width: min(90vw, 1200px);
    height: min(85vh, 700px);
    max-height: 90vh;
    box-shadow: var(--shadow-heavy);
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: all var(--transition-smooth);
    position: relative;
}

/* Ocultar elementos cuando la ventana de asistentes está activa */
.openai-chatbot-modal-content.showing-assistants .openai-chatbot-header,
.openai-chatbot-modal-content.showing-assistants .openai-chatbot-input-container,
.openai-chatbot-modal-content.showing-assistants #openai-chatbot-messages,
.openai-chatbot-modal-content.showing-assistants .openai-chatbot-sidebar {
    display: none;
}

/* Asegurar que el botón close siempre esté visible en modo flotante */
.openai-chatbot-modal:not(.shortcode-mode) .openai-chatbot-close {
    display: flex;
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: var(--z-toggle);
}

/* Asegurar que el botón toggle esté oculto cuando la pantalla de bienvenida está activa */
.openai-chatbot-modal-content.showing-assistants .sidebar-toggle {
    display: none;
}

.openai-chatbot-modal.active .openai-chatbot-modal-content {
    transform: scale(1) translateY(0);
}

/* ============================================
   SIDEBAR MEJORADO
   ============================================ */
.openai-chatbot-sidebar {
    width: 280px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    overflow-y: auto;
    transition: all var(--transition-smooth);
    position: relative;
}

.openai-chatbot-sidebar h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.openai-chatbot-sidebar h3:before {
    content: "🤖";
    font-size: 20px;
}

.openai-chatbot-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.openai-chatbot-sidebar li {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    background: white;
    border: 2px solid transparent;
    box-shadow: var(--shadow-light);
}

.openai-chatbot-sidebar li:hover {
    transform: translateX(4px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-medium);
}

.openai-chatbot-sidebar li.selected {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    transform: translateX(4px);
    box-shadow: var(--shadow-medium);
}

.openai-chatbot-sidebar li.selected::before {
    content: "";
    position: absolute;
    left: -2px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: white;
    border-radius: 2px;
}

.openai-chatbot-sidebar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all var(--transition-fast);
}

.openai-chatbot-sidebar li.selected img {
    border-color: white;
    transform: scale(1.05);
}

.openai-chatbot-sidebar span {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
}

/* ============================================
   CONTENIDO PRINCIPAL MEJORADO
   ============================================ */
.openai-chatbot-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #fafbfc;
}

.openai-chatbot-header {
    padding: 20px 24px;
    background: white;
    border-bottom: 1px solid var(--border-color);
    display: block;
    align-items: center;
    gap: 12px;
    min-height: 80px;
    position: relative;
}

.openai-chatbot-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-color);
    flex-grow: 1;
    text-align: center;
}

.openai-chatbot-header p {
    margin: 4px 0 0 0;
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.4;
    text-align: center;
}

.openai-chatbot-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--background-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    transform-origin: center;
}

.openai-chatbot-close:hover {
    background: #ff4d4d;
    color: white;
    transform: rotate(90deg);
}

/* ============================================
   MENSAJES MEJORADOS
   ============================================ */
#openai-chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

#openai-chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

#openai-chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

#openai-chatbot-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.openai-chatbot-bot-message,
.openai-chatbot-user-message {
    max-width: 75%;
    padding: 14px 18px;
    border-radius: 18px;
    line-height: 1.6;
    font-size: 15px;
    animation: message-slide-in var(--transition-smooth);
    position: relative;
    word-wrap: break-word;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    border: 2px solid var(--border-color);
    background-color: #e0e0e0;
}

.openai-chatbot-bot-message .message-avatar {
    background-color: var(--primary-color);
}

.openai-chatbot-user-message {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    align-self: flex-end;
    box-shadow: var(--shadow-light);
    border-bottom-right-radius: 6px;
    flex-direction: row-reverse;
    gap: 4px;
}

.openai-chatbot-user-message .message-avatar {
    margin-left: 8px;
    margin-right: 0;
}

.openai-chatbot-user-message .message-content {
    padding-left: 0;
}

.openai-chatbot-user-message::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: -8px;
    width: 0;
    height: 0;
    border-left: 8px solid var(--primary-color);
    border-bottom: 8px solid transparent;
}

.message-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.openai-chatbot-bot-message {
    background: white;
    color: var(--text-color);
    align-self: flex-start;
    box-shadow: var(--shadow-light);
    border-bottom-left-radius: 6px;
    border: 1px solid var(--border-color);
}

.openai-chatbot-bot-message::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-right: 8px solid white;
    border-bottom: 8px solid transparent;
}

.message-content {
    width: 100%;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 2px;
}

.openai-chatbot-bot-message .message-time {
    color: var(--text-light);
    text-align: left;
}

.openai-chatbot-user-message .message-time {
    color: rgba(255, 255, 255, 0.8);
    text-align: right;
}

/* Ajustar el espaciado de los mensajes */
.openai-chatbot-bot-message,
.openai-chatbot-user-message {
    padding-bottom: 8px;
}

/* Ajustar el indicador de escritura */
.typing-indicator {
    margin-bottom: 4px;
}

/* ============================================
   INPUT MEJORADO
   ============================================ */
.openai-chatbot-input-container {
    padding: 20px 24px;
    background: white;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    align-items: center;
    position: relative;
}

#openai-chatbot-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    font-size: 15px;
    line-height: 1.5;
    resize: none;
    min-height: 24px;
    max-height: 120px;
    transition: all var(--transition-fast);
    background: #fafbfc;
    padding-bottom: 25px;
}

#openai-chatbot-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(47, 91, 236, 0.1);
    background: white;
}

#openai-chatbot-input:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

#openai-chatbot-send {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-light);
}

#openai-chatbot-send:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-medium);
}

#openai-chatbot-send:active {
    transform: scale(0.95);
}

#openai-chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

#openai-chatbot-send img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

#openai-chatbot-send .dashicons {
    font-size: 20px;
}

/* ============================================
   PANTALLA DE BIENVENIDA MEJORADA
   ============================================ */
#openai-chatbot-initial-message {
    text-align: center;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* display: block; */
    align-items: center;
    height: 100%;
    width: 100%;
    background: linear-gradient(135deg, #fafbfc 0%, #f8f9fa 100%);
    overflow-y: auto;
}

#openai-chatbot-initial-message h2 {
    color: var(--primary-color);
    margin: 15px 0 16px 0;
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

#openai-chatbot-initial-message p {
    color: var(--text-light);
    margin: 0 0 40px 0;
    font-size: 18px;
    line-height: 1.6;
}

@media screen and (max-width: 768px) {
    #openai-chatbot-initial-message h2 {
        margin: 10px 0 16px 0;
    }
}

#openai-chatbot-assistant-avatars {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
}

.openai-chatbot-avatar {
    background: white;
    border-radius: var(--border-radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    border: 2px solid transparent;
    flex: 0 0 280px;
    box-sizing: border-box;
}

.openai-chatbot-avatar::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.5s;
}

.openai-chatbot-avatar:hover {
    transform: translateY(-8px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-heavy);
}

.openai-chatbot-avatar:hover::before {
    left: 100%;
}

.openai-chatbot-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 16px;
    object-fit: cover;
    border: 4px solid rgba(47, 91, 236, 0.1);
    transition: all var(--transition-fast);
}

.openai-chatbot-avatar:hover img {
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.openai-chatbot-avatar .assistant-name {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
    font-size: 16px;
}

.openai-chatbot-avatar .assistant-description {
    font-size: 14px;
    color: var(--text-light);
    text-align: center;
    line-height: 1.5;
}

/* ============================================
   INDICADOR DE ESCRITURA MEJORADO
   ============================================ */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: white;
    border-radius: 18px;
    width: fit-content;
    margin: 8px 0;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 6px;
}

.typing-indicator::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-right: 8px solid white;
    border-bottom: 8px solid transparent;
}

.typing-indicator .dot {
    width: 5px;
    height: 5px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-indicator .dot:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator .dot:nth-child(2) { animation-delay: -0.16s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0s; }

@keyframes typing-bounce {
    0%, 80%, 100% { 
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% { 
        transform: scale(1);
        opacity: 1;
    }
}

/* ============================================
   MODO SHORTCODE MEJORADO
   ============================================ */
.openai-chatbot-modal.shortcode-mode {
    position: relative;
    width: 100%;
    height: 600px;
    margin: 24px 0;
    opacity: 1;
    visibility: visible;
    background: none;
    z-index: 1;
    display: block;
    backdrop-filter: none;
}

.openai-chatbot-modal.shortcode-mode .openai-chatbot-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    transform: none;
    margin: 0;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-heavy);
    border: 1px solid var(--border-color);
}

/* ============================================
   SIDEBAR TOGGLE MEJORADO
   ============================================ */
.sidebar-toggle {
    display: none;
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: var(--z-toggle);
    background: white;
    border: 2px solid var(--border-color);
    padding: 8px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-light);
    transition: all var(--transition-smooth);
}

.sidebar-toggle.active {
    left: 320px; /* 280px del sidebar + 20px de padding + 20px de espacio */
    background: white;
    z-index: calc(var(--z-toggle) + 1);
}

.sidebar-toggle:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
    box-shadow: var(--shadow-medium);
}

.sidebar-toggle .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: var(--text-color);
}

/* ============================================
   OVERLAY MEJORADO
   ============================================ */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: var(--z-overlay);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-smooth);
    pointer-events: none;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ============================================
   TEMA OSCURO MEJORADO
   ============================================ */
body.openai-chatbot-dark {
    --bg-color: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-color: #ffffff;
    --text-light: #cccccc;
    --border-color: #404040;
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
}

body.openai-chatbot-dark .openai-chatbot-modal-content {
    background: #1a1a1a;
    border-color: #333;
}

body.openai-chatbot-dark .openai-chatbot-sidebar {
    background: linear-gradient(135deg, #2d2d2d 0%, #1f1f1f 100%);
    border-right-color: #333;
}

body.openai-chatbot-dark .openai-chatbot-sidebar li {
    background: #2a2a2a;
    color: #fff;
}

body.openai-chatbot-dark .openai-chatbot-sidebar li.selected {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
}

body.openai-chatbot-dark .openai-chatbot-main-content {
    background: #1a1a1a;
}

body.openai-chatbot-dark .openai-chatbot-header {
    background: #2d2d2d;
    border-bottom-color: #333;
}

body.openai-chatbot-dark #openai-chatbot-input {
    background: #2d2d2d;
    border-color: #333;
    color: #fff;
}

body.openai-chatbot-dark #openai-chatbot-input:focus {
    background: #333;
}

body.openai-chatbot-dark .openai-chatbot-bot-message {
    background: #2d2d2d;
    border-color: #333;
    color: #fff;
}

body.openai-chatbot-dark .openai-chatbot-input-container {
    background: #2d2d2d;
    border-top-color: #333;
}

body.openai-chatbot-dark #openai-chatbot-initial-message {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

body.openai-chatbot-dark .openai-chatbot-avatar {
    background: #2a2a2a;
    border-color: #333;
}

body.openai-chatbot-dark .sidebar-toggle {
    background: #2d2d2d;
    border-color: #333;
}

/* ============================================
   ANIMACIONES ADICIONALES
   ============================================ */
@keyframes message-slide-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modal-entrance {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(40px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ============================================
   RESPONSIVE MEJORADO
   ============================================ */
@media screen and (max-width: 768px) {
    :root {
        --border-radius: 8px;
        --border-radius-sm: 6px;
    }

    .openai-chatbot-button {
        width: 56px;
        height: 56px;
        bottom: 20px;
        right: 20px;
    }

    .openai-chatbot-modal-content {
        width: 100vw;
        height: 95vh;
        margin-top: 5vh;
        border-radius: 0;
        max-height: none;
    }

    .openai-chatbot-sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        bottom: 0;
        width: min(80vw, 320px);
        z-index: var(--z-sidebar);
        transition: left var(--transition-smooth);
        border-radius: 0;
        transform: translateX(-100%);
    }

    .openai-chatbot-sidebar.active {
        left: 0;
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: flex;
        top: 16px;
        left: 16px;
    }

    .openai-chatbot-header {
        padding: 16px 16px 16px 16px;
        min-height: 60px;
        justify-items: center;
    }

    .openai-chatbot-header h3 {
        font-size: 18px;
    }

    #openai-chatbot-messages {
        padding: 16px;
        padding-bottom: 100px;
    }

    .openai-chatbot-input-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 16px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
        border-top: 1px solid var(--border-color);
    }

    .openai-chatbot-bot-message,
    .openai-chatbot-user-message {
        max-width: 90%;
        padding: 12px 16px;
        font-size: 14px;
    }

    #openai-chatbot-input {
        font-size: 16px; /* Evita zoom en iOS */
        padding: 12px 16px;
    }

    /* Shortcode responsive */
    .openai-chatbot-modal.shortcode-mode {
        height: 600px;
        margin: 16px 0;
        border-radius: var(--border-radius);
    }

    .openai-chatbot-modal.shortcode-mode .openai-chatbot-modal-content {
        border-radius: var(--border-radius);
    }

    .openai-chatbot-modal.shortcode-mode .openai-chatbot-sidebar {
        position: absolute;
        width: min(80vw, 280px);
        left: -100%;
        z-index: var(--z-sidebar);
    }

    .openai-chatbot-modal.shortcode-mode .openai-chatbot-sidebar.active {
        left: 0;
    }

    .openai-chatbot-modal.shortcode-mode .openai-chatbot-main-content {
        padding: 0;
    }

    .openai-chatbot-modal.shortcode-mode .openai-chatbot-header {
        padding: 12px 16px 12px 16px;
        text-align: center;
    }

    .openai-chatbot-modal.shortcode-mode #openai-chatbot-messages {
        padding: 12px;
        padding-bottom: 140px;
    }

    .openai-chatbot-modal.shortcode-mode .openai-chatbot-input-container {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 12px;
        align-items: center;
    }

    #openai-chatbot-assistant-avatars {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 16px;
    }

    .openai-chatbot-avatar {
        padding: 20px 16px;
    }

    .openai-chatbot-avatar img {
        width: 60px;
        height: 60px;
    }

    .sidebar-toggle.active {
        left: calc(min(70vw, 320px) + 20px);
        background: white;
        z-index: calc(var(--z-toggle) + 1);
    }
    
    #openai-chatbot-selected-assistant-name,
    #openai-chatbot-selected-assistant-description {
        padding: 0 60px;
    }
}

@media screen and (max-width: 480px) {
    .openai-chatbot-sidebar {
        width: 90vw;
    }

    .openai-chatbot-modal.shortcode-mode .openai-chatbot-sidebar {
        width: 90vw;
    }

    #openai-chatbot-initial-message h2 {
        font-size: 24px;
    }

    #openai-chatbot-initial-message p {
        font-size: 16px;
    }
}

/* ============================================
   ENLACES DE ASISTENTES
   ============================================ */
.openai-chatbot-assistant-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    padding: 20px;
}

.openai-chatbot-assistant-link {
    display: flex;
    align-items: center;
    padding: 20px;
    background: white;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-color);
    transition: all var(--transition-smooth);
    border: 2px solid transparent;
    box-shadow: var(--shadow-light);
}

.openai-chatbot-assistant-link:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-medium);
}

.openai-chatbot-assistant-link img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 16px;
    object-fit: cover;
    border: 3px solid rgba(47, 91, 236, 0.1);
    transition: all var(--transition-fast);
}

.openai-chatbot-assistant-link:hover img {
    border-color: var(--primary-color);
    transform: scale(1.1);
}

.openai-chatbot-assistant-link .assistant-link-content {
    flex: 1;
}

.openai-chatbot-assistant-link h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.openai-chatbot-assistant-link p {
    margin: 0;
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.4;
}

@media screen and (max-width: 768px) {
    .openai-chatbot-assistant-links {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .openai-chatbot-assistant-link {
        padding: 16px;
    }

    .openai-chatbot-assistant-link img {
        width: 50px;
        height: 50px;
    }

    .openai-chatbot-assistant-link h3 {
        font-size: 16px;
    }
}

/* Estilos para el contador de caracteres */
.char-counter {
    position: absolute;
    right: 10px;
    bottom: 10px;
    font-size: 12px;
    color: #666;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.char-counter.warning {
    color: #f39c12;
}

.char-counter.error {
    color: #e74c3c;
    font-weight: bold;
}

/* Media queries para ajustar el número de columnas según el ancho de la pantalla */
@media screen and (min-width: 1400px) {
    #openai-chatbot-assistant-avatars {
        grid-template-columns: repeat(4, minmax(280px, 1fr));
    }
}

@media screen and (min-width: 1024px) and (max-width: 1399px) {
    #openai-chatbot-assistant-avatars {
        grid-template-columns: repeat(3, minmax(280px, 1fr));
    }
}

@media screen and (min-width: 768px) and (max-width: 1023px) {
    #openai-chatbot-assistant-avatars {
        grid-template-columns: repeat(2, minmax(280px, 1fr));
    }
}

@media screen and (max-width: 767px) {
    #openai-chatbot-assistant-avatars {
        grid-template-columns: 1fr;
        padding: 10px;
    }
}

.openai-chatbot-user-message strong {
    float: right;
    margin-left: 8px;
}

.openai-chatbot-footer {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
    padding: 0 10px;
    text-align: center;
    line-height: 1.4;
}

.openai-chatbot-footer a {
    color: var(--button-color);
    text-decoration: none;
}

.openai-chatbot-footer a:hover {
    text-decoration: underline;
}

/* Estilos para el modo oscuro */
.openai-chatbot-dark .openai-chatbot-footer {
    color: #999;
}

.openai-chatbot-dark .openai-chatbot-footer a {
    color: #fff;
}