/* Define la fuente Inter como predeterminada y el fondo principal */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f7f9fb;
    /* Fondo muy claro y profesional */
}

/* Color principal de la marca (un azul/verde suave) */
.btn-primary {
    background-color: #10b981;
    /* Emerald 600 */
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #059669;
    /* Emerald 700 */
}

/* Estilo para el input de fecha */
#date-selector {
    border-color: #10b981;
    padding: 0.75rem;
    border-radius: 0.5rem;
    width: 100%;
}

/* Estilo para el contenedor del mapa */
.map-container {
    overflow: hidden;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    position: relative;
    height: 0;
    border-radius: 0.75rem;
    /* rounded-xl */
}

.map-container iframe {
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    position: absolute;
}

/* --- Estilos del Modal/Lightbox --- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    /* Fondo oscuro semi-transparente */
    display: none;
    /* Oculto por defecto */
    justify-content: center;
    align-items: center;
    z-index: 50;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.modal-content img {
    display: block;
    width: auto;
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
    border-radius: 0.5rem;
}

.close-button {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 51;
    line-height: 1;
    transition: color 0.2s;
}

.close-button:hover {
    color: #ccc;
}

/* --- Booking System Styles --- */

/* Step Indicator */
.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.step-circle {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.125rem;
    transition: all 0.3s ease;
}

.step-indicator.active .step-circle {
    background-color: #10b981;
    color: white;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.3);
    transform: scale(1.1);
}

.step-indicator.completed .step-circle {
    background-color: #34d399;
    color: white;
}

.step-label {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
    text-align: center;
}

.step-indicator.active .step-label {
    color: #10b981;
    font-weight: 700;
}

.step-line {
    flex: 1;
    height: 2px;
    background-color: #e5e7eb;
    margin: 0 0.5rem;
    align-self: center;
    margin-top: -1.5rem;
}

.step-indicator.completed~.step-line {
    background-color: #34d399;
}

/* Booking Steps */
.booking-step {
    display: none;
    animation: fadeIn 0.4s ease-in-out;
}

.booking-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Specialty Cards */
.specialty-card {
    padding: 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    background: white;
}

.specialty-card:hover {
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    transform: translateY(-4px);
}

.specialty-card.selected {
    border-color: #10b981;
    background-color: #f0fdf4;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.specialty-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.specialty-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
}

.specialty-count {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Specialist Cards */
.specialist-card {
    padding: 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    display: flex;
    gap: 1rem;
}

.specialist-card:hover {
    border-color: #10b981;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    transform: translateY(-2px);
}

.specialist-card.selected {
    border-color: #10b981;
    background-color: #f0fdf4;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.specialist-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e5e7eb;
}

.specialist-card.selected .specialist-photo {
    border-color: #10b981;
}

.specialist-info {
    flex: 1;
}

.specialist-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.specialist-description {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.specialist-modalidad {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    background-color: #dbeafe;
    color: #1e40af;
    border-radius: 9999px;
    font-weight: 600;
}

/* Time Slots */
.time-slot {
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 600;
    background: white;
}

.time-slot:hover:not(.booked) {
    border-color: #10b981;
    background-color: #f0fdf4;
    transform: scale(1.05);
}

.time-slot.selected {
    border-color: #10b981;
    background-color: #10b981;
    color: white;
}

.time-slot.booked {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .step-label {
        font-size: 0.75rem;
    }

    .step-circle {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1rem;
    }

    .specialist-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* --- Chatbot Styles --- */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

/* Toggle Button (Floating) */
.chat-toggle {
    width: 60px;
    height: 60px;
    background-color: #10b981;
    /* kmina-main */
    color: white;
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.chat-toggle:hover {
    transform: scale(1.1);
    background-color: #059669;
}

.chat-toggle.active {
    transform: rotate(90deg) scale(0);
    /* Hide button when open */
}

.chat-notification-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background-color: #ef4444;
    border-radius: 50%;
    border: 2px solid white;
    display: none;
    animation: pulse 2s infinite;
}

.chat-notification-dot.visible {
    display: block;
}

/* Chat Window */
.chat-window {
    width: 350px;
    height: 500px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    bottom: 80px;
    /* Above the button */
    right: 0;
    transform-origin: bottom right;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.chat-window.hidden {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    pointer-events: none;
}

.chat-window.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Header */
.chat-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: white;
    padding: 2px;
}

.chat-title {
    font-weight: 700;
    font-size: 16px;
    display: block;
}

.chat-status {
    font-size: 11px;
    opacity: 0.9;
    display: block;
    color: #e6fffa;
}

.chat-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0 5px;
}

.chat-close-btn:hover {
    opacity: 0.8;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
}

.chat-message.bot {
    background-color: white;
    color: #1f2937;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.chat-message.user {
    background-color: #10b981;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-time {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 4px;
    text-align: right;
}

.chat-message.user .message-time {
    display: none;
    /* Hide time for user to be cleaner */
}

/* Options Area */
.chat-options-container {
    padding: 15px;
    background-color: white;
    border-top: 1px solid #f3f4f6;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
}

.chat-option-btn {
    background-color: white;
    border: 1px solid #10b981;
    color: #10b981;
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-option-btn:hover {
    background-color: #10b981;
    color: white;
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .chat-window {
        width: 100%;
        /* Full width on mobile */
        height: 100%;
        max-height: 100%;
        /* Cover specific container */
        bottom: 0px;
        right: 0;
        border-radius: 0;
        position: fixed;
        z-index: 1001;
    }

    .chatbot-container {
        /* When open, take full screen but allow interaction below if hidden */
        bottom: 0;
        right: 0;
        /* width: 100%; height: 100%; handled by child */
    }

    .chat-toggle {
        bottom: 20px;
        right: 20px;
        position: fixed;
    }
}