.aitutor-widget {
    margin: 30px 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    direction: rtl;
}

.aitutor-header {
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.aitutor-header h3 {
    margin: 0;
    font-size: 18px;
}

.aitutor-messages {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    padding: 15px;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.aitutor-welcome {
    text-align: center;
    opacity: 0.8;
    padding: 30px 0;
}

.aitutor-message {
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    animation: fadeIn 0.3s ease;
}

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

.aitutor-message.user {
    background: rgba(255, 255, 255, 0.2);
    text-align: right;
}

.aitutor-message.bot {
    background: rgba(255, 255, 255, 0.1);
}

.aitutor-form {
    margin-bottom: 10px;
}

#aitutor-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 8px;
    padding: 10px;
    color: #333;
    font-size: 14px;
    margin-bottom: 10px;
    font-family: inherit;
}

#aitutor-input:focus {
    outline: none;
    background: white;
}

.aitutor-buttons {
    display: flex;
    gap: 10px;
    flex-direction: row-reverse;
}

.btn {
    flex: 1;
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary {
    background: white;
    color: #667eea;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
}

.aitutor-typing {
    display: inline-block;
    font-size: 12px;
    opacity: 0.7;
}

.aitutor-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    animation: bounce 1.4s infinite;
    margin: 0 2px;
}

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

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

@keyframes bounce {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

.aitutor-error {
    background: #ff6b6b;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 10px;
}

@media (max-width: 768px) {
    .aitutor-widget {
        padding: 15px;
    }

    #aitutor-input {
        font-size: 16px;
    }

    .btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}
