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

.chat-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s;
    position: relative;
}

.chat-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(102, 126, 234, 0.5);
}

.chat-toggle-btn .unread-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    display: none;
}

.chat-box {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: 380px;
    height: 520px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: chatSlideUp 0.3s ease;
}

.chat-box.active {
    display: flex;
}

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

.chat-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-info h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.chat-header-info p {
    font-size: 12px;
    opacity: 0.85;
}

.chat-header-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.chat-header-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

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

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

.chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

.chat-msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-msg.visitor {
    align-self: flex-end;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-msg.admin {
    align-self: flex-start;
    background: white;
    color: #1a1a2e;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

.chat-msg .msg-time {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 4px;
    display: block;
}

.chat-msg.admin .msg-time {
    color: #6b7280;
}

.chat-typing {
    display: none;
    align-self: flex-start;
    padding: 10px 14px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    font-size: 13px;
    color: #6b7280;
}

.chat-typing.active {
    display: block;
}

.chat-typing-dots {
    display: inline-flex;
    gap: 3px;
    margin-left: 4px;
}

.chat-typing-dots span {
    width: 5px;
    height: 5px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typingBounce 1.4s infinite;
}

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

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

.chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    background: white;
}

.chat-input-area input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.chat-input-area input:focus {
    border-color: #667eea;
}

.chat-input-area button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.chat-input-area button:hover {
    transform: scale(1.05);
}

.chat-input-area button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Guest Info Form */
.chat-guest-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f8f9fb;
    flex: 1;
    justify-content: center;
}

.chat-guest-form h4 {
    font-size: 16px;
    color: #1a1a2e;
    text-align: center;
    margin-bottom: 4px;
}

.chat-guest-form p {
    font-size: 13px;
    color: #6b7280;
    text-align: center;
    margin-bottom: 8px;
}

.chat-guest-form input {
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.chat-guest-form input:focus {
    border-color: #667eea;
}

.chat-guest-form button {
    padding: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.chat-guest-form button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.chat-guest-form .skip-btn {
    background: transparent;
    color: #6b7280;
    font-size: 13px;
    text-decoration: underline;
    box-shadow: none;
}

.chat-guest-form .skip-btn:hover {
    color: #667eea;
    box-shadow: none;
    transform: none;
}

/* Chat empty state */
.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    gap: 8px;
}

.chat-empty i {
    font-size: 36px;
    opacity: 0.5;
}

.chat-empty p {
    font-size: 14px;
}

/* Responsive */
@media (max-width: 480px) {
    .chat-box {
        width: calc(100vw - 32px);
        height: calc(100vh - 120px);
        bottom: 76px;
        right: -8px;
        border-radius: 12px;
    }
}
