/**
 * CALVIA Premium AI Concierge - Styles
 * Luxury Chatbot Widget
 */

/* ═══════════════════════════════════════════════════════════════════════════
   CHAT WIDGET CONTAINER
   ═══════════════════════════════════════════════════════════════════════════ */

.chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CHAT TOGGLE BUTTON
   ═══════════════════════════════════════════════════════════════════════════ */

.chat-toggle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #b8860b 0%, #9a7516 100%);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(184, 134, 11, 0.4),
                0 0 0 0 rgba(184, 134, 11, 0.4);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    animation: pulseGlow 3s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(184, 134, 11, 0.4),
                    0 0 0 0 rgba(184, 134, 11, 0.4);
    }
    50% {
        box-shadow: 0 8px 32px rgba(184, 134, 11, 0.5),
                    0 0 0 12px rgba(184, 134, 11, 0);
    }
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(184, 134, 11, 0.5);
}

.chat-toggle svg {
    width: 28px;
    height: 28px;
    color: white;
    transition: all 0.3s ease;
}

.chat-icon-close {
    display: none;
}

.chat-widget.open .chat-icon-open {
    display: none;
}

.chat-widget.open .chat-icon-close {
    display: block;
}

.chat-widget.open .chat-toggle {
    animation: none;
}

/* Badge */
.chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 24px;
    height: 24px;
    background: #dc2626;
    color: white;
    font-size: 12px;
    font-weight: 600;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    animation: bounceIn 0.5s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   CHAT WINDOW
   ═══════════════════════════════════════════════════════════════════════════ */

.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    max-width: calc(100vw - 48px);
    height: 600px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25),
                0 0 0 1px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.chat-widget.open .chat-window {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   CHAT HEADER
   ═══════════════════════════════════════════════════════════════════════════ */

.chat-header {
    padding: 20px;
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(184, 134, 11, 0.2);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #b8860b 0%, #9a7516 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-avatar svg {
    width: 26px;
    height: 26px;
    color: white;
}

.chat-header-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-name {
    color: white;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.chat-minimize {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-minimize:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-minimize svg {
    width: 18px;
    height: 18px;
    color: white;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CHAT MESSAGES
   ═══════════════════════════════════════════════════════════════════════════ */

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: #fafaf9;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 3px;
}

/* Welcome Message */
.chat-welcome {
    text-align: center;
    padding: 24px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.welcome-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, rgba(184, 134, 11, 0.1) 0%, rgba(184, 134, 11, 0.05) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-icon svg {
    width: 32px;
    height: 32px;
    color: #b8860b;
}

.chat-welcome h4 {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
    font-family: 'Cormorant Garamond', Georgia, serif;
}

.chat-welcome p {
    font-size: 14px;
    color: #6b6b6b;
    line-height: 1.5;
}

/* Messages */
.chat-message {
    display: flex;
    animation: messageIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.bot {
    justify-content: flex-start;
}

.message-content {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 18px;
    position: relative;
}

.chat-message.user .message-content {
    background: linear-gradient(135deg, #b8860b 0%, #9a7516 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.bot .message-content {
    background: white;
    color: #1a1a1a;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.message-content p {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.message-content a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.chat-message.bot .message-content a {
    color: #b8860b;
}

.message-time {
    display: block;
    font-size: 10px;
    margin-top: 6px;
    opacity: 0.6;
}

/* Typing Indicator */
.typing-dots {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #b8860b;
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   QUICK ACTIONS
   ═══════════════════════════════════════════════════════════════════════════ */

.chat-quick-actions {
    padding: 12px 20px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    background: #fafaf9;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.quick-action {
    padding: 10px 14px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: #1a1a1a;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.quick-action:hover {
    border-color: #b8860b;
    color: #b8860b;
    background: rgba(184, 134, 11, 0.05);
}

.quick-action svg {
    width: 14px;
    height: 14px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   CHAT INPUT
   ═══════════════════════════════════════════════════════════════════════════ */

.chat-input-container {
    padding: 16px 20px;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.chat-input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: #f5f5f4;
    border-radius: 24px;
    padding: 8px 8px 8px 20px;
    transition: all 0.3s ease;
}

.chat-input-wrapper:focus-within {
    background: #f0f0ef;
    box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.2);
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    color: #1a1a1a;
    resize: none;
    max-height: 120px;
    line-height: 1.5;
    padding: 8px 0;
}

.chat-input::placeholder {
    color: #a3a3a3;
}

.chat-input:focus {
    outline: none;
}

.chat-send {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #b8860b 0%, #9a7516 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chat-send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.4);
}

.chat-send svg {
    width: 18px;
    height: 18px;
    color: white;
    transform: translateX(1px);
}

.chat-powered {
    display: block;
    text-align: center;
    font-size: 10px;
    color: #a3a3a3;
    margin-top: 8px;
    letter-spacing: 0.05em;
}

/* ═══════════════════════════════════════════════════════════════════════════
   VIEWING SCHEDULER
   ═══════════════════════════════════════════════════════════════════════════ */

.viewing-scheduler {
    background: white !important;
    padding: 20px !important;
}

.viewing-scheduler h5 {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 16px;
}

.scheduler-dates {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.scheduler-date {
    flex: 1;
    padding: 12px 8px;
    background: #f5f5f4;
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

.scheduler-date:hover {
    border-color: rgba(184, 134, 11, 0.3);
}

.scheduler-date.selected {
    border-color: #b8860b;
    background: rgba(184, 134, 11, 0.1);
}

.date-day {
    display: block;
    font-size: 11px;
    color: #6b6b6b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.date-num {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-top: 2px;
}

.scheduler-times {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.scheduler-time {
    padding: 10px 16px;
    background: #f5f5f4;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.scheduler-time:hover {
    border-color: rgba(184, 134, 11, 0.3);
}

.scheduler-time.selected {
    border-color: #b8860b;
    background: rgba(184, 134, 11, 0.1);
    color: #b8860b;
}

.scheduler-confirm {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scheduler-input {
    padding: 12px 16px;
    background: #f5f5f4;
    border: 1px solid transparent;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.3s ease;
}

.scheduler-input:focus {
    outline: none;
    border-color: #b8860b;
    background: white;
}

.scheduler-submit {
    padding: 14px 20px;
    background: linear-gradient(135deg, #b8860b 0%, #9a7516 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.scheduler-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.4);
}

/* ═══════════════════════════════════════════════════════════════════════════
   MOBILE RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
    .chat-widget {
        bottom: 16px;
        right: 16px;
    }

    .chat-toggle {
        width: 56px;
        height: 56px;
    }

    .chat-toggle svg {
        width: 24px;
        height: 24px;
    }

    .chat-window {
        width: calc(100vw - 32px);
        height: calc(100vh - 100px);
        height: calc(100dvh - 100px);
        bottom: 72px;
        right: -8px;
        border-radius: 16px;
    }

    .chat-header {
        padding: 16px;
    }

    .chat-messages {
        padding: 16px;
    }

    .chat-quick-actions {
        padding: 10px 16px;
    }

    .quick-action {
        padding: 8px 12px;
        font-size: 11px;
    }

    .chat-input-container {
        padding: 12px 16px;
    }

    .scheduler-dates {
        flex-direction: row;
    }

    .scheduler-date {
        padding: 10px 6px;
    }

    .date-num {
        font-size: 12px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   DARK MODE SUPPORT (Optional)
   ═══════════════════════════════════════════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
    /* Add dark mode styles if needed */
}
