/* Chat Widget Styles */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 500px;
    background: var(--bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    animation: slideUp 0.3s ease-out;
}

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

.chat-header {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    padding: 15px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header-content {
    display: flex;
    align-items: center;
    color: white;
}

.chat-header-actions button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.chat-header-actions button:hover {
    opacity: 1;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--bg-dark-secondary);
}

.chat-message {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

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

.message-avatar {
    width: 36px;
    height: 36px;
    background: var(--primary-blue);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.chat-message.user .message-avatar {
    background: var(--secondary-color);
}

.message-content {
    max-width: 80%;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 16px;
    border-radius: 8px;
    color: var(--text-light);
}

.chat-message.user .message-content {
    background: var(--primary-blue);
    color: white;
}

.message-content p {
    margin: 0;
}

.quick-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.quick-action-btn {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.quick-action-btn:hover {
    background: var(--secondary-blue);
    transform: translateX(5px);
}

.chat-input-container {
    display: flex;
    padding: 15px;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 10px;
    color: var(--text-light);
    resize: none;
    font-family: inherit;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.chat-send-btn {
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.chat-send-btn:hover {
    background: var(--secondary-blue);
}

.chat-powered-by {
    padding: 10px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Chat Launch Button */
.chat-launch-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    border: none;
    border-radius: 30px;
    padding: 15px 25px;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    z-index: 9998;
}

.chat-launch-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .chat-widget {
        width: 100%;
        height: 100%;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .chat-launch-btn {
        bottom: 10px;
        right: 10px;
    }
}

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

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-blue);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Emergency Alert Style */
.emergency-alert {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* Chat Registration Form */
.chat-registration {
    padding: 15px;
    overflow-y: auto;
    flex: 1;
}

.chat-form {
    padding: 15px;
    background: rgba(30, 41, 59, 0.8);
    border-radius: 8px;
    margin-top: 10px;
}

.chat-form .form-group {
    margin-bottom: 15px;
}

.chat-form .form-label {
    font-size: 13px;
    margin-bottom: 5px;
    color: #cbd5e1 !important;
}

.chat-form .form-control {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(20, 184, 166, 0.3);
    color: #e2e8f0;
    font-size: 14px;
    padding: 8px 12px;
}

.chat-form .form-control:focus {
    background: rgba(15, 23, 42, 0.95);
    border-color: var(--teal-primary);
    box-shadow: 0 0 0 0.2rem rgba(20, 184, 166, 0.25);
    color: #f1f5f9;
}

.chat-form .form-control::placeholder {
    color: #64748b;
}

.chat-form select.form-control option {
    background: #0f172a;
    color: #e2e8f0;
}