.chat-icon {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #ffffff 0%, #e9e4ee 100%);
    color: #8406C8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: iconBounce 0.6s ease-out;
}

.chat-icon:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.6);
}

.chat-icon i {
    font-size: 40px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes iconBounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.chat-window {
    display: none;
    position: fixed;
    bottom: 110px;
    right: 25px;
    width: 380px;
    height: 520px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    flex-direction: column;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .chat-window {
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        width: 100vw;
        height: 90vh;
        border-radius: 0;
        max-width: 100vw;
        max-height: 100vh;
    }
    
    .chat-header {
        border-radius: 0 !important;
        font-size: 1.3em !important;
        padding: 20px 15px !important;
    }
    
    .chat-messages,
    .chat-input,
    #user-input,
    .message {
        font-size: 1.15em !important;
    }
    
    .chat-input {
        padding: 15px 8px !important;
        flex-direction: row;
        gap: 8px;
    }
    
    #user-input {
        min-width: 0;
        width: 100%;
        font-size: 1.1em;
        padding: 12px 10px;
    }
    
    .send-btn {
        min-width: 44px;
        max-width: 44px;
        height: 44px;
        padding: 0;
        border-radius: 12px;
        font-size: 1.2em;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.chat-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.chat-header span {
    font-weight: 600;
    font-size: 1.1em;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.chat-messages {
    flex-grow: 1;
    padding: 25px 20px;
    overflow-y: auto;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    position: relative;
}

.chat-messages::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    pointer-events: none;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}

.chat-input {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 12px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    align-items: flex-end;
}

#user-input {
    flex-grow: 1;
    padding: 15px 18px;
    border: 2px solid rgba(102, 126, 234, 0.1);
    border-radius: 15px;
    font-size: 0.95em;
    font-family: 'Inter', sans-serif;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    outline: none;
    color: #2d3748;
    resize: none;
    min-height: 50px;
    max-height: 120px;
}

#user-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 1);
}

#user-input::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

.send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 15px 18px;
    cursor: pointer;
    min-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.send-btn:active {
    transform: translateY(0);
}

.send-btn i {
    font-size: 18px;
}

.message {
    margin: 15px 0;
    padding: 15px 20px;
    border-radius: 18px;
    max-width: 85%;
    position: relative;
    animation: messageSlide 0.3s ease-out;
    word-wrap: break-word;
    line-height: 1.5;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    align-self: flex-end;
    margin-left: auto;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    border-bottom-right-radius: 8px;
}

.user-message::before,
.assistant-message::before {
    display: none !important;
    content: none !important;
}

.assistant-message {
    background: rgba(255, 255, 255, 0.9);
    color: #2d3748;
    align-self: flex-start;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-bottom-left-radius: 8px;
}

a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.welcome-message {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 20px;
    opacity: 0.8;
}

.message-with-avatar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* New styles for client info section */
.client-info {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    z-index: 10;
}

.client-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 800px;
    width: 100%;
    padding: 40px;
    text-align: center;
    animation: fadeIn 0.8s ease-out;
}

.client-photo {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    border: 3px solid white;
    object-fit: cover;
    margin: 0 auto 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.client-name {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 10px;
}

.client-specialty {
    font-size: 1.5rem;
    font-weight: 500;
    color: #667eea;
    margin-bottom: 20px;
}

.contact-details {
    margin-bottom: 20px;
    color: #2d3748;
}

.contact-details p {
    margin: 5px 0;
    font-size: 1rem;
}

.map-container {
    margin: 20px 0;
    max-width: 100%;
    height: 300px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.services-container {
    margin-top: 20px;
}

.services-list {
    list-style: none;
    padding: 0;
    text-align: left;
}

.services-list li {
    margin-bottom: 10px;
    font-size: 1rem;
    color: #2d3748;
    position: relative;
    padding-left: 20px;
}

.services-list li::before {
    content: '•';
    color: #667eea;
    position: absolute;
    left: 0;
    font-size: 1.2rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .client-card {
        padding: 20px;
    }

    .client-photo {
        width: 150px;
        height: 150px;
    }

    .client-name {
        font-size: 1.8rem;
    }

    .client-specialty {
        font-size: 1.2rem;
    }

    .contact-details p {
        font-size: 0.9rem;
    }

    .map-container {
        height: 200px;
    }

    .services-list li {
        font-size: 0.9rem;
    }
}

/* New styles for chat popup */
.chat-popup {
    position: fixed;
    bottom: 140px;
    right: 50px;
    background: white;
    color: #2d3748;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(102,126,234,0.18);
    padding: 18px 22px;
    font-size: 1.05em;
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.4s, transform 0.4s;
}
/* Flecha apuntando al botón de chat */
#chat-popup::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 20px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}
.chat-popup.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}
.chat-popup-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
}
@media (max-width: 600px) {
    .chat-popup {
        right: 40px;
        left: 30px;
        bottom: 140px;
        font-size: 1em;
        padding: 14px 12px;
        background: #764ba2;
        color: white;
    }

    #chat-popup::after {
        border-top-color: #764ba2;
    }
}