/* Chat Widget Styles */
.chat-widget {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    display: none;
    flex-direction: column;
    font-family: 'Roboto', sans-serif;
    overflow: hidden;
}

.chat-widget.active {
    display: flex;
}

.chat-header {
    background: linear-gradient(135deg, #003087, #004D99);
    color: white;
    padding: 15px 20px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.chat-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.chat-status {
    display: flex;
    align-items: center;
    font-size: 12px;
    margin-top: 2px;
}

.chat-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 5px;
    background: #4CAF50;
}

.chat-status.offline .status-dot {
    background: #f44336;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.chat-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-message {
    display: flex;
    margin-bottom: 15px;
}

.chat-message.user {
    justify-content: flex-end;
}

.chat-message.admin {
    justify-content: flex-start;
}

.message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    position: relative;
}

.chat-message.user .message-content {
    background: #003087;
    color: white;
    border-bottom-right-radius: 6px;
}

.chat-message.admin .message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.chat-message.system .message-content {
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 12px;
    font-style: italic;
    text-align: center;
    margin: 0 auto;
    font-size: 13px;
}

.message-time {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 4px;
    text-align: right;
}

.chat-message.admin .message-time {
    text-align: left;
}

.message-sender {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 2px;
    opacity: 0.8;
}

.typing-indicator {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: white;
    border-radius: 18px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    max-width: 80%;
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #666;
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.typing-text {
    margin-left: 8px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.chat-input-container {
    padding: 15px 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.chat-input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    outline: none;
    resize: none;
    max-height: 80px;
    min-height: 40px;
    line-height: 1.4;
}

.chat-input:focus {
    border-color: #003087;
}

.chat-send-btn {
    background: #003087;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: #004D99;
}

.chat-send-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Guest form styles */
.guest-form {
    padding: 20px;
    background: white;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
}

.guest-form h5 {
    color: #003087;
    margin-bottom: 10px;
    text-align: center;
}

.guest-form input {
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

.guest-form input:focus {
    border-color: #003087;
}

.guest-form button {
    background: #003087;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.guest-form button:hover {
    background: #004D99;
}

/* Connection status */
.connection-status {
    padding: 8px 20px;
    background: #fff3cd;
    color: #856404;
    font-size: 12px;
    text-align: center;
    border-top: 1px solid #ffeaa7;
}

.connection-status.connected {
    background: #d4edda;
    color: #155724;
    border-top-color: #c3e6cb;
}

.connection-status.disconnected {
    background: #f8d7da;
    color: #721c24;
    border-top-color: #f1b0b7;
}

/* Responsive */
@media (max-width: 480px) {
    .chat-widget {
        width: calc(100vw - 20px);
        right: 10px;
        left: 10px;
        height: 70vh;
        bottom: 80px;
    }
}

/* Scrollbar styles */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
