* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    direction: rtl;
}

.chat-container {
    width: 100%;
    max-width: 800px;
    height: 90vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: white;
    padding: 25px;
    text-align: center;
}

.chat-header h1 {
    font-size: 28px;
    margin-bottom: 5px;
}

.subtitle {
    color: #cbd5e1;
    font-size: 14px;
    margin-bottom: 10px;
}

.status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 12px;
    color: #94a3b8;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(to bottom, #f8fafc 0%, #ffffff 100%);
}

.message {
    display: flex;
    margin-bottom: 20px;
    animation: slideIn 0.3s ease-out;
}

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

.message.user {
    justify-content: flex-end;
}

.message.assistant {
    justify-content: flex-start;
}

.message-content {
    max-width: 80%;
    padding: 15px 20px;
    border-radius: 18px;
    line-height: 1.6;
}

.message.user .message-content {
    background: #2563eb;
    color: white;
    border-bottom-left-radius: 4px;
}

.message.assistant .message-content {
    background: white;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-bottom-right-radius: 4px;
}

.sender-name {
    font-size: 12px;
    font-weight: bold;
    color: #64748b;
    margin-bottom: 8px;
}

.message-time {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 6px;
    text-align: left;
}

.message.user .message-time {
    text-align: right;
}

.message-content p {
    margin-bottom: 10px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.typing-indicator {
    padding: 20px;
    background: #f8fafc;
}

.typing-content {
    max-width: 80%;
    background: white;
    padding: 15px 20px;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.typing-dots span {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: bounce 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 bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

.typing-text {
    color: #64748b;
    font-size: 14px;
}

.contact-form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.contact-form {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.3s ease-out;
}

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

.contact-form h3 {
    color: #1e293b;
    margin-bottom: 10px;
    font-size: 24px;
}

.contact-form p {
    color: #64748b;
    margin-bottom: 20px;
}

.contact-form input {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.contact-form input:focus {
    outline: none;
    border-color: #2563eb;
}

.contact-form button {
    width: 100%;
    padding: 15px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.contact-form button:hover {
    background: #1e40af;
}

.input-area {
    border-top: 1px solid #e2e8f0;
    padding: 20px;
    background: white;
}

.input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.input-container input {
    flex: 1;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.input-container input:focus {
    outline: none;
    border-color: #2563eb;
}

.input-container button {
    padding: 15px 30px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.input-container button:hover {
    background: #1e40af;
    transform: translateY(-2px);
}

.input-container button:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
}

.security-notice {
    text-align: center;
    font-size: 12px;
    color: #64748b;
}

/* Scrollbar styling */
.messages-area::-webkit-scrollbar {
    width: 8px;
}

.messages-area::-webkit-scrollbar-track {
    background: #f1f5f9;
}

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

.messages-area::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Mobile responsive */
@media (max-width: 768px) {
    body {
        padding: 0;
    }
    
    .chat-container {
        height: 100vh;
        border-radius: 0;
    }
    
    .chat-header h1 {
        font-size: 24px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .contact-form {
        width: 95%;
        padding: 30px 20px;
    }
}
