/**
 * Custom Chat Widget Styles
 * Frangipani Queen - Live Chat System
 */

/* Header Actions Container */
.header-actions {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    z-index: 1000;
}

.phone-link,
.chat-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--green, #4caf50);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 50%;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
}

.phone-link:hover,
.chat-toggle:hover {
    background: var(--dark-green, #2e7d32);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.phone-link i,
.chat-toggle i {
    font-size: 1.2rem;
}

.phone-number {
    display: none;
}

/* Chat notification badge */
.chat-notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--magenta, #e91e63);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    border: 2px solid white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Chat Dropdown Panel */
.chat-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 1rem);
    width: 380px;
    max-height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1001;
}

.chat-dropdown.active {
    display: flex;
    animation: slideDown 0.3s ease;
}

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

.chat-header {
    background: linear-gradient(135deg, var(--primary-purple, #8b4598), var(--hot-purple, #c146a1));
    color: white;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    margin: 0;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

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

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    background: var(--cream, #fdf8f5);
    max-height: 400px;
}

.chat-message {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

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

.chat-message.admin {
    align-items: flex-start;
}

.message-bubble {
    max-width: 75%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    word-wrap: break-word;
}

.chat-message.user .message-bubble {
    background: var(--primary-purple, #8b4598);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-message.admin .message-bubble {
    background: white;
    color: var(--dark, #2c2c2c);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message-time {
    font-size: 0.7rem;
    color: var(--gray, #6b7280);
    margin-top: 0.25rem;
    padding: 0 0.5rem;
}

.message-sender {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-purple, #8b4598);
    margin-bottom: 0.25rem;
    padding: 0 0.5rem;
}

.chat-input-container {
    padding: 1rem;
    background: white;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 0.75rem;
}

.chat-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 24px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.chat-input:focus {
    border-color: var(--primary-purple, #8b4598);
}

.chat-send-btn {
    background: var(--primary-purple, #8b4598);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-send-btn:hover {
    background: var(--hot-purple, #c146a1);
    transform: scale(1.05);
}

.chat-send-btn:disabled {
    background: var(--gray, #6b7280);
    cursor: not-allowed;
    transform: none;
}

.chat-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--gray, #6b7280);
}

.chat-empty-state i {
    font-size: 3rem;
    color: var(--primary-purple, #8b4598);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.chat-empty-state p {
    margin: 0;
}

/* Floating Chat Widget */
.floating-chat {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 999;
}

.floating-chat-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary-purple, #8b4598), var(--hot-purple, #c146a1));
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(139, 69, 152, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.floating-chat-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(139, 69, 152, 0.6);
}

.floating-chat-notification {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--magenta, #e91e63);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
    border: 3px solid white;
    display: none;
}

.floating-chat-notification:not(:empty) {
    display: flex;
}

.floating-chat-panel {
    position: fixed;
    bottom: 100px;
    right: 2rem;
    width: 380px;
    max-height: 600px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 998;
}

.floating-chat-panel.active {
    display: flex;
    animation: slideUp 0.3s ease;
}

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

/* Mobile Navigation */
@media (max-width: 768px) {
    .header-actions {
        position: fixed;
        right: 1rem;
        top: 1rem;
        transform: none;
        gap: 0.5rem;
    }

    .phone-link,
    .chat-toggle {
        width: 44px;
        height: 44px;
    }

    .phone-link i,
    .chat-toggle i {
        font-size: 1.1rem;
    }

    .chat-dropdown {
        width: calc(100vw - 2rem);
        right: -1rem;
        max-height: calc(100vh - 120px);
    }

    .chat-messages {
        max-height: calc(100vh - 280px);
    }

    .floating-chat {
        bottom: 1rem;
        right: 1rem;
    }

    .floating-chat-btn {
        width: 56px;
        height: 56px;
        font-size: 1.3rem;
    }

    .floating-chat-panel {
        width: calc(100vw - 2rem);
        right: 1rem;
        bottom: 85px;
        max-height: calc(100vh - 150px);
    }

    .floating-chat-panel .chat-messages {
        max-height: calc(100vh - 350px);
    }
}
