/**
 * Public Landing Pages - Floating Buttons & Chat Support Styles
 */

/* ==================== FLOATING ACTION BUTTONS ==================== */
.public-floating-buttons {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1050;
}

.pub-fab-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    text-decoration: none;
    color: white;
}

.pub-fab-btn i {
    font-size: 24px;
    transition: transform 0.3s ease;
}

.pub-fab-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.pub-fab-btn:hover i {
    transform: scale(1.1);
}

/* WhatsApp Button */
.pub-fab-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
}

.pub-fab-whatsapp:hover {
    background: linear-gradient(135deg, #128C7E 0%, #075E54 100%);
    color: white;
}

/* Chat Support Button */
.pub-fab-chat {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    position: relative;
}

.pub-fab-chat:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
}

.pub-fab-chat.active {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.pub-fab-chat.active i::before {
    content: "\f00d"; /* Font Awesome times icon */
}

/* Pulse ring on chat button */
.pub-fab-pulse {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 14px;
    height: 14px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid #fff;
    animation: pulseRing 2s infinite;
}

.pub-fab-chat.active .pub-fab-pulse {
    display: none;
}

@keyframes pulseRing {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
    70% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Tooltip */
.pub-fab-tooltip {
    position: absolute;
    right: 68px;
    background: #1e293b;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
}

.pub-fab-tooltip::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #1e293b;
}

.pub-fab-btn:hover .pub-fab-tooltip {
    opacity: 1;
    visibility: visible;
    right: 72px;
}

/* ==================== CHAT MODAL ==================== */
.public-chat-modal {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 48px);
    height: 520px;
    max-height: calc(100vh - 140px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1051;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.public-chat-modal.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.chat-modal-header {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.chat-avatar {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.chat-avatar i {
    font-size: 20px;
}

.chat-avatar-pulse {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    background: #4ade80;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.chat-header-text h6 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-status {
    font-size: 12px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-status i {
    font-size: 8px;
    color: #4ade80;
}

.chat-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Body */
.chat-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Chat Messages */
.chat-message {
    display: flex;
    gap: 10px;
    max-width: 90%;
}

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

.chat-message.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    font-size: 14px;
}

.user-message .message-avatar,
.message-avatar.user-avatar {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.message-content {
    background: white;
    padding: 12px 16px;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.user-message .message-content {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
}

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

.message-content p + p {
    margin-top: 8px;
}

.message-content ul {
    margin: 8px 0 0 0;
    padding-left: 18px;
}

.message-content ul li {
    font-size: 13px;
    margin-bottom: 4px;
}

.quick-topics {
    background: #f1f5f9;
    padding: 10px 14px;
    border-radius: 8px;
    margin-top: 10px;
    list-style: none;
}

.quick-topics li {
    color: #475569;
    display: flex;
    align-items: center;
    gap: 8px;
}

.quick-topics li i {
    color: #6366f1;
    font-size: 12px;
    width: 16px;
    text-align: center;
}

/* Message Links */
.message-links {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chat-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chat-link-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    color: white;
}

/* Suggested Questions */
.suggested-questions {
    padding: 8px 0;
}

.suggestion-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-chip {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.suggestion-chip i {
    font-size: 11px;
    color: #6366f1;
    transition: color 0.2s;
}

.suggestion-chip:hover {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.suggestion-chip:hover i {
    color: white;
}

/* Typing Indicator */
.typing-indicator .message-content {
    padding: 14px 18px;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

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

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

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

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

/* Chat Footer */
.chat-modal-footer {
    padding: 12px 16px 8px;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.chat-footer-note {
    margin: 6px 0 0;
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
}

.chat-input-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.chat-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.chat-input::placeholder {
    color: #94a3b8;
}

.chat-send-btn {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.chat-send-btn i {
    font-size: 16px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 480px) {
    .public-floating-buttons {
        bottom: 16px;
        right: 16px;
    }

    .pub-fab-btn {
        width: 50px;
        height: 50px;
    }

    .pub-fab-btn i {
        font-size: 22px;
    }

    .pub-fab-tooltip {
        display: none;
    }

    .public-chat-modal {
        bottom: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
    }

    .public-chat-modal.active {
        border-radius: 0;
    }
}

@media (max-width: 768px) {
    .public-chat-modal {
        width: 340px;
        height: 480px;
    }
}

/* ==================== DARK MODE SUPPORT (Optional) ==================== */
@media (prefers-color-scheme: dark) {
    /* Keep light theme for chat modal for consistency */
}

/* ==================== SCROLLBAR STYLING ==================== */
.chat-modal-body::-webkit-scrollbar {
    width: 6px;
}

.chat-modal-body::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.chat-modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.chat-modal-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==================== ANIMATION ENTRANCE ==================== */
@keyframes fabEnter {
    from {
        opacity: 0;
        transform: scale(0.5) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.pub-fab-btn {
    animation: fabEnter 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.pub-fab-whatsapp {
    animation-delay: 0.1s;
}

.pub-fab-chat {
    animation-delay: 0.2s;
}
