/* ==================== HANAMI CHAT FORM STYLES ==================== */

/* Variables */
:root {
    --hanami-primary: #BB2222;
    --hanami-primary-light: #e85555;
    --hanami-primary-dark: #8a1a1a;
    --hanami-bg: #faf9f7;
    --hanami-card: #ffffff;
    --hanami-text: #1f2937;
    --hanami-text-light: #6b7280;
    --hanami-border: #e5e7eb;
}

/* Container */
#hanamiChatContainer {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 650px;
    max-height: 90vh;
    background: var(--hanami-bg);
    border-radius: 24px;
    overflow: hidden;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Header */
.hanami-chat-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #ffffff;
    border-bottom: 1px solid var(--hanami-border);
    position: relative;
}

.hanami-chat-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--hanami-primary);
}

.hanami-chat-header span {
    font-size: 24px;
    margin-right: 8px;
}

/* Messages Container */
#hanamiChatMessages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}

/* Message Bubbles */
.hanami-chat-message {
    display: flex;
    max-width: 85%;
    animation: fadeInUp 0.3s ease;
}

.hanami-chat-message.bot {
    align-self: flex-start;
}

.hanami-chat-message.user {
    align-self: flex-end;
}

.hanami-chat-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
}

.hanami-chat-message.bot .hanami-chat-bubble {
    background: var(--hanami-card);
    color: var(--hanami-text);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.hanami-chat-message.user .hanami-chat-bubble {
    background: var(--hanami-primary);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Typing Indicator */
.hanami-chat-typing {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: var(--hanami-card);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.hanami-chat-typing-dot {
    width: 8px;
    height: 8px;
    background: var(--hanami-primary-light);
    border-radius: 50%;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.hanami-chat-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.hanami-chat-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

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

/* Input Area */
#hanamiChatInputArea {
    padding: 16px 20px 20px;
    background: var(--hanami-card);
    border-top: 1px solid var(--hanami-border);
}

/* Buttons */
.hanami-chat-continue {
    width: 100%;
    padding: 14px 24px;
    background: var(--hanami-primary) !important;
    color: white !important;
    border: none !important;
    border-radius: 12px !important;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.hanami-chat-continue:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(187, 34, 34, 0.3);
    background: var(--hanami-primary-dark) !important;
}

.hanami-chat-continue:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.hanami-chat-continue svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

/* Counter */
.hanami-chat-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 20px;
    margin-bottom: 16px;
}

.hanami-chat-counter-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--hanami-primary);
    background: transparent;
    color: var(--hanami-primary);
    font-size: 22px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hanami-chat-counter-btn:hover:not(:disabled) {
    background: var(--hanami-primary);
    color: white;
}

.hanami-chat-counter-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.hanami-chat-counter-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
}

.hanami-chat-counter-value {
    font-size: 38px;
    font-weight: 700;
    color: var(--hanami-primary);
    line-height: 1;
}

.hanami-chat-counter-label {
    font-size: 14px;
    color: var(--hanami-text-light);
    text-align: center;
    margin-top: 4px;
}

/* Slider */
.hanami-chat-slider-wrapper {
    padding: 10px 0 20px;
}

.hanami-chat-slider-display {
    text-align: center;
    margin-bottom: 16px;
}

.hanami-chat-slider-value {
    font-size: 38px;
    font-weight: 700;
    color: var(--hanami-primary);
}

.hanami-chat-slider-label {
    font-size: 16px;
    color: var(--hanami-text);
}

.hanami-chat-slider-hint {
    font-size: 13px;
    color: var(--hanami-text-light);
    margin-top: 4px;
}

.hanami-chat-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--hanami-border);
    outline: none;
    -webkit-appearance: none;
    margin: 8px 0;
}

.hanami-chat-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--hanami-primary);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(190, 24, 93, 0.3);
}

.hanami-chat-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--hanami-primary);
    cursor: pointer;
    border: none;
}

.hanami-chat-slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--hanami-text-light);
}

/* Options */
.hanami-chat-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.hanami-chat-option {
    padding: 14px 18px;
    background: var(--hanami-bg);
    border: 2px solid var(--hanami-border);
    border-radius: 12px;
    font-size: 15px;
    color: var(--hanami-text);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.hanami-chat-option:hover {
    border-color: var(--hanami-primary);
    background: #fef7f7;
    color: var(--hanami-text);
}
}

.hanami-chat-option.selected {
    border-color: var(--hanami-primary);
    background: #fef7f7;
}

/* Detailed options */
.hanami-option-detailed {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hanami-option-title {
    font-weight: 600;
    color: var(--hanami-text);
}

.hanami-option-subtitle {
    font-size: 13px;
    color: var(--hanami-text-light);
}

/* Tipo Viaje Cards */
.hanami-tipo-viaje {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.hanami-viaje-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 14px 8px 12px;
    gap: 4px;
}

.hanami-viaje-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hanami-viaje-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.hanami-viaje-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--hanami-text);
    margin-top: 2px;
}

.hanami-viaje-desc {
    font-size: 10px;
    color: var(--hanami-text-light);
    line-height: 1.3;
}

/* Calendar Modal */
.hanami-calendar-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999999;
    padding: 20px;
}

.hanami-calendar-popup {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 340px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.hanami-calendar-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--hanami-border);
}

.hanami-calendar-popup-header span {
    font-weight: 600;
    font-size: 15px;
    color: var(--hanami-text);
}

.hanami-calendar-close {
    width: 32px;
    height: 32px;
    border: 1px solid var(--hanami-border) !important;
    background: white !important;
    font-size: 20px;
    color: var(--hanami-text-light) !important;
    cursor: pointer;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.hanami-calendar-close:hover {
    background: var(--hanami-bg) !important;
    color: var(--hanami-text) !important;
}

.hanami-calendar-content {
    padding: 16px 20px;
}

.hanami-calendar-nav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.hanami-calendar-title {
    font-weight: 600;
    font-size: 15px;
    color: var(--hanami-text);
}

.hanami-calendar-nav {
    width: 36px;
    height: 36px;
    border-radius: 50% !important;
    border: 1px solid var(--hanami-border) !important;
    background: white !important;
    cursor: pointer;
    font-size: 16px;
    color: var(--hanami-text) !important;
    transition: all 0.2s ease;
}

.hanami-calendar-nav:hover:not(:disabled) {
    border-color: var(--hanami-primary) !important;
    color: var(--hanami-primary) !important;
    background: white !important;
}

.hanami-calendar-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.hanami-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
}

.hanami-calendar-weekdays span {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--hanami-text-light);
    padding: 8px 4px;
}

.hanami-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.hanami-calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--hanami-text);
}

.hanami-calendar-day:not(.disabled):not(.empty):hover {
    background: rgba(187, 34, 34, 0.15);
}

.hanami-calendar-day.selected {
    background: var(--hanami-primary);
    color: white;
}

.hanami-calendar-day.in-range {
    background: rgba(187, 34, 34, 0.1);
    color: var(--hanami-primary-dark);
    border-radius: 4px;
}

.hanami-calendar-day.disabled {
    color: #d1d5db;
    cursor: not-allowed;
}

.hanami-calendar-day.empty {
    cursor: default;
}

.hanami-calendar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--hanami-border);
}

.hanami-calendar-confirm {
    width: 100%;
    padding: 14px;
    background: var(--hanami-primary) !important;
    color: white !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hanami-calendar-confirm:hover:not(:disabled) {
    background: var(--hanami-primary-dark) !important;
}

.hanami-calendar-confirm:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Meses Grid */
.hanami-chat-meses-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.hanami-mes-btn {
    padding: 10px 8px;
    background: var(--hanami-bg);
    border: 2px solid var(--hanami-border);
    border-radius: 8px;
    font-size: 13px;
    color: var(--hanami-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.hanami-mes-btn:hover {
    border-color: var(--hanami-primary);
}

.hanami-mes-btn.selected {
    background: var(--hanami-primary);
    border-color: var(--hanami-primary);
    color: white;
}

.hanami-meses-hint {
    font-size: 12px;
    color: var(--hanami-text-light);
    text-align: center;
    margin: 8px 0 16px;
}

/* Email Input */
.hanami-chat-email-wrapper {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.hanami-chat-email {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid var(--hanami-border);
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: all 0.2s ease;
}

.hanami-chat-email:focus {
    border-color: var(--hanami-primary);
}

.hanami-chat-email.error {
    border-color: #ef4444;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.hanami-chat-send {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: none;
    background: var(--hanami-primary);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.hanami-chat-send:hover {
    background: var(--hanami-primary-dark);
}

.hanami-chat-send svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.hanami-email-hint {
    font-size: 12px;
    color: var(--hanami-text-light);
    text-align: center;
    margin: 0;
}

/* Loading */
.hanami-chat-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
}

.hanami-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--hanami-border);
    border-top-color: var(--hanami-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.hanami-chat-loading p {
    font-size: 14px;
    color: var(--hanami-text-light);
    margin: 0;
}

/* Success */
.hanami-chat-success {
    text-align: center;
    padding: 20px;
}

.hanami-success-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.hanami-chat-success p {
    font-size: 16px;
    font-weight: 600;
    color: var(--hanami-text);
    margin: 0;
}

.hanami-success-hint {
    font-size: 13px !important;
    font-weight: 400 !important;
    color: var(--hanami-text-light) !important;
    margin-top: 8px !important;
}

/* Error */
.hanami-chat-error {
    text-align: center;
    padding: 20px;
}

.hanami-chat-error p {
    font-size: 14px;
    color: var(--hanami-text);
    margin: 0 0 16px;
}

/* Modal */
#hanamiChatModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

#hanamiChatModal.active {
    display: flex;
}

#hanamiChatClose {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000000;
}

body.hanami-modal-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 520px) {
    #hanamiChatContainer {
        border-radius: 0;
        height: 100vh;
        max-height: 100vh;
    }
    
    .hanami-tipo-viaje {
        grid-template-columns: 1fr 1fr;
    }
    
    .hanami-chat-meses-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
