/**
 * Chatbot Widget Styles
 * Diseño moderno y responsive para el chatbot de ALVPortaequipajes
 */

:root {
    --primary-color: #0099cf;
    --primary-dark: #0077cc;
    --bg-color: #ffffff;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --bot-message-bg: #f3f4f6;
    --user-message-bg: #0099cf;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border-box;
}

/* Contenedor principal */
#chatbot-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10020;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Botón flotante */
.chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.chatbot-toggle:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.chatbot-toggle svg {
    width: 28px;
    height: 28px;
    color: white;
    transition: all 0.3s ease;
}

.chatbot-toggle .close-icon {
    display: none;
    position: absolute;
}

.chatbot-minimized .chatbot-toggle .chat-icon {
    display: block;
}

.chatbot-minimized .chatbot-toggle .close-icon {
    display: none;
}

#chatbot-container:not(.chatbot-minimized) .chatbot-toggle .chat-icon {
    display: none;
}

#chatbot-container:not(.chatbot-minimized) .chatbot-toggle .close-icon {
    display: block;
}

/* Notification badge */
.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    font-size: 12px;
    font-weight: bold;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Ventana del chat */
.chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 600px;
    max-height: calc(100vh - 140px);
    background: var(--bg-color);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

#chatbot-container:not(.chatbot-minimized) .chatbot-window {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all;
}

/* Header */
.chatbot-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 16px 16px 0 0;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bot-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bot-avatar svg {
    width: 24px;
    height: 24px;
}

.bot-avatar .bot-emoji {
    font-size: 22px;
    line-height: 1;
}

.header-text h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.header-text .status {
    margin: 2px 0 0;
    font-size: 12px;
    opacity: 0.9;
}

.minimize-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.minimize-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.minimize-btn svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* Área de mensajes */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #f9fafb;
}

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

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

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Mensajes */
.message {
    display: flex;
    gap: 12px;
    animation: messageSlideIn 0.3s ease;
}

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

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message-avatar svg {
    width: 18px;
    height: 18px;
    color: white;
}

.message-avatar .bot-emoji {
    font-size: 18px;
    line-height: 1;
}

.message-content {
    flex: 1;
    background: var(--bot-message-bg);
    padding: 12px 16px;
    border-radius: 12px;
    border-top-left-radius: 4px;
    max-width: 80%;
}

.message-content p {
    margin: 0 0 8px;
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.5;
}

.message-content p:last-child {
    margin-bottom: 0;
}

/* Enlaces en mensajes */
.message-content a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.message-content a:hover {
    text-decoration: underline;
}

/* Mensaje del usuario */
.user-message {
    flex-direction: row-reverse;
}

.user-message .message-avatar {
    background: var(--user-message-bg);
}

.user-message .message-content {
    background: var(--user-message-bg);
    color: white;
    border-top-left-radius: 12px;
    border-top-right-radius: 4px;
}

.user-message .message-content p {
    color: white;
}

/* ★ PUNTO-27: Mensaje del agente humano */
.agent-message .message-avatar {
    background: #10b981;
}
.agent-message .message-content {
    background: #ecfdf5;
    border-left: 3px solid #10b981;
}

/* Timestamp */
.message-time {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 4px;
    display: block;
}

/* Indicador de escritura */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--bot-message-bg);
    border-radius: 12px;
    border-top-left-radius: 4px;
    width: fit-content;
    margin-left: 44px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-light);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

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

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

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

/* Input container */
.chatbot-input-container {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid var(--border-color);
}

#chatbot-form {
    display: flex;
    gap: 8px;
}

.chatbot-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

.chatbot-input:focus {
    border-color: var(--primary-color);
}

.send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.send-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.send-btn svg {
    width: 20px;
    height: 20px;
    color: white;
}

/* Responsive */
@media (max-width: 480px) {
    #chatbot-container {
        bottom: 56px;
        right: 16px;
    }

    .chatbot-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 100px);
        bottom: 76px;
    }

    .chatbot-toggle {
        width: 56px;
        height: 56px;
    }
}

/* Opciones de vehículos (cuando hay múltiples resultados) */
.vehicle-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.vehicle-option {
    padding: 12px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-size: 13px;
}

.vehicle-option:hover {
    border-color: var(--primary-color);
    background: #f0f9ff;
}

.vehicle-option-number {
    font-weight: 600;
    color: var(--primary-color);
    margin-right: 4px;
}

/* Imagen de confirmación de vehículo */
.confirm-vehicle-image {
    margin-top: 10px;
}

.confirm-vehicle-image img {
    width: 100%;
    max-width: 280px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

/* Botón de resultado único */
.single-result-action {
    margin-top: 12px;
}

.single-result-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.single-result-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.single-result-btn:active {
    transform: translateY(0);
}

/* Feedback widget */
.feedback-widget {
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.feedback-question {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.feedback-buttons {
    display: flex;
    gap: 10px;
}

.feedback-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-positive {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.feedback-positive:hover {
    background: #d1fae5;
}

.feedback-negative {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.feedback-negative:hover {
    background: #fee2e2;
}

.feedback-thanks {
    margin: 0;
    font-size: 14px;
    color: #059669;
    text-align: center;
    padding: 8px 0;
}

.feedback-negative-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.feedback-option-btn {
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: white;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.feedback-option-btn:hover {
    background: #f8fafc;
    border-color: #0099cf;
}

.feedback-agent-btn {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.feedback-agent-btn:hover {
    background: #dbeafe;
}

.feedback-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 10px;
}

.feedback-textarea:focus {
    outline: none;
    border-color: #0099cf;
    box-shadow: 0 0 0 3px rgba(0, 153, 255, 0.1);
}

.feedback-submit-row {
    display: flex;
    gap: 8px;
}

.feedback-submit-btn {
    flex: 1;
    padding: 10px 16px;
    background: #0099cf;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.feedback-submit-btn:hover {
    background: #0077cc;
}

.feedback-skip-btn {
    padding: 10px 16px;
    background: #f3f4f6;
    color: #6b7280;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.feedback-skip-btn:hover {
    background: #e5e7eb;
}

.feedback-agent-message {
    margin: 0;
    font-size: 14px;
    color: #1f2937;
    line-height: 1.5;
}

.feedback-agent-message a {
    color: #0099cf;
    text-decoration: none;
}

.feedback-agent-message a:hover {
    text-decoration: underline;
}

/* Roof types guide */
.roof-guide {
    margin-top: 12px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    max-width: 100%;
}

.roof-guide-title {
    margin-bottom: 16px;
    font-size: 14px;
    color: #333;
}

.roof-type-item {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.roof-type-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.roof-type-item strong {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-size: 13px;
}

.roof-type-item p {
    margin: 0 0 12px 0;
    font-size: 12px;
    line-height: 1.5;
    color: #666;
}

.roof-images {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.roof-image {
    max-width: 150px;
    height: auto;
    border-radius: 6px;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: transform 0.2s;
}

.roof-image:hover {
    transform: scale(1.05);
}

/* =============================================================================
   SELECTOR VISUAL DE GENERACIONES/VARIANTES
   ============================================================================= */

.visual-selector {
    margin-top: 16px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.visual-selector-hint {
    font-size: 12px;
    color: #666;
    margin: 0 0 4px 0;
    text-align: center;
}

.visual-selector-disclaimer {
    font-size: 11px;
    color: #999;
    margin: 0 0 12px 0;
    text-align: center;
    font-style: italic;
}

.visual-selector-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
}

.visual-option-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #d0d0d0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.visual-option-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 153, 255, 0.25);
}

.visual-option-image-container {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    aspect-ratio: 4/3;
    background: #f0f0f0;
}

.visual-option-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.visual-option-image-container:hover .visual-option-image {
    transform: scale(1.05);
}

.visual-option-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    z-index: 1;
    pointer-events: none;
}

.badge-fixation {
    background: rgba(0, 120, 210, 0.9);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.badge-variant {
    background: rgba(217, 119, 6, 0.9);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    top: 28px;
}

.visual-option-zoom-hint {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 11px;
    padding: 4px 8px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.visual-option-image-container:hover .visual-option-zoom-hint {
    opacity: 1;
}

.visual-option-info {
    padding: 8px 10px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.visual-option-generation {
    display: block;
    font-weight: 700;
    font-size: 14px;
    color: var(--primary-color);
    margin-bottom: 2px;
}

.visual-option-years {
    display: block;
    font-size: 12px;
    color: #666;
}

.visual-option-btn {
    display: block;
    width: calc(100% - 16px);
    margin: 8px;
    padding: 10px 8px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.visual-option-btn:hover {
    background: #0077cc;
    transform: scale(1.02);
}

/* =============================================================================
   LIGHTBOX PARA AMPLIAR IMÁGENES
   ============================================================================= */

.chatbot-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
}

.chatbot-lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    z-index: 1;
    animation: lightbox-zoom-in 0.3s ease;
}

@keyframes lightbox-zoom-in {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    padding: 0 10px;
    line-height: 1;
}

.lightbox-close:hover {
    color: #ccc;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    display: block;
}

.lightbox-caption {
    color: white;
    text-align: center;
    margin-top: 12px;
    font-size: 14px;
    padding: 0 20px;
}

.lightbox-image-wrapper {
    position: relative;
    display: inline-block;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.lightbox-disclaimer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0,0,0,0.7);
    color: #fff;
    text-align: center;
    padding: 6px 12px;
    font-size: 11px;
    box-sizing: border-box;
}

/* =============================================================================
   RESPONSIVE - SELECTOR VISUAL
   ============================================================================= */

@media (max-width: 480px) {
    .visual-selector-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .visual-option-info {
        padding: 6px 8px;
    }

    .visual-option-generation {
        font-size: 12px;
    }

    .visual-option-years {
        font-size: 11px;
    }

    .visual-option-btn {
        width: calc(100% - 12px);
        margin: 6px;
        padding: 8px 6px;
        font-size: 11px;
    }

    .lightbox-image {
        max-height: 70vh;
    }

    .lightbox-caption {
        font-size: 12px;
    }
}

/* =============================================================================
   PUNTO-26: Welcome chips, contact channels, contact form
   ============================================================================= */

/* Welcome chips (2 opciones iniciales) */
.welcome-chips {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.welcome-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-color);
    text-align: left;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.welcome-chip:hover {
    border-color: var(--primary-color);
    background: #f0f9ff;
}

.welcome-chip:disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.chip-emoji {
    font-size: 16px;
    flex-shrink: 0;
}

/* Chip persistente de contacto (sobre el input durante búsqueda de barras) */
.persistent-chip-container {
    padding: 8px 20px 8px;
    border-bottom: 1px solid var(--border-color);
}

.persistent-chip-container .persistent-chip {
    width: 100%;
    font-size: 12px;
    padding: 8px 12px;
    background: #f8fafc;
    border-color: #e2e8f0;
}

.persistent-chip-container .persistent-chip:hover {
    border-color: var(--primary-color);
    background: #f0f9ff;
}

.persistent-chip-container.highlight .persistent-chip {
    border-color: var(--primary-color);
    background: #f0f9ff;
    animation: chipPulse 0.5s ease 2;
}

@keyframes chipPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}

/* Input deshabilitado (antes de elegir chip) */
.chatbot-input:disabled {
    background: #f3f4f6;
    cursor: not-allowed;
    color: #9ca3af;
}

/* Contact channels (sub-chips) */
.contact-channels {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.contact-channel-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-color);
    text-align: left;
    transition: all 0.2s ease;
}

.contact-channel-btn:hover {
    border-color: var(--primary-color);
    background: #f0f9ff;
}

/* Contact form inline */
.contact-form-inline {
    margin-top: 8px;
}

.contact-form-title {
    font-size: 13px;
    color: var(--text-color);
    margin: 0 0 12px 0;
}

.contact-form-field {
    margin-bottom: 10px;
}

.contact-form-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 4px;
}

.contact-form-field input,
.contact-form-field textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1.5px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-color);
    background: #ffffff;
    transition: border-color 0.2s;
    resize: vertical;
}

.contact-form-field input:focus,
.contact-form-field textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.contact-form-submit {
    width: 100%;
    padding: 10px;
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.contact-form-submit:hover:not(:disabled) {
    background: var(--primary-dark);
}

.contact-form-submit:disabled {
    opacity: 0.5;
    cursor: default;
}

.contact-form-success {
    text-align: center;
    padding: 12px;
}

.contact-form-success p {
    margin: 4px 0;
    font-size: 13px;
}

.contact-form-success p:first-child {
    font-size: 15px;
    font-weight: 600;
}

/* Privacy (RGPD) popup in contact form */
.cf-privacy-link-wrap {
    text-align: center;
    margin: 8px 0 10px;
}

.cf-privacy-link {
    font-size: 11px;
    color: var(--text-light);
    text-decoration: underline;
    cursor: pointer;
}

.cf-privacy-link:hover {
    color: var(--primary-color);
}

.cf-privacy-popup {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    font-size: 11px;
    line-height: 1.55;
    color: var(--text-color);
}

.cf-privacy-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px;
}

.cf-privacy-title {
    font-weight: 700;
    font-size: 12px;
    color: var(--text-color);
}

.cf-privacy-close {
    background: none;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-light);
    padding: 0 0 0 8px;
    flex-shrink: 0;
}

.cf-privacy-close:hover {
    color: var(--text-color);
}

.cf-privacy-popup p {
    margin: 3px 0;
}

.cf-privacy-popup a {
    color: var(--primary-color);
    text-decoration: underline;
}

.cf-privacy-popup a:hover {
    color: var(--primary-dark);
}

/* =============================================================================
   PHOTO UPLOAD IN AGENT MODE
   ============================================================================= */

/* Attach button (solo visible en agentMode, JS lo muestra) */
.attach-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 1.5px solid var(--border-color);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.attach-btn:hover {
    border-color: var(--primary-color);
    background: #f0f9ff;
}

.attach-btn svg {
    width: 18px;
    height: 18px;
    color: var(--text-light);
}

.attach-btn:hover svg {
    color: var(--primary-color);
}

/* Image preview area (above input, below persistent chip) */
.image-preview-area {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 20px;
    border-bottom: 1px solid var(--border-color);
    background: #fafbfc;
}

.image-preview-thumb {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.image-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-remove {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background: #ef4444;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.image-preview-remove:hover {
    background: #dc2626;
}

/* Chat image bubble (in messages) */
.chat-image-bubble {
    margin-top: 4px;
    max-width: 200px;
}

.chat-image-bubble img {
    width: 100%;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
    display: block;
}

.chat-image-bubble img:hover {
    opacity: 0.9;
}

/* Responsive */
@media (max-width: 480px) {
    .image-preview-thumb {
        width: 50px;
        height: 50px;
    }

    .chat-image-bubble {
        max-width: 160px;
    }
}
