/* Property Inspection Chatbot Widget Styles */

.pic-widget-container {
    position: fixed;
    bottom: 24px;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.pic-widget-container.pic-position-right {
    right: 24px;
}

.pic-widget-container.pic-position-left {
    left: 24px;
}

/* Chat Bubble */
.pic-chat-bubble {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    position: relative;
    animation: pic-bounceIn 0.6s ease-out;
}

@keyframes pic-bounceIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.pic-chat-bubble:hover {
    transform: scale(1.1);
}

.pic-chat-bubble.pic-hidden {
    display: none;
}

.pic-chat-bubble svg {
    width: 28px;
    height: 28px;
    fill: white;
}

/* Greeting Popup */
.pic-greeting-popup {
    position: absolute;
    bottom: 80px;
    background: white;
    padding: 16px 20px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 300px;
    animation: pic-slideIn 0.4s ease-out 1s both;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pic-position-right .pic-greeting-popup {
    right: 0;
}

.pic-position-left .pic-greeting-popup {
    left: 0;
}

.pic-greeting-popup:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 45px rgba(0, 0, 0, 0.25);
}

@keyframes pic-slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pic-greeting-popup::after {
    content: '';
    position: absolute;
    bottom: -8px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid white;
}

.pic-position-right .pic-greeting-popup::after {
    right: 24px;
}

.pic-position-left .pic-greeting-popup::after {
    left: 24px;
}

.pic-greeting-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #e5e7eb;
}

.pic-greeting-content {
    flex: 1;
    min-width: 0;
}

.pic-greeting-text {
    font-size: 14px;
    color: #1f2937;
    margin: 0;
    line-height: 1.4;
}

.pic-close-greeting {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: background 0.2s;
    flex-shrink: 0;
}

.pic-close-greeting:hover {
    background: #f3f4f6;
    color: #6b7280;
}

/* Chat Window */
.pic-chat-window {
    position: fixed;
    bottom: 24px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 600px;
    max-height: calc(100vh - 48px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.8) translateY(20px);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000000;
}

.pic-position-right .pic-chat-window {
    right: 24px;
}

.pic-position-left .pic-chat-window {
    left: 24px;
}

.pic-chat-window.pic-open {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: all;
}

/* Chat Header */
.pic-chat-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
}

.pic-chat-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

.pic-agent-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pic-agent-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.pic-agent-details {
    color: white;
}

.pic-agent-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
}

.pic-agent-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pic-status-indicator {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pic-pulse 2s infinite;
}

@keyframes pic-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.pic-close-chat {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
	padding:10px;
}

.pic-close-chat svg {
    width: 24px;
    height: 24px;
    stroke: white;
    stroke-width: 2.5;
}

.pic-close-chat:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Messages */
.pic-chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: linear-gradient(to bottom, #f8fafc 0%, #f1f5f9 100%);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pic-message {
    max-width: 85%;
    animation: pic-messageIn 0.3s ease-out;
}

@keyframes pic-messageIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pic-message-user {
    align-self: flex-end;
}

.pic-message-assistant {
    align-self: flex-start;
    display: flex;
    gap: 8px;
}

.pic-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.pic-message-content {
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 14px;
}

.pic-message-user .pic-message-content {
    border-bottom-right-radius: 4px;
    color: white;
}

.pic-message-assistant .pic-message-content {
    background: white;
    color: #1f2937;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Markdown Styles */
.pic-message-content h1,
.pic-message-content h2,
.pic-message-content h3 {
    margin-top: 0.75rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.pic-message-content h1 { font-size: 1.25rem; }
.pic-message-content h2 { font-size: 1.1rem; }
.pic-message-content h3 { font-size: 1rem; }

.pic-message-content p {
    margin: 0.5rem 0;
}

.pic-message-content p:first-child {
    margin-top: 0;
}

.pic-message-content p:last-child {
    margin-bottom: 0;
}

.pic-message-content ul,
.pic-message-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.pic-message-content li {
    margin: 0.25rem 0;
}

.pic-message-content strong {
    font-weight: 600;
}

.pic-message-content code {
    background: #e5e7eb;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
}

.pic-message-content a {
    color: #667eea;
    text-decoration: underline;
}

/* Typing Indicator */
.pic-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.pic-typing-dot {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: pic-typing 1.4s infinite;
}

.pic-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.pic-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pic-typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.6;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* Streaming Cursor */
@keyframes pic-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.pic-cursor {
    opacity: 0.7;
    animation: pic-blink 1s infinite;
}

/* End Chat Container */
.pic-end-chat-container {
    display: none;
    text-align: center;
    padding: 8px 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.pic-end-chat-container.pic-visible {
    display: block;
}

.pic-end-chat-button {
    padding: 6px 16px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.pic-end-chat-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Chat Input */
.pic-chat-input-container {
    padding: 16px;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 10px;
}

.pic-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.pic-chat-input:focus {
    border-color: #667eea;
}

.pic-send-button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    flex-shrink: 0;
}

.pic-send-button:hover {
    transform: scale(1.05);
}

.pic-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.pic-send-button svg {
    width: 20px;
    height: 20px;
    fill: white;
}

/* Visitor Form */
.pic-visitor-form,
.pic-booking-form {
    padding: 20px;
    background: white;
    border-top: 1px solid #e5e7eb;
    max-height: 400px;
    overflow-y: auto;
}

.pic-visitor-form h3,
.pic-booking-form h3 {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.pic-form-intro {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

.pic-form-field {
    margin-bottom: 14px;
}

.pic-form-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.pic-form-field input,
.pic-form-field select,
.pic-form-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}

.pic-form-field input:focus,
.pic-form-field select:focus,
.pic-form-field textarea:focus {
    outline: none;
    border-color: #667eea;
}

.pic-form-field .required {
    color: #ef4444;
}

.pic-form-field textarea {
    resize: vertical;
    min-height: 60px;
}

.pic-form-submit {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
	border:none!important;
	color:#fff!important;
}

.pic-form-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.pic-form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.pic-form-skip {
    display: block;
    text-align: center;
    margin-top: 12px;
    color: #6b7280;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
}

.pic-form-skip:hover {
    color: #374151;
}

/* Booking Trigger Button */
.pic-booking-trigger {
    padding: 6px 14px;
    border: none;
    border-radius: 20px;
    color: white;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 8px;
}

.pic-booking-trigger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Inactivity Modal */
.pic-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000001;
}

.pic-modal-overlay.pic-visible {
    display: block;
}

.pic-inactivity-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1000002;
    max-width: 360px;
    text-align: center;
}

.pic-inactivity-modal.pic-visible {
    display: block;
}

.pic-inactivity-modal h3 {
    font-size: 20px;
    margin: 0 0 12px 0;
    color: #1f2937;
}

.pic-inactivity-modal p {
    color: #6b7280;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.pic-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.pic-modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pic-modal-btn-primary {
    color: white;
}

.pic-modal-btn-danger {
    background: #ef4444;
    color: white;
}

.pic-modal-btn:hover {
    transform: translateY(-1px);
}

/* ==========================================
   BOOKING PANEL (IFRAME SLIDE)
   ========================================== */

.pic-booking-panel {
    position: fixed;
    bottom: 24px;
    width: 700px;
    height: 600px;
    min-width: 320px;
    min-height: 400px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 48px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateX(100%);
    pointer-events: none;
    transition: opacity 0.4s, transform 0.4s;
    z-index: 1000001;
    resize: both;
}

.pic-position-right .pic-booking-panel {
    right: 420px; /* Position to the left of chat window */
}

.pic-position-left .pic-booking-panel {
    left: 420px; /* Position to the right of chat window */
}

.pic-booking-panel.pic-open {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.pic-booking-header {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    font-weight: 600;
    font-size: 15px;
}

.pic-close-booking {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
	padding:10px;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.pic-close-booking svg {
    width: 24px;
    height: 24px;
    stroke: white;
    stroke-width: 2.5;
}

.pic-close-booking:hover {
    background: rgba(255, 255, 255, 0.3);
}

.pic-booking-panel iframe {
    flex: 1;
    width: 100%;
    border: none;
    background: #f8fafc;
}

/* Responsive - Tablet */
@media (max-width: 900px) {
    .pic-booking-panel {
        width: calc(100vw - 32px);
        left: 16px !important;
        right: 16px !important;
        max-width: none;
    }
}

/* Responsive - Mobile */
@media (max-width: 480px) {
    .pic-chat-window {
        width: calc(100vw - 20px);
        max-width: none;
        height: calc(100vh - 200px);
        bottom: 80px;
        border-radius: 12px;
    }
    
    .pic-position-right .pic-chat-window {
        right: 10px;
    }
    
    .pic-position-left .pic-chat-window {
        left: 10px;
    }
    
    .pic-booking-panel {
        width: calc(100vw - 20px);
        height: calc(100vh - 200px);
        bottom: 10px;
        left: 10px !important;
        right: 10px !important;
        border-radius: 12px;
        resize: none;
        min-width: auto;
    }
    
    .pic-greeting-popup {
        width: calc(100vw - 100px);
        max-width: 280px;
    }
    
    .pic-widget-container {
        bottom: 16px;
    }
    
    .pic-position-right.pic-widget-container {
        right: 16px;
    }
    
    .pic-position-left.pic-widget-container {
        left: 16px;
    }
    
    .pic-chat-header {
        padding: 12px 16px;
    }
    
    .pic-agent-avatar {
        width: 36px;
        height: 36px;
    }
    
    .pic-agent-name {
        font-size: 14px;
    }
}
