/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

/*IMG chat avatar Logo*/
.chat-avatar {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    overflow: hidden; /* IMPORTANTE: garante que a imagem fique recortada no círculo */
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* evita distorção */
    border-radius: 50%; /* garante formato circular mesmo dentro do container */
}


.chat-title h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.chat-title p {
    font-size: 14px;
    opacity: 0.9;
    font-weight: 400;
}

/* Chat Container */
.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--background-light);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-track {
    background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

/* Messages */
.message {
    display: flex;
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-message {
    justify-content: flex-start;
}

.user-message {
    justify-content: flex-end;
}

.message-content {
    max-width: 85%;
    padding: 16px 20px;
    border-radius: 20px;
    position: relative;
    box-shadow: var(--shadow);
}

.bot-message .message-content {
    background: var(--background-white);
    color: var(--text-dark);
    border-bottom-left-radius: 8px;
}

.user-message .message-content {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 8px;
}

.message-content p {
    margin-bottom: 8px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

/* Option Buttons */
.option-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.option-btn {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 12px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 14px;
}

.option-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(4px);
}

/* Service Cards */
.service-card {
    background: var(--background-light);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 16px;
    margin: 8px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.service-card:hover {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.service-card.selected {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.1);
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.service-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-dark);
}

.service-price {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 16px;
}

.service-duration {
    font-size: 14px;
    color: var(--text-gray);
}

/* Professional Cards - Layout Horizontal */
.professional-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--background-light);
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 16px;
    margin: 8px 0;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.professional-card:hover {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.professional-card.selected {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.1);
}

/* Foto do Profissional */
.professional-photo {
    flex-shrink: 0;
}

.professional-photo img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

/* Informações do Profissional */
.professional-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.professional-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-dark);
}

.professional-specialty {
    font-size: 14px;
    color: var(--text-gray);
}

/* Responsivo para telas menores */
@media (max-width: 480px) {
    .professional-photo img {
        width: 50px;
        height: 50px;
    }
    
    .professional-name {
        font-size: 15px;
    }
    
    .professional-specialty {
        font-size: 13px;
    }
}

/* Calendar */
.calendar-container {
    margin: 16px 0;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.calendar-nav {
    background: var(--background-light);
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.calendar-nav:hover {
    background: var(--border-color);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 16px;
}

.calendar-day {
    aspect-ratio: 1;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    background: var(--background-white);
    color: var(--text-dark);
}

.calendar-day:hover {
    background: var(--primary-color);
    color: white;
}

.calendar-day.disabled {
    background: var(--background-light);
    color: var(--text-gray);
    cursor: not-allowed;
}

.calendar-day.selected {
    background: var(--primary-color);
    color: white;
}

.calendar-day.today {
    border: 2px solid var(--primary-color);
}

/* Time Slots */
.time-slots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
    margin-top: 16px;
}

.time-slot {
    padding: 12px 8px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    background: var(--background-white);
    color: var(--text-dark);
}

.time-slot:hover {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.time-slot.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.time-slot.disabled {
    background: var(--background-light);
    color: var(--text-gray);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Chat Input */
.chat-input {
    padding: 20px;
    background: var(--background-white);
    border-top: 1px solid var(--border-color);
}

.input-group {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

#userInput {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    transition: all 0.3s ease;
}

#userInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

#sendBtn {
    width: 44px;
    height: 44px;
    background: var(--primary-color);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

#sendBtn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

#sendBtn:disabled {
    background: var(--text-gray);
    cursor: not-allowed;
    transform: none;
}

/* Summary */
.booking-summary {
    background: rgba(79, 70, 229, 0.05);
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(79, 70, 229, 0.1);
}

.summary-item:last-child {
    border-bottom: none;
    font-weight: 600;
    font-size: 16px;
}

.summary-label {
    color: var(--text-gray);
    font-size: 14px;
}

.summary-value {
    color: var(--text-dark);
    font-weight: 500;
}

/* Success Message */
.success-message {
    text-align: center;
    padding: 32px 20px;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 40px;
    color: white;
    animation: successPulse 2s infinite;
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.success-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.success-subtitle {
    font-size: 16px;
    color: var(--text-gray);
    margin-bottom: 24px;
}

/* Error Message */
.error-message {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 8px;
    margin: 8px 0;
    font-size: 14px;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    background: var(--background-white);
    border-radius: 20px;
    border-bottom-left-radius: 8px;
    box-shadow: var(--shadow);
    max-width: 85%;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: var(--text-gray);
    border-radius: 50%;
    animation: typingDots 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingDots {
    0%, 80%, 100% { opacity: 0.3; }
    40% { opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .chat-header {
        padding: 16px;
    }
    
    .chat-container {
        padding: 16px;
    }
    
    .message-content {
        max-width: 90%;
        padding: 12px 16px;
    }
    
    .time-slots {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .calendar-grid {
        gap: 2px;
    }
    
    .chat-input {
        padding: 16px;
    }

    /* Botoes de time slots */
    .time-slot:hover {
        border-color: var(--primary-color);
        background: rgba(79, 70, 229, 0.05);
        transform: translateY(-1px);
    }

    .time-slot:active {
        transform: translateY(0);
    }

    .time-slots {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 8px;
        margin-top: 16px;
        max-height: 200px;
        overflow-y: auto;
    }

    .time-slots::-webkit-scrollbar {
        width: 6px;
    }

    .time-slots::-webkit-scrollbar-track {
        background: var(--background-light);
    }

    .time-slots::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 3px;
    }
}