/* Smart Message Renderer - Complete UI Overhaul */

.smart-message-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0;
}

/* Plain text message */
.smart-message-text {
    line-height: 1.6;
    color: #333;
    font-size: 15px;
    margin-bottom: 8px;  /* REDUCED from 20px */
}

.smart-message-text p {
    margin: 0 0 8px 0;  /* REDUCED from 10px */
}

/* Image boxes wrapper - positions boxes on left and right sides with absolute positioning */
.booking-image-boxes-wrapper {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.booking-image-box {
    width: 280px;
    height: 280px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    background: transparent;
    position: absolute;
    pointer-events: auto;
}

.booking-image-box:first-child {
    left: 3%;  /* Position left image at 3% from left edge for balanced spacing */
}

.booking-image-box:last-child {
    right: 3%;  /* Position right image at 3% from right edge for balanced spacing */
}

.booking-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Complete concierge UI container */
.concierge-ui-complete {
    display: flex;
    flex-direction: column;
    gap: 12px;  /* REDUCED from 30px */
    padding: 12px;  /* REDUCED from 20px */
    background: linear-gradient(135deg, #f9f7f4 0%, #f5f1ea 100%);
    border-radius: 12px;
    border-left: 5px solid #C41E3A;
    margin: 4px auto 4px auto;  /* REDUCED from 60px...20px */
    max-width: 700px;
    width: 90%;
}

/* Section headers */
.section-header {
    font-weight: 700;
    color: #333;
    font-size: 14px;  /* REDUCED from 16px */
    margin: 0 0 6px 0;  /* REDUCED from 15px */
    text-transform: uppercase;
    letter-spacing: 0.4px;  /* REDUCED from 0.5px */
}

/* ============================================
   WORKSHOP GRID SECTION
   ============================================ */
.workshop-grid-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.workshop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.workshop-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.workshop-card:hover {
    border-color: #C41E3A;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.15);
    transform: translateY(-2px);
}

.workshop-card.selected {
    background: linear-gradient(135deg, #fff7ed 0%, #ffe8d1 100%);
    border-color: #C41E3A;
    box-shadow: 0 4px 16px rgba(196, 30, 58, 0.3);
}

.workshop-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.emoji {
    font-size: 24px;
}

.workshop-header .name {
    font-weight: 700;
    color: #333;
    font-size: 14px;
    flex: 1;
}

.workshop-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.workshop-body .description {
    font-size: 13px;
    color: #666;
    margin: 0;
    line-height: 1.4;
}

.workshop-body .details {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: #999;
    flex-wrap: wrap;
}

.details .price {
    font-weight: 600;
    color: #c85a17;
    background: rgba(200, 90, 23, 0.08);
    padding: 2px 6px;
    border-radius: 3px;
}

.details .duration {
    color: #666;
}

.workshop-footer {
    display: flex;
    gap: 10px;
}

.learn-more-btn {
    flex: 1;
    padding: 10px 12px;
    background: white;
    border: 2px solid #C41E3A;
    border-radius: 6px;
    color: #7c2d12;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.workshop-card.selected .learn-more-btn {
    background: linear-gradient(135deg, #C41E3A 0%, #FF6B1A 100%);
    color: white;
    border-color: #C41E3A;
}

.learn-more-btn:hover {
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    transform: scale(1.02);
}

/* ============================================
   ORGANIZATION TYPE SECTION
   ============================================ */
.org-type-section {
    display: flex;
    flex-direction: column;
    gap: 8px;  /* REDUCED from 15px */
}

.org-type-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;  /* REDUCED from 15px */
}

.org-type-btn {
    padding: 10px;  /* REDUCED from 15px */
    background: white;
    border: 2px solid #0284c7;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;  /* REDUCED from 6px */
}

.org-type-btn:hover {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-color: #0284c7;
    transform: translateY(-2px);
}

.org-type-btn.selected {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    border-color: #0284c7;
    color: white;
}

.type-label {
    font-weight: 700;
    font-size: 13px;  /* REDUCED from 14px */
    color: #0c4a6e;
}

.org-type-btn.selected .type-label {
    color: white;
}

.type-desc {
    font-size: 11px;  /* REDUCED from 12px */
    color: #0369a1;
    font-weight: 500;
}

.org-type-btn.selected .type-desc {
    color: rgba(255, 255, 255, 0.9);
}

/* ============================================
   PARTICIPANT SECTION
   ============================================ */
.participant-section {
    display: flex;
    flex-direction: column;
    gap: 10px;  /* REDUCED from 15px */
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;  /* REDUCED from 20px */
    padding: 12px;  /* REDUCED from 15px */
    background: white;
    border-radius: 8px;
    border: 2px solid #16a34a;
}

.participant-slider {
    flex: 1;
    height: 6px;  /* REDUCED from 8px */
    border-radius: 4px;
    background: #d1fae5;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.participant-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;  /* REDUCED from 28px */
    height: 24px;  /* REDUCED from 28px */
    border-radius: 50%;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
    transition: all 0.2s ease;
}

.participant-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);  /* REDUCED from 1.15 */
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.5);
}

.participant-slider::-moz-range-thumb {
    width: 24px;  /* REDUCED from 28px */
    height: 24px;  /* REDUCED from 28px */
    border-radius: 50%;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
    transition: all 0.2s ease;
}

.participant-value-display {
    min-width: auto;
    width: 80px;  /* FIXED width for compact display */
    text-align: center;
    font-weight: 700;
    color: #15803d;
    font-size: 14px;  /* REDUCED from 16px */
    background: #f0fdf4;
    padding: 6px 8px;  /* REDUCED from 8px 12px */
    border-radius: 6px;
    border: 1px solid #bbf7d0;
}

/* Input field for manual entry */
.participant-value-input {
    width: 80px;
    padding: 6px 8px;
    font-size: 14px;
    font-weight: 700;
    color: #15803d;
    border: 2px solid #16a34a;
    border-radius: 6px;
    text-align: center;
    background: white;
    cursor: text;
    transition: all 0.2s ease;
}

.participant-value-input:focus {
    outline: none;
    border-color: #15803d;
    box-shadow: 0 0 8px rgba(22, 163, 74, 0.2);
}

.quick-select {
    display: flex;
    flex-direction: column;
    gap: 6px;  /* REDUCED from 10px */
}

.quick-label {
    font-weight: 600;
    color: #166534;
    font-size: 11px;  /* REDUCED from 12px */
    text-transform: uppercase;
    letter-spacing: 0.4px;  /* REDUCED from 0.5px */
}

.quick-buttons {
    display: flex;
    gap: 6px;  /* REDUCED from 10px */
    flex-wrap: wrap;
}

.quick-btn {
    padding: 8px 12px;  /* REDUCED from 10px 16px */
    background: white;
    border: 2px solid #16a34a;
    border-radius: 6px;
    font-weight: 600;
    color: #15803d;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;  /* REDUCED from 13px */
}

.quick-btn:hover {
    background: #dcfce7;
    transform: scale(1.03);  /* REDUCED from 1.05 */
}

.quick-btn:active {
    transform: scale(0.97);  /* REDUCED from 0.98 */
}

/* ============================================
   BOOKING SUMMARY SECTION
   ============================================ */
.booking-summary-section {
    padding: 15px;
    background: linear-gradient(135deg, #fef3c7 0%, #fef9e7 100%);
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
}

.booking-summary-section .section-header {
    color: #92400e;
}

.summary-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #f59e0b;
}

.summary-item .label {
    font-weight: 600;
    color: #92400e;
}

.summary-item .value {
    font-weight: 700;
    color: #333;
}

.summary-item.highlight {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9e7 100%);
    border-left-color: #f59e0b;
    border-left-width: 4px;
}

/* ============================================
   BOOKING BUTTON
   ============================================ */
.booking-button-container {
    display: flex;
    gap: 10px;
}

.proceed-booking-btn {
    flex: 1;
    padding: 14px 20px;
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.proceed-booking-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.4);
}

.proceed-booking-btn:active:not(:disabled) {
    transform: translateY(0);
}

.proceed-booking-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .concierge-ui-complete {
        gap: 20px;
        padding: 15px;
    }

    .workshop-grid {
        grid-template-columns: 1fr;
    }

    .org-type-buttons {
        grid-template-columns: 1fr;
    }

    .slider-container {
        flex-direction: column;
        gap: 15px;
    }

    .participant-value-display {
        width: 100%;
    }

    .quick-buttons {
        gap: 8px;
    }

    .quick-btn {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .workshop-grid {
        grid-template-columns: 1fr;
    }

    .quick-buttons {
        grid-template-columns: repeat(2, 1fr);
    }

    .proceeding-booking-btn {
        font-size: 13px;
        padding: 12px 16px;
    }
}

/* Booking logo image - clean styling without white border */
.booking-logo-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    padding: 0;
    background: transparent;
    display: block;
}

/* --- NEW STYLE FOR GUIDANCE TEXT (Guide, Not Gatherer) --- */
.ai-message .smart-message-text special.guide-action {
    color: #16a34a; /* A nice, accessible green */
    background-color: #e8f5e9; /* A very light green highlight */
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    border-bottom: 2px solid #15803d;
    cursor: default; /* Not clickable, just for emphasis */
}

.ai-message .smart-message-text special.guide-action:hover {
    /* Override the default special hover */
    background-color: #d1f0d4;
    transform: none;
}

/* ============================================
   ENHANCED PARTICIPANT SELECTOR (All Devices)
   ============================================ */

/* Number control row with - and + buttons */
.number-control-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 15px;
}

/* Decrement button (-) */
.participant-decrement-btn {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    border: 2px solid #16a34a;
    background: white;
    color: #15803d;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.participant-decrement-btn:hover {
    background: #f0fdf4;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.2);
}

.participant-decrement-btn:active {
    transform: scale(0.95);
}

/* Increment button (+) */
.participant-increment-btn {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    border: 2px solid #16a34a;
    background: #16a34a;
    color: white;
    font-size: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.participant-increment-btn:hover {
    background: #15803d;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

.participant-increment-btn:active {
    transform: scale(0.95);
}

/* =========================================== */
/* == 3D AI Message Logo                  == */
/* =========================================== */

.ai-message-logo-container {
    position: absolute;
    top: -25px;      /* Position it halfway above the bubble's top edge */
    left: -15px;     /* Position it slightly to the left of the bubble's corner */
    width: 50px;     /* The size of our 3D coin */
    height: 50px;    /* The size of our 3D coin */
    z-index: 10;     /* Ensure it sits on top */
    pointer-events: none; /* Make it non-interactive so clicks pass through */
}

.ai-message-logo-container canvas {
    display: block;
    width: 100% !important;  /* Force canvas to fill the container */
    height: 100% !important; /* Force canvas to fill the container */
}

/* Make sure the AI message bubble can contain the absolutely positioned logo */
.ai-message {
    position: relative; /* This is the anchor for the logo container */
    margin-top: 30px; /* Add top margin to make space for the logo */
}

/* =======================================================
   DEFINITIVE UI VISIBILITY CONTROL (v.FINAL)
   ======================================================= */

/*
  When the .ai-portal has the .module-active class (added by module-manager.js),
  HIDE SPECIFIC CHAT ELEMENTS, but KEEP THE PARENT .messages-container VISIBLE.

  CRITICAL: The .messages-container is the parent of BOTH:
  - #messages (chat bubbles) - HIDE THIS
  - #moduleContainer (Stripe form) - KEEP THIS VISIBLE

  Hiding the parent would hide the child module. This is the fatal mistake we're correcting.

  The !important flag ensures these rules override any other display properties.
*/

/* Hide the chat messages div (the bubbles) */
.ai-portal.module-active #messages {
    display: none !important;
}

/* Hide the typing indicator */
.ai-portal.module-active .typing-indicator {
    display: none !important;
}

/* Hide the schedule/workshop button container */
.ai-portal.module-active #schedule-workshop-container {
    display: none !important;
}

/* Hide the portal header (title bar) */
.ai-portal.module-active .portal-header {
    display: none !important;
}

/* Hide the input area (text input + send button) */
.ai-portal.module-active .input-area {
    display: none !important;
}

/* Hide floating booking images/boxes */
.ai-portal.module-active .booking-image-boxes-wrapper {
    display: none !important;
}

/*
   IMPORTANT: We DO NOT hide .messages-container itself, because
   it contains the #moduleContainer where the payment form lives.
   By being surgical with our selectors, the moduleContainer remains visible.
*/

/* =======================================================
   BOOKING FORM DISPLAY RULES
   ======================================================= */

/* Ensure booking form module is always visible */
.jarvis-module.booking-form-module {
    display: flex !important;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure booking form full section is visible with proper spacing */
.booking-form-full {
    display: flex !important;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Workshop and product details should be visible */
.booking-form-full > div {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Booking header styling */
.booking-header-minimal {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: white;
    border: 2px solid #E8DDD4;
    border-radius: 12px;
    margin-bottom: 20px;
}

.booking-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.booking-header-workshop {
    font-size: 20px;
    font-weight: 700;
    color: #4A4A4A;
}

.booking-header-subtext {
    font-size: 14px;
    color: #6B6B6B;
}

.booking-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.booking-header-price-label {
    font-size: 12px;
    color: #6B6B6B;
    font-weight: 500;
}

.booking-header-total {
    font-size: 28px;
    font-weight: 700;
    color: #C41E3A;
}
